From cb12586cec73cffbc373be5fb9ca82b717ba84b4 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 31 May 2024 18:06:14 +0200 Subject: [PATCH 01/59] Init project structure, added linting configuration --- .gitignore | 9 +- pom.xml | 60 ++++ .../com/corbado/entities/package-info.java | 4 + .../com/corbado/exceptions/package-info.java | 4 + .../com/corbado/generated/package-info.java | 4 + src/main/java/com/corbado/sdk/Config.java | 8 + src/main/java/com/corbado/sdk/CorbadoSDK.java | 26 ++ .../java/com/corbado/sdk/package-info.java | 4 + .../com/corbado/services/package-info.java | 4 + .../java/com/corbado/utils/package-info.java | 4 + src/main/resources/checkstyle.xml | 279 ++++++++++++++++++ src/main/resources/suppressions.xml | 15 + 12 files changed, 420 insertions(+), 1 deletion(-) create mode 100644 pom.xml create mode 100644 src/main/java/com/corbado/entities/package-info.java create mode 100644 src/main/java/com/corbado/exceptions/package-info.java create mode 100644 src/main/java/com/corbado/generated/package-info.java create mode 100644 src/main/java/com/corbado/sdk/Config.java create mode 100644 src/main/java/com/corbado/sdk/CorbadoSDK.java create mode 100644 src/main/java/com/corbado/sdk/package-info.java create mode 100644 src/main/java/com/corbado/services/package-info.java create mode 100644 src/main/java/com/corbado/utils/package-info.java create mode 100644 src/main/resources/checkstyle.xml create mode 100644 src/main/resources/suppressions.xml diff --git a/.gitignore b/.gitignore index 2f259b7..9fa0641 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,8 @@ -s \ No newline at end of file +/bin/ +/target/ +.project +.settings +.classpath +/corbado-java-cs-cleanup.xml +/corbado-java-cs-formatter.xml +/.checkstyle diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..ef5b95c --- /dev/null +++ b/pom.xml @@ -0,0 +1,60 @@ + + 4.0.0 + corbado-java + corbado-java + 1.0.0 + Corbado Java + Corbado Java SDK + + src/main/java + + + + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.3.1 + + true + src/main/resources/checkstyle.xml + src/main/resources/suppressions.xml + + + + com.puppycrawl.tools + checkstyle + 9.3 + + + + + validate + + check + + + + + + + + + + + + + org.junit.jupiter + junit-jupiter-api + 5.8.0 + test + + + diff --git a/src/main/java/com/corbado/entities/package-info.java b/src/main/java/com/corbado/entities/package-info.java new file mode 100644 index 0000000..341974e --- /dev/null +++ b/src/main/java/com/corbado/entities/package-info.java @@ -0,0 +1,4 @@ +/** + * Desc. + */ +package com.corbado.entities; diff --git a/src/main/java/com/corbado/exceptions/package-info.java b/src/main/java/com/corbado/exceptions/package-info.java new file mode 100644 index 0000000..049be3c --- /dev/null +++ b/src/main/java/com/corbado/exceptions/package-info.java @@ -0,0 +1,4 @@ +/** + * Desc. + */ +package com.corbado.exceptions; diff --git a/src/main/java/com/corbado/generated/package-info.java b/src/main/java/com/corbado/generated/package-info.java new file mode 100644 index 0000000..1e26e5e --- /dev/null +++ b/src/main/java/com/corbado/generated/package-info.java @@ -0,0 +1,4 @@ +/** + * Desc. + */ +package com.corbado.generated; diff --git a/src/main/java/com/corbado/sdk/Config.java b/src/main/java/com/corbado/sdk/Config.java new file mode 100644 index 0000000..263bb95 --- /dev/null +++ b/src/main/java/com/corbado/sdk/Config.java @@ -0,0 +1,8 @@ +package com.corbado.sdk; + +/** Configuration class. */ +public class Config { + + /** The i. */ + private int i; +} diff --git a/src/main/java/com/corbado/sdk/CorbadoSDK.java b/src/main/java/com/corbado/sdk/CorbadoSDK.java new file mode 100644 index 0000000..eca5e36 --- /dev/null +++ b/src/main/java/com/corbado/sdk/CorbadoSDK.java @@ -0,0 +1,26 @@ +package com.corbado.sdk; + +/** The Class CorbadoSDK. */ +public class CorbadoSDK { + + /** The configuration class. */ + private Config config; + + /** + * Gets the config. + * + * @return the config + */ + public Config getConfig() { + return this.config; + } + + /** + * Sets the config. + * + * @param config the new config + */ + public void setConfig(final Config config) { + this.config = config; + } +} diff --git a/src/main/java/com/corbado/sdk/package-info.java b/src/main/java/com/corbado/sdk/package-info.java new file mode 100644 index 0000000..1c8d51b --- /dev/null +++ b/src/main/java/com/corbado/sdk/package-info.java @@ -0,0 +1,4 @@ +/** + * Desc. + */ +package com.corbado.sdk; diff --git a/src/main/java/com/corbado/services/package-info.java b/src/main/java/com/corbado/services/package-info.java new file mode 100644 index 0000000..841ebc9 --- /dev/null +++ b/src/main/java/com/corbado/services/package-info.java @@ -0,0 +1,4 @@ +/** + * Desc. + */ +package com.corbado.services; diff --git a/src/main/java/com/corbado/utils/package-info.java b/src/main/java/com/corbado/utils/package-info.java new file mode 100644 index 0000000..5d62fbb --- /dev/null +++ b/src/main/java/com/corbado/utils/package-info.java @@ -0,0 +1,4 @@ +/** + * Desc. + */ +package com.corbado.utils; diff --git a/src/main/resources/checkstyle.xml b/src/main/resources/checkstyle.xml new file mode 100644 index 0000000..feb49c9 --- /dev/null +++ b/src/main/resources/checkstyle.xml @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/suppressions.xml b/src/main/resources/suppressions.xml new file mode 100644 index 0000000..b94beaf --- /dev/null +++ b/src/main/resources/suppressions.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + \ No newline at end of file From d0a247c64eee2cd2e64dcc83472656092450b531 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 21 Jun 2024 18:58:09 +0200 Subject: [PATCH 02/59] Added generated client, dependencies and tweaked code formatters --- pom.xml | 344 +- scripts/generate-openapi.sh | 36 + .../com/corbado/entities/package-info.java | 4 - .../corbado/generated/api/AnalyzerApi.java | 1578 ++++++++++ .../generated/api/AndroidAppConfigApi.java | 591 ++++ .../corbado/generated/api/ApiSecretsApi.java | 451 +++ .../generated/api/AssociationTokensApi.java | 204 ++ .../corbado/generated/api/AuthMethodsApi.java | 204 ++ .../corbado/generated/api/AuthTokensApi.java | 204 ++ .../generated/api/EmailMagicLinksApi.java | 604 ++++ .../corbado/generated/api/EmailOtpApi.java | 471 +++ .../generated/api/EmailTemplatesApi.java | 343 ++ .../corbado/generated/api/ExamplesApi.java | 203 ++ .../generated/api/IOsAppConfigApi.java | 590 ++++ .../generated/api/LongSessionsApi.java | 499 +++ .../generated/api/PasskeysBiometricsApi.java | 2607 ++++++++++++++++ .../generated/api/ProjectConfigApi.java | 579 ++++ .../corbado/generated/api/RequestLogsApi.java | 385 +++ .../generated/api/SessionConfigApi.java | 331 ++ .../com/corbado/generated/api/SmsOtpApi.java | 343 ++ .../generated/api/SmsTemplatesApi.java | 343 ++ .../com/corbado/generated/api/UserApi.java | 2757 +++++++++++++++++ .../corbado/generated/api/ValidationApi.java | 333 ++ .../corbado/generated/api/WebhookLogsApi.java | 241 ++ .../generated/invoker/ApiCallback.java | 62 + .../corbado/generated/invoker/ApiClient.java | 1592 ++++++++++ .../generated/invoker/ApiException.java | 167 + .../generated/invoker/ApiResponse.java | 76 + .../generated/invoker/Configuration.java | 41 + .../invoker/GzipRequestInterceptor.java | 85 + .../com/corbado/generated/invoker/JSON.java | 606 ++++ .../com/corbado/generated/invoker/Pair.java | 57 + .../invoker/ProgressRequestBody.java | 73 + .../invoker/ProgressResponseBody.java | 70 + .../invoker/ServerConfiguration.java | 59 + .../generated/invoker/ServerVariable.java | 24 + .../corbado/generated/invoker/StringUtil.java | 83 + .../generated/invoker/auth/ApiKeyAuth.java | 80 + .../invoker/auth/Authentication.java | 36 + .../generated/invoker/auth/HttpBasicAuth.java | 55 + .../invoker/auth/HttpBearerAuth.java | 75 + .../model/AbstractOpenApiSchema.java | 146 + .../model/AndroidAppConfigDeleteReq.java | 237 ++ .../generated/model/AndroidAppConfigItem.java | 394 +++ .../model/AndroidAppConfigListRsp.java | 378 +++ .../model/AndroidAppConfigSaveReq.java | 304 ++ .../model/AndroidAppConfigSaveRsp.java | 510 +++ .../model/AndroidAppConfigUpdateReq.java | 304 ++ .../model/AndroidAppConfigUpdateRsp.java | 510 +++ .../com/corbado/generated/model/AppType.java | 80 + .../model/AssociationTokenCreateReq.java | 303 ++ .../model/AssociationTokenCreateRsp.java | 330 ++ .../AssociationTokenCreateRspAllOfData.java | 235 ++ .../corbado/generated/model/AuthMethod.java | 82 + .../generated/model/AuthMethodsListReq.java | 273 ++ .../generated/model/AuthMethodsListRsp.java | 330 ++ .../model/AuthMethodsListRspAllOfData.java | 299 ++ .../generated/model/AuthTokenValidateReq.java | 273 ++ .../generated/model/AuthTokenValidateRsp.java | 330 ++ .../corbado/generated/model/ClientInfo.java | 244 ++ .../model/CustomLoginIdentifier.java | 333 ++ .../com/corbado/generated/model/Email.java | 363 +++ .../corbado/generated/model/EmailCode.java | 477 +++ .../generated/model/EmailCodeGetRsp.java | 330 ++ .../model/EmailCodeGetRspAllOfData.java | 214 ++ .../generated/model/EmailCodeSendReq.java | 417 +++ .../generated/model/EmailCodeSendRsp.java | 330 ++ .../model/EmailCodeSendRspAllOfData.java | 214 ++ .../generated/model/EmailCodeValidateReq.java | 300 ++ .../generated/model/EmailCodeValidateRsp.java | 448 +++ .../corbado/generated/model/EmailLink.java | 506 +++ .../generated/model/EmailLinkGetRsp.java | 330 ++ .../model/EmailLinkGetRspAllOfData.java | 214 ++ .../generated/model/EmailLinkSendReq.java | 535 ++++ .../generated/model/EmailLinkSendRsp.java | 330 ++ .../model/EmailLinkSendRspAllOfData.java | 214 ++ .../generated/model/EmailLinkValidateRsp.java | 448 +++ .../generated/model/EmailLinksDeleteReq.java | 245 ++ .../model/EmailLinksValidateReq.java | 300 ++ .../model/EmailTemplateCreateReq.java | 806 +++++ .../model/EmailTemplateCreateRsp.java | 330 ++ .../EmailTemplateCreateRspAllOfData.java | 214 ++ .../model/EmailTemplateDeleteReq.java | 237 ++ .../model/EmailValidationResult.java | 361 +++ .../com/corbado/generated/model/EmptyReq.java | 237 ++ .../com/corbado/generated/model/ErrorRsp.java | 356 +++ .../generated/model/ErrorRspAllOfError.java | 335 ++ .../model/ErrorRspAllOfErrorValidation.java | 244 ++ .../generated/model/ExampleGetRsp.java | 414 +++ .../com/corbado/generated/model/FullUser.java | 550 ++++ .../corbado/generated/model/GenericRsp.java | 300 ++ .../model/IOSAppConfigDeleteReq.java | 237 ++ .../generated/model/IOSAppConfigItem.java | 364 +++ .../generated/model/IOSAppConfigListRsp.java | 378 +++ .../generated/model/IOSAppConfigSaveReq.java | 304 ++ .../generated/model/IOSAppConfigSaveRsp.java | 480 +++ .../model/IOSAppConfigUpdateReq.java | 304 ++ .../model/IOSAppConfigUpdateRsp.java | 480 +++ .../generated/model/LoginIdentifierType.java | 80 + .../corbado/generated/model/LongSession.java | 514 +++ .../generated/model/LongSessionGetRsp.java | 330 ++ .../model/LongSessionGetRspAllOfData.java | 214 ++ .../generated/model/LongSessionListRsp.java | 330 ++ .../model/LongSessionListRspAllOfData.java | 262 ++ .../generated/model/LongSessionRevokeReq.java | 237 ++ .../com/corbado/generated/model/Paging.java | 265 ++ .../corbado/generated/model/PhoneNumber.java | 334 ++ .../model/PhoneNumberValidationResult.java | 330 ++ .../generated/model/ProjectConfig.java | 2294 ++++++++++++++ .../generated/model/ProjectConfigGetRsp.java | 330 ++ .../generated/model/ProjectConfigSaveReq.java | 2036 ++++++++++++ .../model/ProjectConfigWebhookTestReq.java | 328 ++ .../model/ProjectConfigWebhookTestRsp.java | 330 ++ .../ProjectConfigWebhookTestRspAllOfData.java | 272 ++ .../model/ProjectSecretCreateReq.java | 237 ++ .../model/ProjectSecretCreateRsp.java | 419 +++ .../model/ProjectSecretDeleteReq.java | 237 ++ .../generated/model/ProjectSecretItem.java | 303 ++ .../generated/model/ProjectSecretListRsp.java | 378 +++ .../corbado/generated/model/RequestData.java | 244 ++ .../corbado/generated/model/RequestLog.java | 706 +++++ .../generated/model/RequestLogGetRsp.java | 330 ++ .../generated/model/RequestLogsListRsp.java | 330 ++ .../model/RequestLogsListRspAllOfData.java | 262 ++ .../generated/model/SessionConfig.java | 756 +++++ .../generated/model/SessionConfigGetRsp.java | 330 ++ .../model/SessionConfigUpdateReq.java | 719 +++++ .../model/SessionTokenCreateReq.java | 303 ++ .../model/SessionTokenCreateRsp.java | 330 ++ .../model/SessionTokenCreateRspAllOfData.java | 214 ++ .../model/SessionTokenVerifyReq.java | 273 ++ .../model/SessionTokenVerifyRsp.java | 330 ++ .../model/SessionTokenVerifyRspAllOfData.java | 274 ++ .../generated/model/SmsCodeSendReq.java | 359 +++ .../generated/model/SmsCodeSendRsp.java | 330 ++ .../model/SmsCodeSendRspAllOfData.java | 214 ++ .../generated/model/SmsCodeValidateReq.java | 300 ++ .../generated/model/SmsCodeValidateRsp.java | 329 ++ .../generated/model/SmsTemplateCreateReq.java | 415 +++ .../generated/model/SmsTemplateCreateRsp.java | 330 ++ .../model/SmsTemplateCreateRspAllOfData.java | 214 ++ .../generated/model/SmsTemplateDeleteReq.java | 237 ++ .../generated/model/SocialProviderType.java | 80 + .../com/corbado/generated/model/Status.java | 80 + .../generated/model/TrackingBackupState.java | 238 ++ .../model/TrackingBackupStateGetRsp.java | 330 ++ .../model/TrackingBrowserDetailedStats.java | 382 +++ .../TrackingBrowserDetailedStatsListRsp.java | 330 ++ ...gBrowserDetailedStatsListRspAllOfData.java | 262 ++ .../generated/model/TrackingBrowserStats.java | 349 +++ .../model/TrackingBrowserStatsListRsp.java | 330 ++ .../TrackingBrowserStatsListRspAllOfData.java | 262 ++ .../model/TrackingDetailedStats.java | 322 ++ .../model/TrackingDetailedStatsListRsp.java | 330 ++ ...TrackingDetailedStatsListRspAllOfData.java | 262 ++ .../generated/model/TrackingEnums.java | 309 ++ .../generated/model/TrackingEnumsGetRsp.java | 330 ++ .../model/TrackingOSDetailedStats.java | 468 +++ .../model/TrackingOSDetailedStatsListRsp.java | 330 ++ ...ackingOSDetailedStatsListRspAllOfData.java | 262 ++ .../generated/model/TrackingOSStats.java | 349 +++ .../model/TrackingOSStatsListRsp.java | 330 ++ .../TrackingOSStatsListRspAllOfData.java | 262 ++ .../generated/model/TrackingRawListRow.java | 355 +++ .../generated/model/TrackingRawListRsp.java | 378 +++ .../generated/model/TrackingStats.java | 322 ++ .../generated/model/TrackingStatsListRsp.java | 330 ++ .../model/TrackingStatsListRspAllOfData.java | 262 ++ .../com/corbado/generated/model/User.java | 364 +++ .../corbado/generated/model/UserAuthLog.java | 364 +++ .../generated/model/UserAuthLogListRsp.java | 330 ++ .../model/UserAuthLogListRspAllOfData.java | 262 ++ .../generated/model/UserCreateReq.java | 361 +++ .../generated/model/UserCreateRsp.java | 330 ++ .../model/UserCreateRspAllOfData.java | 274 ++ .../UserCustomLoginIdentifierCreateReq.java | 303 ++ .../UserCustomLoginIdentifierCreateRsp.java | 330 ++ ...stomLoginIdentifierCreateRspAllOfData.java | 214 ++ .../UserCustomLoginIdentifierDeleteReq.java | 237 ++ .../UserCustomLoginIdentifierGetRsp.java | 330 ++ ...rCustomLoginIdentifierGetRspAllOfData.java | 214 ++ .../generated/model/UserDeleteReq.java | 237 ++ .../corbado/generated/model/UserDevice.java | 454 +++ .../generated/model/UserDeviceListRsp.java | 378 +++ .../corbado/generated/model/UserEmail.java | 334 ++ .../generated/model/UserEmailCreateReq.java | 274 ++ .../generated/model/UserEmailCreateRsp.java | 330 ++ .../model/UserEmailCreateRspAllOfData.java | 214 ++ .../generated/model/UserEmailDeleteReq.java | 237 ++ .../generated/model/UserEmailGetRsp.java | 330 ++ .../model/UserEmailGetRspAllOfData.java | 214 ++ .../generated/model/UserExistsReq.java | 304 ++ .../generated/model/UserExistsRsp.java | 327 ++ .../corbado/generated/model/UserGetRsp.java | 330 ++ .../corbado/generated/model/UserListRsp.java | 330 ++ .../generated/model/UserListRspAllOfData.java | 262 ++ .../generated/model/UserPhoneNumber.java | 334 ++ .../model/UserPhoneNumberCreateReq.java | 274 ++ .../model/UserPhoneNumberCreateRsp.java | 330 ++ .../UserPhoneNumberCreateRspAllOfData.java | 214 ++ .../model/UserPhoneNumberDeleteReq.java | 237 ++ .../model/UserPhoneNumberGetRsp.java | 330 ++ .../model/UserPhoneNumberGetRspAllOfData.java | 214 ++ .../generated/model/UserSocialAccount.java | 304 ++ .../corbado/generated/model/UserStats.java | 430 +++ .../generated/model/UserStatsListRsp.java | 330 ++ .../model/UserStatsListRspAllOfData.java | 262 ++ .../generated/model/UserUpdateReq.java | 380 +++ .../generated/model/UserUpdateRsp.java | 330 ++ .../corbado/generated/model/UserUsername.java | 334 ++ .../generated/model/ValidateEmailReq.java | 326 ++ .../generated/model/ValidateEmailRsp.java | 330 ++ .../model/ValidatePhoneNumberReq.java | 303 ++ .../model/ValidatePhoneNumberRsp.java | 330 ++ .../generated/model/ValidationEmail.java | 355 +++ .../model/ValidationPhoneNumber.java | 328 ++ .../model/WebAuthnAssociateStartReq.java | 274 ++ .../model/WebAuthnAssociateStartRsp.java | 414 +++ .../model/WebAuthnAuthenticateFinishRsp.java | 503 +++ .../model/WebAuthnAuthenticateStartReq.java | 273 ++ .../model/WebAuthnAuthenticateStartRsp.java | 416 +++ .../model/WebAuthnAuthenticateSuccess.java | 419 +++ .../model/WebAuthnAuthenticatorUpdateReq.java | 274 ++ .../model/WebAuthnCredentialExistsReq.java | 303 ++ .../model/WebAuthnCredentialExistsRsp.java | 327 ++ .../model/WebAuthnCredentialItemRsp.java | 840 +++++ .../model/WebAuthnCredentialListRsp.java | 378 +++ .../model/WebAuthnCredentialReq.java | 330 ++ .../model/WebAuthnCredentialRsp.java | 386 +++ .../generated/model/WebAuthnFinishReq.java | 273 ++ .../model/WebAuthnMediationStartReq.java | 272 ++ .../model/WebAuthnMediationStartRsp.java | 330 ++ .../model/WebAuthnRegisterFinishRsp.java | 503 +++ .../model/WebAuthnRegisterStartReq.java | 387 +++ .../model/WebAuthnRegisterStartRsp.java | 414 +++ .../model/WebauthnSettingCreate.java | 244 ++ .../model/WebauthnSettingCreateReq.java | 304 ++ .../model/WebauthnSettingCreateRsp.java | 450 +++ .../model/WebauthnSettingDeleteReq.java | 237 ++ .../model/WebauthnSettingGetRsp.java | 450 +++ .../generated/model/WebauthnSettingItem.java | 334 ++ .../model/WebauthnSettingListRsp.java | 378 +++ .../model/WebauthnSettingUpdateReq.java | 304 ++ .../model/WebauthnSettingUpdateRsp.java | 450 +++ .../model/WebauthnStatsAuthenticator.java | 241 ++ .../model/WebauthnStatsAuthenticatorRsp.java | 330 ++ ...ebauthnStatsAuthenticatorRspAllOfData.java | 262 ++ .../generated/model/WebauthnStatsType.java | 291 ++ .../generated/model/WebauthnStatsTypeRsp.java | 330 ++ .../model/WebauthnStatsTypeRspAllOfData.java | 262 ++ .../corbado/generated/model/WebhookLog.java | 535 ++++ .../generated/model/WebhookLogsListRsp.java | 330 ++ .../model/WebhookLogsListRspAllOfData.java | 262 ++ src/main/resources/checkstyle.xml | 4 +- src/main/resources/findbugs-exclude.xml | 6 + src/main/resources/suppressions.xml | 3 + 256 files changed, 90571 insertions(+), 55 deletions(-) create mode 100644 scripts/generate-openapi.sh delete mode 100644 src/main/java/com/corbado/entities/package-info.java create mode 100644 src/main/java/com/corbado/generated/api/AnalyzerApi.java create mode 100644 src/main/java/com/corbado/generated/api/AndroidAppConfigApi.java create mode 100644 src/main/java/com/corbado/generated/api/ApiSecretsApi.java create mode 100644 src/main/java/com/corbado/generated/api/AssociationTokensApi.java create mode 100644 src/main/java/com/corbado/generated/api/AuthMethodsApi.java create mode 100644 src/main/java/com/corbado/generated/api/AuthTokensApi.java create mode 100644 src/main/java/com/corbado/generated/api/EmailMagicLinksApi.java create mode 100644 src/main/java/com/corbado/generated/api/EmailOtpApi.java create mode 100644 src/main/java/com/corbado/generated/api/EmailTemplatesApi.java create mode 100644 src/main/java/com/corbado/generated/api/ExamplesApi.java create mode 100644 src/main/java/com/corbado/generated/api/IOsAppConfigApi.java create mode 100644 src/main/java/com/corbado/generated/api/LongSessionsApi.java create mode 100644 src/main/java/com/corbado/generated/api/PasskeysBiometricsApi.java create mode 100644 src/main/java/com/corbado/generated/api/ProjectConfigApi.java create mode 100644 src/main/java/com/corbado/generated/api/RequestLogsApi.java create mode 100644 src/main/java/com/corbado/generated/api/SessionConfigApi.java create mode 100644 src/main/java/com/corbado/generated/api/SmsOtpApi.java create mode 100644 src/main/java/com/corbado/generated/api/SmsTemplatesApi.java create mode 100644 src/main/java/com/corbado/generated/api/UserApi.java create mode 100644 src/main/java/com/corbado/generated/api/ValidationApi.java create mode 100644 src/main/java/com/corbado/generated/api/WebhookLogsApi.java create mode 100644 src/main/java/com/corbado/generated/invoker/ApiCallback.java create mode 100644 src/main/java/com/corbado/generated/invoker/ApiClient.java create mode 100644 src/main/java/com/corbado/generated/invoker/ApiException.java create mode 100644 src/main/java/com/corbado/generated/invoker/ApiResponse.java create mode 100644 src/main/java/com/corbado/generated/invoker/Configuration.java create mode 100644 src/main/java/com/corbado/generated/invoker/GzipRequestInterceptor.java create mode 100644 src/main/java/com/corbado/generated/invoker/JSON.java create mode 100644 src/main/java/com/corbado/generated/invoker/Pair.java create mode 100644 src/main/java/com/corbado/generated/invoker/ProgressRequestBody.java create mode 100644 src/main/java/com/corbado/generated/invoker/ProgressResponseBody.java create mode 100644 src/main/java/com/corbado/generated/invoker/ServerConfiguration.java create mode 100644 src/main/java/com/corbado/generated/invoker/ServerVariable.java create mode 100644 src/main/java/com/corbado/generated/invoker/StringUtil.java create mode 100644 src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java create mode 100644 src/main/java/com/corbado/generated/invoker/auth/Authentication.java create mode 100644 src/main/java/com/corbado/generated/invoker/auth/HttpBasicAuth.java create mode 100644 src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java create mode 100644 src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java create mode 100644 src/main/java/com/corbado/generated/model/AndroidAppConfigDeleteReq.java create mode 100644 src/main/java/com/corbado/generated/model/AndroidAppConfigItem.java create mode 100644 src/main/java/com/corbado/generated/model/AndroidAppConfigListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/AndroidAppConfigSaveReq.java create mode 100644 src/main/java/com/corbado/generated/model/AndroidAppConfigSaveRsp.java create mode 100644 src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateReq.java create mode 100644 src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/AppType.java create mode 100644 src/main/java/com/corbado/generated/model/AssociationTokenCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/AssociationTokenCreateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/AssociationTokenCreateRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/AuthMethod.java create mode 100644 src/main/java/com/corbado/generated/model/AuthMethodsListReq.java create mode 100644 src/main/java/com/corbado/generated/model/AuthMethodsListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/AuthMethodsListRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/AuthTokenValidateReq.java create mode 100644 src/main/java/com/corbado/generated/model/AuthTokenValidateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/ClientInfo.java create mode 100644 src/main/java/com/corbado/generated/model/CustomLoginIdentifier.java create mode 100644 src/main/java/com/corbado/generated/model/Email.java create mode 100644 src/main/java/com/corbado/generated/model/EmailCode.java create mode 100644 src/main/java/com/corbado/generated/model/EmailCodeGetRsp.java create mode 100644 src/main/java/com/corbado/generated/model/EmailCodeGetRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/EmailCodeSendReq.java create mode 100644 src/main/java/com/corbado/generated/model/EmailCodeSendRsp.java create mode 100644 src/main/java/com/corbado/generated/model/EmailCodeSendRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/EmailCodeValidateReq.java create mode 100644 src/main/java/com/corbado/generated/model/EmailCodeValidateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/EmailLink.java create mode 100644 src/main/java/com/corbado/generated/model/EmailLinkGetRsp.java create mode 100644 src/main/java/com/corbado/generated/model/EmailLinkGetRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/EmailLinkSendReq.java create mode 100644 src/main/java/com/corbado/generated/model/EmailLinkSendRsp.java create mode 100644 src/main/java/com/corbado/generated/model/EmailLinkSendRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/EmailLinkValidateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/EmailLinksDeleteReq.java create mode 100644 src/main/java/com/corbado/generated/model/EmailLinksValidateReq.java create mode 100644 src/main/java/com/corbado/generated/model/EmailTemplateCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/EmailTemplateCreateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/EmailTemplateCreateRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/EmailTemplateDeleteReq.java create mode 100644 src/main/java/com/corbado/generated/model/EmailValidationResult.java create mode 100644 src/main/java/com/corbado/generated/model/EmptyReq.java create mode 100644 src/main/java/com/corbado/generated/model/ErrorRsp.java create mode 100644 src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java create mode 100644 src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java create mode 100644 src/main/java/com/corbado/generated/model/ExampleGetRsp.java create mode 100644 src/main/java/com/corbado/generated/model/FullUser.java create mode 100644 src/main/java/com/corbado/generated/model/GenericRsp.java create mode 100644 src/main/java/com/corbado/generated/model/IOSAppConfigDeleteReq.java create mode 100644 src/main/java/com/corbado/generated/model/IOSAppConfigItem.java create mode 100644 src/main/java/com/corbado/generated/model/IOSAppConfigListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/IOSAppConfigSaveReq.java create mode 100644 src/main/java/com/corbado/generated/model/IOSAppConfigSaveRsp.java create mode 100644 src/main/java/com/corbado/generated/model/IOSAppConfigUpdateReq.java create mode 100644 src/main/java/com/corbado/generated/model/IOSAppConfigUpdateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/LoginIdentifierType.java create mode 100644 src/main/java/com/corbado/generated/model/LongSession.java create mode 100644 src/main/java/com/corbado/generated/model/LongSessionGetRsp.java create mode 100644 src/main/java/com/corbado/generated/model/LongSessionGetRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/LongSessionListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/LongSessionListRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/LongSessionRevokeReq.java create mode 100644 src/main/java/com/corbado/generated/model/Paging.java create mode 100644 src/main/java/com/corbado/generated/model/PhoneNumber.java create mode 100644 src/main/java/com/corbado/generated/model/PhoneNumberValidationResult.java create mode 100644 src/main/java/com/corbado/generated/model/ProjectConfig.java create mode 100644 src/main/java/com/corbado/generated/model/ProjectConfigGetRsp.java create mode 100644 src/main/java/com/corbado/generated/model/ProjectConfigSaveReq.java create mode 100644 src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestReq.java create mode 100644 src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRsp.java create mode 100644 src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/ProjectSecretCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/ProjectSecretCreateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/ProjectSecretDeleteReq.java create mode 100644 src/main/java/com/corbado/generated/model/ProjectSecretItem.java create mode 100644 src/main/java/com/corbado/generated/model/ProjectSecretListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/RequestData.java create mode 100644 src/main/java/com/corbado/generated/model/RequestLog.java create mode 100644 src/main/java/com/corbado/generated/model/RequestLogGetRsp.java create mode 100644 src/main/java/com/corbado/generated/model/RequestLogsListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/RequestLogsListRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/SessionConfig.java create mode 100644 src/main/java/com/corbado/generated/model/SessionConfigGetRsp.java create mode 100644 src/main/java/com/corbado/generated/model/SessionConfigUpdateReq.java create mode 100644 src/main/java/com/corbado/generated/model/SessionTokenCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/SessionTokenCreateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/SessionTokenCreateRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/SessionTokenVerifyReq.java create mode 100644 src/main/java/com/corbado/generated/model/SessionTokenVerifyRsp.java create mode 100644 src/main/java/com/corbado/generated/model/SessionTokenVerifyRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/SmsCodeSendReq.java create mode 100644 src/main/java/com/corbado/generated/model/SmsCodeSendRsp.java create mode 100644 src/main/java/com/corbado/generated/model/SmsCodeSendRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/SmsCodeValidateReq.java create mode 100644 src/main/java/com/corbado/generated/model/SmsCodeValidateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/SmsTemplateCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/SmsTemplateCreateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/SmsTemplateCreateRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/SmsTemplateDeleteReq.java create mode 100644 src/main/java/com/corbado/generated/model/SocialProviderType.java create mode 100644 src/main/java/com/corbado/generated/model/Status.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingBackupState.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingBackupStateGetRsp.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStats.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingBrowserStats.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingDetailedStats.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingEnums.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingEnumsGetRsp.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingOSDetailedStats.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingOSStats.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingOSStatsListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingOSStatsListRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingRawListRow.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingRawListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingStats.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingStatsListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/TrackingStatsListRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/User.java create mode 100644 src/main/java/com/corbado/generated/model/UserAuthLog.java create mode 100644 src/main/java/com/corbado/generated/model/UserAuthLogListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/UserAuthLogListRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/UserCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/UserCreateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/UserCreateRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierDeleteReq.java create mode 100644 src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRsp.java create mode 100644 src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/UserDeleteReq.java create mode 100644 src/main/java/com/corbado/generated/model/UserDevice.java create mode 100644 src/main/java/com/corbado/generated/model/UserDeviceListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/UserEmail.java create mode 100644 src/main/java/com/corbado/generated/model/UserEmailCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/UserEmailCreateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/UserEmailCreateRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/UserEmailDeleteReq.java create mode 100644 src/main/java/com/corbado/generated/model/UserEmailGetRsp.java create mode 100644 src/main/java/com/corbado/generated/model/UserEmailGetRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/UserExistsReq.java create mode 100644 src/main/java/com/corbado/generated/model/UserExistsRsp.java create mode 100644 src/main/java/com/corbado/generated/model/UserGetRsp.java create mode 100644 src/main/java/com/corbado/generated/model/UserListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/UserListRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/UserPhoneNumber.java create mode 100644 src/main/java/com/corbado/generated/model/UserPhoneNumberCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/UserPhoneNumberDeleteReq.java create mode 100644 src/main/java/com/corbado/generated/model/UserPhoneNumberGetRsp.java create mode 100644 src/main/java/com/corbado/generated/model/UserPhoneNumberGetRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/UserSocialAccount.java create mode 100644 src/main/java/com/corbado/generated/model/UserStats.java create mode 100644 src/main/java/com/corbado/generated/model/UserStatsListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/UserStatsListRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/UserUpdateReq.java create mode 100644 src/main/java/com/corbado/generated/model/UserUpdateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/UserUsername.java create mode 100644 src/main/java/com/corbado/generated/model/ValidateEmailReq.java create mode 100644 src/main/java/com/corbado/generated/model/ValidateEmailRsp.java create mode 100644 src/main/java/com/corbado/generated/model/ValidatePhoneNumberReq.java create mode 100644 src/main/java/com/corbado/generated/model/ValidatePhoneNumberRsp.java create mode 100644 src/main/java/com/corbado/generated/model/ValidationEmail.java create mode 100644 src/main/java/com/corbado/generated/model/ValidationPhoneNumber.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnAssociateStartReq.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnAssociateStartRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnAuthenticateFinishRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartReq.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnAuthenticateSuccess.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnAuthenticatorUpdateReq.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsReq.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnCredentialItemRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnCredentialListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnCredentialReq.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnCredentialRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnFinishReq.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnMediationStartReq.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnMediationStartRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnRegisterFinishRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnRegisterStartReq.java create mode 100644 src/main/java/com/corbado/generated/model/WebAuthnRegisterStartRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingCreate.java create mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingCreateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingDeleteReq.java create mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingGetRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingItem.java create mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingUpdateReq.java create mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingUpdateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticator.java create mode 100644 src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/WebauthnStatsType.java create mode 100644 src/main/java/com/corbado/generated/model/WebauthnStatsTypeRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebauthnStatsTypeRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/WebhookLog.java create mode 100644 src/main/java/com/corbado/generated/model/WebhookLogsListRsp.java create mode 100644 src/main/java/com/corbado/generated/model/WebhookLogsListRspAllOfData.java create mode 100644 src/main/resources/findbugs-exclude.xml diff --git a/pom.xml b/pom.xml index ef5b95c..c235dad 100644 --- a/pom.xml +++ b/pom.xml @@ -1,60 +1,306 @@ 4.0.0 - corbado-java + com.corbado corbado-java - 1.0.0 + jar + 0.0.1 Corbado Java Corbado Java SDK - - src/main/java - - - - maven-compiler-plugin - 3.8.1 - - 1.8 - 1.8 - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.3.1 - - true - src/main/resources/checkstyle.xml - src/main/resources/suppressions.xml - - + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + src/main/java + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + java.version + ${java.version} + + + -Xms512m -Xmx1500m + methods + 10 + + + - com.puppycrawl.tools - checkstyle - 9.3 + org.junit.jupiter + junit-jupiter-engine + ${junit-version} - - - validate - - check - - - - - - - + + + + maven-dependency-plugin + 3.6.1 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.5.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.6.3 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.4.0 + + true + ${basedir}\src\main\resources\checkstyle.xml + ${basedir}\src\main\resources\suppressions.xml + config_loc=${basedir} + + + + com.puppycrawl.tools + checkstyle + 9.3 + + + + + validate + validate + + check + + + + + + + + + - - - - org.junit.jupiter - junit-jupiter-api - 5.8.0 - test - - + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + + + 1.8 + ${java.version} + ${java.version} + 1.9.0 + 4.11.0 + 2.10.1 + 3.14.0 + 0.2.6 + 1.3.5 + 5.10.2 + 1.10.0 + 2.1.1 + 1.1.1 + UTF-8 + 2.3.0 + diff --git a/scripts/generate-openapi.sh b/scripts/generate-openapi.sh new file mode 100644 index 0000000..d71b80b --- /dev/null +++ b/scripts/generate-openapi.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +GENERATED_PACKAGE_NAME="generated" +SDK_PACKAGE_NAME="com/corbado" +GENERATED_PROJECT_NAME="corbado-java-generated" + +echo "Generating OpenAPI code ..." + +cd "$(dirname "$0")" +rm -rf .gen +mkdir -p .gen +cd .gen +rm -rf ../../src/main/java/$SDK_PACKAGE_NAME/$GENERATED_PACKAGE_NAME +mkdir -p ../../src/main/java/$SDK_PACKAGE_NAME/$GENERATED_PACKAGE_NAME + +curl -s -O https://api.corbado.com/docs/api/openapi/backend_api_public.yml +docker pull openapitools/openapi-generator-cli +docker run -v ${PWD}:/local --user $(id -u):$(id -g) openapitools/openapi-generator-cli generate \ + -i /local/backend_api_public.yml \ + -g java \ + -o /local \ + --additional-properties=packageName=com.corbado.generated \ + --additional-properties=groupId=com.corbado \ + --additional-properties=artifactId=corbado-java-generated \ + --additional-properties=artifactVersion=1.0.0 \ + --additional-properties=invokerPackage=com.corbado.generated.invoker \ + --additional-properties=modelPackage=com.corbado.generated.model \ + --additional-properties=apiPackage=com.corbado.generated.api \ + --additional-properties=useSwaggerAnnotations=false + +cp -r src/main/java/$SDK_PACKAGE_NAME/$GENERATED_PACKAGE_NAME/* ../../src/main/java/$SDK_PACKAGE_NAME/$GENERATED_PACKAGE_NAME +cd .. +rm -rf .gen + + + diff --git a/src/main/java/com/corbado/entities/package-info.java b/src/main/java/com/corbado/entities/package-info.java deleted file mode 100644 index 341974e..0000000 --- a/src/main/java/com/corbado/entities/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Desc. - */ -package com.corbado.entities; diff --git a/src/main/java/com/corbado/generated/api/AnalyzerApi.java b/src/main/java/com/corbado/generated/api/AnalyzerApi.java new file mode 100644 index 0000000..cda8aad --- /dev/null +++ b/src/main/java/com/corbado/generated/api/AnalyzerApi.java @@ -0,0 +1,1578 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.TrackingBackupStateGetRsp; +import com.corbado.generated.model.TrackingBrowserDetailedStatsListRsp; +import com.corbado.generated.model.TrackingBrowserStatsListRsp; +import com.corbado.generated.model.TrackingDetailedStatsListRsp; +import com.corbado.generated.model.TrackingEnumsGetRsp; +import com.corbado.generated.model.TrackingOSDetailedStatsListRsp; +import com.corbado.generated.model.TrackingOSStatsListRsp; +import com.corbado.generated.model.TrackingRawListRsp; +import com.corbado.generated.model.TrackingStatsListRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AnalyzerApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AnalyzerApi() { + this(Configuration.getDefaultApiClient()); + } + + public AnalyzerApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for trackingAllRequest + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of raw tracking data per vistor -
+ */ + public okhttp3.Call trackingAllRequestCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/tracking"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call trackingAllRequestValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + return trackingAllRequestCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Provides project's passkeys raw tracking data per visitor + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return TrackingRawListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of raw tracking data per vistor -
+ */ + public TrackingRawListRsp trackingAllRequest(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = trackingAllRequestWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Provides project's passkeys raw tracking data per visitor + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<TrackingRawListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of raw tracking data per vistor -
+ */ + public ApiResponse trackingAllRequestWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = trackingAllRequestValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Provides project's passkeys raw tracking data per visitor + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of raw tracking data per vistor -
+ */ + public okhttp3.Call trackingAllRequestAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = trackingAllRequestValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for trackingBackupStateGet + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains tracking credential backup state data -
+ */ + public okhttp3.Call trackingBackupStateGetCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/tracking/backupState"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call trackingBackupStateGetValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + return trackingBackupStateGetCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Provides tracking credential backup state data + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return TrackingBackupStateGetRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains tracking credential backup state data -
+ */ + public TrackingBackupStateGetRsp trackingBackupStateGet(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = trackingBackupStateGetWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Provides tracking credential backup state data + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<TrackingBackupStateGetRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains tracking credential backup state data -
+ */ + public ApiResponse trackingBackupStateGetWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = trackingBackupStateGetValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Provides tracking credential backup state data + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains tracking credential backup state data -
+ */ + public okhttp3.Call trackingBackupStateGetAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = trackingBackupStateGetValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for trackingBrowserDetailedStatsList + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all browser tracking data -
+ */ + public okhttp3.Call trackingBrowserDetailedStatsListCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/tracking/browser/stats/detailed"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + if (granularity != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call trackingBrowserDetailedStatsListValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'granularity' is set + if (granularity == null) { + throw new ApiException("Missing the required parameter 'granularity' when calling trackingBrowserDetailedStatsList(Async)"); + } + + return trackingBrowserDetailedStatsListCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Provides detailed browser tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return TrackingBrowserDetailedStatsListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all browser tracking data -
+ */ + public TrackingBrowserDetailedStatsListRsp trackingBrowserDetailedStatsList(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = trackingBrowserDetailedStatsListWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Provides detailed browser tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<TrackingBrowserDetailedStatsListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all browser tracking data -
+ */ + public ApiResponse trackingBrowserDetailedStatsListWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = trackingBrowserDetailedStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Provides detailed browser tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all browser tracking data -
+ */ + public okhttp3.Call trackingBrowserDetailedStatsListAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = trackingBrowserDetailedStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for trackingBrowserStatsList + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of aggregated browser tracking data -
+ */ + public okhttp3.Call trackingBrowserStatsListCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/tracking/browser/stats"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + if (granularity != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call trackingBrowserStatsListValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'granularity' is set + if (granularity == null) { + throw new ApiException("Missing the required parameter 'granularity' when calling trackingBrowserStatsList(Async)"); + } + + return trackingBrowserStatsListCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Provides browser tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return TrackingBrowserStatsListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of aggregated browser tracking data -
+ */ + public TrackingBrowserStatsListRsp trackingBrowserStatsList(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = trackingBrowserStatsListWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Provides browser tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<TrackingBrowserStatsListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of aggregated browser tracking data -
+ */ + public ApiResponse trackingBrowserStatsListWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = trackingBrowserStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Provides browser tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of aggregated browser tracking data -
+ */ + public okhttp3.Call trackingBrowserStatsListAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = trackingBrowserStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for trackingDetailedStatsList + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all tracking data -
+ */ + public okhttp3.Call trackingDetailedStatsListCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/tracking/stats/detailed"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + if (granularity != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call trackingDetailedStatsListValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'granularity' is set + if (granularity == null) { + throw new ApiException("Missing the required parameter 'granularity' when calling trackingDetailedStatsList(Async)"); + } + + return trackingDetailedStatsListCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Provides detailed tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return TrackingDetailedStatsListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all tracking data -
+ */ + public TrackingDetailedStatsListRsp trackingDetailedStatsList(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = trackingDetailedStatsListWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Provides detailed tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<TrackingDetailedStatsListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all tracking data -
+ */ + public ApiResponse trackingDetailedStatsListWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = trackingDetailedStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Provides detailed tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all tracking data -
+ */ + public okhttp3.Call trackingDetailedStatsListAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = trackingDetailedStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for trackingEnumsGet + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains tracking enum values -
+ */ + public okhttp3.Call trackingEnumsGetCall(String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/tracking/enums"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call trackingEnumsGetValidateBeforeCall(String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + return trackingEnumsGetCall(remoteAddress, userAgent, _callback); + + } + + /** + * + * Provides tracking enum values + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @return TrackingEnumsGetRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains tracking enum values -
+ */ + public TrackingEnumsGetRsp trackingEnumsGet(String remoteAddress, String userAgent) throws ApiException { + ApiResponse localVarResp = trackingEnumsGetWithHttpInfo(remoteAddress, userAgent); + return localVarResp.getData(); + } + + /** + * + * Provides tracking enum values + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @return ApiResponse<TrackingEnumsGetRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains tracking enum values -
+ */ + public ApiResponse trackingEnumsGetWithHttpInfo(String remoteAddress, String userAgent) throws ApiException { + okhttp3.Call localVarCall = trackingEnumsGetValidateBeforeCall(remoteAddress, userAgent, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Provides tracking enum values + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains tracking enum values -
+ */ + public okhttp3.Call trackingEnumsGetAsync(String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = trackingEnumsGetValidateBeforeCall(remoteAddress, userAgent, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for trackingOSDetailedStatsList + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all OS tracking data -
+ */ + public okhttp3.Call trackingOSDetailedStatsListCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/tracking/os/stats/detailed"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + if (granularity != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call trackingOSDetailedStatsListValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'granularity' is set + if (granularity == null) { + throw new ApiException("Missing the required parameter 'granularity' when calling trackingOSDetailedStatsList(Async)"); + } + + return trackingOSDetailedStatsListCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Provides detailed OS tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return TrackingOSDetailedStatsListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all OS tracking data -
+ */ + public TrackingOSDetailedStatsListRsp trackingOSDetailedStatsList(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = trackingOSDetailedStatsListWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Provides detailed OS tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<TrackingOSDetailedStatsListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all OS tracking data -
+ */ + public ApiResponse trackingOSDetailedStatsListWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = trackingOSDetailedStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Provides detailed OS tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all OS tracking data -
+ */ + public okhttp3.Call trackingOSDetailedStatsListAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = trackingOSDetailedStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for trackingOSStatsList + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of aggregated OS tracking data -
+ */ + public okhttp3.Call trackingOSStatsListCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/tracking/os/stats"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + if (granularity != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call trackingOSStatsListValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'granularity' is set + if (granularity == null) { + throw new ApiException("Missing the required parameter 'granularity' when calling trackingOSStatsList(Async)"); + } + + return trackingOSStatsListCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Provides os tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return TrackingOSStatsListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of aggregated OS tracking data -
+ */ + public TrackingOSStatsListRsp trackingOSStatsList(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = trackingOSStatsListWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Provides os tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<TrackingOSStatsListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of aggregated OS tracking data -
+ */ + public ApiResponse trackingOSStatsListWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = trackingOSStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Provides os tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of aggregated OS tracking data -
+ */ + public okhttp3.Call trackingOSStatsListAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = trackingOSStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for trackingStatsList + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for tracking data -
+ */ + public okhttp3.Call trackingStatsListCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/tracking/stats"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + if (granularity != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call trackingStatsListValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'granularity' is set + if (granularity == null) { + throw new ApiException("Missing the required parameter 'granularity' when calling trackingStatsList(Async)"); + } + + return trackingStatsListCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Provides aggregated statstics for project's passkeys tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return TrackingStatsListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for tracking data -
+ */ + public TrackingStatsListRsp trackingStatsList(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = trackingStatsListWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Provides aggregated statstics for project's passkeys tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<TrackingStatsListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for tracking data -
+ */ + public ApiResponse trackingStatsListWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = trackingStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Provides aggregated statstics for project's passkeys tracking data + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for tracking data -
+ */ + public okhttp3.Call trackingStatsListAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = trackingStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/AndroidAppConfigApi.java b/src/main/java/com/corbado/generated/api/AndroidAppConfigApi.java new file mode 100644 index 0000000..6771c92 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/AndroidAppConfigApi.java @@ -0,0 +1,591 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.AndroidAppConfigDeleteReq; +import com.corbado.generated.model.AndroidAppConfigListRsp; +import com.corbado.generated.model.AndroidAppConfigSaveReq; +import com.corbado.generated.model.AndroidAppConfigSaveRsp; +import com.corbado.generated.model.AndroidAppConfigUpdateReq; +import com.corbado.generated.model.AndroidAppConfigUpdateRsp; +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.GenericRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AndroidAppConfigApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AndroidAppConfigApi() { + this(Configuration.getDefaultApiClient()); + } + + public AndroidAppConfigApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for androidAppConfigCreate + * @param androidAppConfigSaveReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Android App Config successfully created -
0 Error -
+ */ + public okhttp3.Call androidAppConfigCreateCall(AndroidAppConfigSaveReq androidAppConfigSaveReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = androidAppConfigSaveReq; + + // create path and map variables + String localVarPath = "/v1/androidappconfig"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call androidAppConfigCreateValidateBeforeCall(AndroidAppConfigSaveReq androidAppConfigSaveReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'androidAppConfigSaveReq' is set + if (androidAppConfigSaveReq == null) { + throw new ApiException("Missing the required parameter 'androidAppConfigSaveReq' when calling androidAppConfigCreate(Async)"); + } + + return androidAppConfigCreateCall(androidAppConfigSaveReq, _callback); + + } + + /** + * + * Creates a new Android App Configuration + * @param androidAppConfigSaveReq (required) + * @return AndroidAppConfigSaveRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Android App Config successfully created -
0 Error -
+ */ + public AndroidAppConfigSaveRsp androidAppConfigCreate(AndroidAppConfigSaveReq androidAppConfigSaveReq) throws ApiException { + ApiResponse localVarResp = androidAppConfigCreateWithHttpInfo(androidAppConfigSaveReq); + return localVarResp.getData(); + } + + /** + * + * Creates a new Android App Configuration + * @param androidAppConfigSaveReq (required) + * @return ApiResponse<AndroidAppConfigSaveRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Android App Config successfully created -
0 Error -
+ */ + public ApiResponse androidAppConfigCreateWithHttpInfo(AndroidAppConfigSaveReq androidAppConfigSaveReq) throws ApiException { + okhttp3.Call localVarCall = androidAppConfigCreateValidateBeforeCall(androidAppConfigSaveReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Creates a new Android App Configuration + * @param androidAppConfigSaveReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Android App Config successfully created -
0 Error -
+ */ + public okhttp3.Call androidAppConfigCreateAsync(AndroidAppConfigSaveReq androidAppConfigSaveReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = androidAppConfigCreateValidateBeforeCall(androidAppConfigSaveReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for androidAppConfigDelete + * @param androidAppConfigID Android App Config ID from create (required) + * @param androidAppConfigDeleteReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call androidAppConfigDeleteCall(String androidAppConfigID, AndroidAppConfigDeleteReq androidAppConfigDeleteReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = androidAppConfigDeleteReq; + + // create path and map variables + String localVarPath = "/v1/androidappconfig/{androidAppConfigID}" + .replace("{" + "androidAppConfigID" + "}", localVarApiClient.escapeString(androidAppConfigID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call androidAppConfigDeleteValidateBeforeCall(String androidAppConfigID, AndroidAppConfigDeleteReq androidAppConfigDeleteReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'androidAppConfigID' is set + if (androidAppConfigID == null) { + throw new ApiException("Missing the required parameter 'androidAppConfigID' when calling androidAppConfigDelete(Async)"); + } + + return androidAppConfigDeleteCall(androidAppConfigID, androidAppConfigDeleteReq, _callback); + + } + + /** + * + * Deletes an Android App Config + * @param androidAppConfigID Android App Config ID from create (required) + * @param androidAppConfigDeleteReq (optional) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp androidAppConfigDelete(String androidAppConfigID, AndroidAppConfigDeleteReq androidAppConfigDeleteReq) throws ApiException { + ApiResponse localVarResp = androidAppConfigDeleteWithHttpInfo(androidAppConfigID, androidAppConfigDeleteReq); + return localVarResp.getData(); + } + + /** + * + * Deletes an Android App Config + * @param androidAppConfigID Android App Config ID from create (required) + * @param androidAppConfigDeleteReq (optional) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse androidAppConfigDeleteWithHttpInfo(String androidAppConfigID, AndroidAppConfigDeleteReq androidAppConfigDeleteReq) throws ApiException { + okhttp3.Call localVarCall = androidAppConfigDeleteValidateBeforeCall(androidAppConfigID, androidAppConfigDeleteReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Deletes an Android App Config + * @param androidAppConfigID Android App Config ID from create (required) + * @param androidAppConfigDeleteReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call androidAppConfigDeleteAsync(String androidAppConfigID, AndroidAppConfigDeleteReq androidAppConfigDeleteReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = androidAppConfigDeleteValidateBeforeCall(androidAppConfigID, androidAppConfigDeleteReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for androidAppConfigGet + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Android App Config List successfully retrieved -
0 Error -
+ */ + public okhttp3.Call androidAppConfigGetCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/androidappconfig"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call androidAppConfigGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return androidAppConfigGetCall(_callback); + + } + + /** + * + * Lists Android App Configurations for a project + * @return AndroidAppConfigListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Android App Config List successfully retrieved -
0 Error -
+ */ + public AndroidAppConfigListRsp androidAppConfigGet() throws ApiException { + ApiResponse localVarResp = androidAppConfigGetWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * Lists Android App Configurations for a project + * @return ApiResponse<AndroidAppConfigListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Android App Config List successfully retrieved -
0 Error -
+ */ + public ApiResponse androidAppConfigGetWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = androidAppConfigGetValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Lists Android App Configurations for a project + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Android App Config List successfully retrieved -
0 Error -
+ */ + public okhttp3.Call androidAppConfigGetAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = androidAppConfigGetValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for androidAppConfigPut + * @param androidAppConfigID ID from Android config create (required) + * @param androidAppConfigUpdateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains Android app config -
0 Error -
+ */ + public okhttp3.Call androidAppConfigPutCall(String androidAppConfigID, AndroidAppConfigUpdateReq androidAppConfigUpdateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = androidAppConfigUpdateReq; + + // create path and map variables + String localVarPath = "/v1/androidappconfig/{androidAppConfigID}" + .replace("{" + "androidAppConfigID" + "}", localVarApiClient.escapeString(androidAppConfigID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call androidAppConfigPutValidateBeforeCall(String androidAppConfigID, AndroidAppConfigUpdateReq androidAppConfigUpdateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'androidAppConfigID' is set + if (androidAppConfigID == null) { + throw new ApiException("Missing the required parameter 'androidAppConfigID' when calling androidAppConfigPut(Async)"); + } + + return androidAppConfigPutCall(androidAppConfigID, androidAppConfigUpdateReq, _callback); + + } + + /** + * + * Updates an Android app config by id + * @param androidAppConfigID ID from Android config create (required) + * @param androidAppConfigUpdateReq (optional) + * @return AndroidAppConfigUpdateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains Android app config -
0 Error -
+ */ + public AndroidAppConfigUpdateRsp androidAppConfigPut(String androidAppConfigID, AndroidAppConfigUpdateReq androidAppConfigUpdateReq) throws ApiException { + ApiResponse localVarResp = androidAppConfigPutWithHttpInfo(androidAppConfigID, androidAppConfigUpdateReq); + return localVarResp.getData(); + } + + /** + * + * Updates an Android app config by id + * @param androidAppConfigID ID from Android config create (required) + * @param androidAppConfigUpdateReq (optional) + * @return ApiResponse<AndroidAppConfigUpdateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains Android app config -
0 Error -
+ */ + public ApiResponse androidAppConfigPutWithHttpInfo(String androidAppConfigID, AndroidAppConfigUpdateReq androidAppConfigUpdateReq) throws ApiException { + okhttp3.Call localVarCall = androidAppConfigPutValidateBeforeCall(androidAppConfigID, androidAppConfigUpdateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Updates an Android app config by id + * @param androidAppConfigID ID from Android config create (required) + * @param androidAppConfigUpdateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains Android app config -
0 Error -
+ */ + public okhttp3.Call androidAppConfigPutAsync(String androidAppConfigID, AndroidAppConfigUpdateReq androidAppConfigUpdateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = androidAppConfigPutValidateBeforeCall(androidAppConfigID, androidAppConfigUpdateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/ApiSecretsApi.java b/src/main/java/com/corbado/generated/api/ApiSecretsApi.java new file mode 100644 index 0000000..9d0e975 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/ApiSecretsApi.java @@ -0,0 +1,451 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.GenericRsp; +import com.corbado.generated.model.ProjectSecretCreateReq; +import com.corbado.generated.model.ProjectSecretCreateRsp; +import com.corbado.generated.model.ProjectSecretDeleteReq; +import com.corbado.generated.model.ProjectSecretListRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApiSecretsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ApiSecretsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ApiSecretsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for projectSecretCreate + * @param projectSecretCreateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 API secret successfully created -
0 Error -
+ */ + public okhttp3.Call projectSecretCreateCall(ProjectSecretCreateReq projectSecretCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = projectSecretCreateReq; + + // create path and map variables + String localVarPath = "/v1/projectSecrets"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call projectSecretCreateValidateBeforeCall(ProjectSecretCreateReq projectSecretCreateReq, final ApiCallback _callback) throws ApiException { + return projectSecretCreateCall(projectSecretCreateReq, _callback); + + } + + /** + * + * Creates an API secret + * @param projectSecretCreateReq (optional) + * @return ProjectSecretCreateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 API secret successfully created -
0 Error -
+ */ + public ProjectSecretCreateRsp projectSecretCreate(ProjectSecretCreateReq projectSecretCreateReq) throws ApiException { + ApiResponse localVarResp = projectSecretCreateWithHttpInfo(projectSecretCreateReq); + return localVarResp.getData(); + } + + /** + * + * Creates an API secret + * @param projectSecretCreateReq (optional) + * @return ApiResponse<ProjectSecretCreateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 API secret successfully created -
0 Error -
+ */ + public ApiResponse projectSecretCreateWithHttpInfo(ProjectSecretCreateReq projectSecretCreateReq) throws ApiException { + okhttp3.Call localVarCall = projectSecretCreateValidateBeforeCall(projectSecretCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Creates an API secret + * @param projectSecretCreateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 API secret successfully created -
0 Error -
+ */ + public okhttp3.Call projectSecretCreateAsync(ProjectSecretCreateReq projectSecretCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = projectSecretCreateValidateBeforeCall(projectSecretCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for projectSecretDelete + * @param secretID Secret ID from create (required) + * @param projectSecretDeleteReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call projectSecretDeleteCall(String secretID, ProjectSecretDeleteReq projectSecretDeleteReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = projectSecretDeleteReq; + + // create path and map variables + String localVarPath = "/v1/projectSecrets/{secretID}" + .replace("{" + "secretID" + "}", localVarApiClient.escapeString(secretID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call projectSecretDeleteValidateBeforeCall(String secretID, ProjectSecretDeleteReq projectSecretDeleteReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secretID' is set + if (secretID == null) { + throw new ApiException("Missing the required parameter 'secretID' when calling projectSecretDelete(Async)"); + } + + return projectSecretDeleteCall(secretID, projectSecretDeleteReq, _callback); + + } + + /** + * + * Deletes API secret + * @param secretID Secret ID from create (required) + * @param projectSecretDeleteReq (optional) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp projectSecretDelete(String secretID, ProjectSecretDeleteReq projectSecretDeleteReq) throws ApiException { + ApiResponse localVarResp = projectSecretDeleteWithHttpInfo(secretID, projectSecretDeleteReq); + return localVarResp.getData(); + } + + /** + * + * Deletes API secret + * @param secretID Secret ID from create (required) + * @param projectSecretDeleteReq (optional) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse projectSecretDeleteWithHttpInfo(String secretID, ProjectSecretDeleteReq projectSecretDeleteReq) throws ApiException { + okhttp3.Call localVarCall = projectSecretDeleteValidateBeforeCall(secretID, projectSecretDeleteReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Deletes API secret + * @param secretID Secret ID from create (required) + * @param projectSecretDeleteReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call projectSecretDeleteAsync(String secretID, ProjectSecretDeleteReq projectSecretDeleteReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = projectSecretDeleteValidateBeforeCall(secretID, projectSecretDeleteReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for projectSecretList + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of API secrets -
0 Error -
+ */ + public okhttp3.Call projectSecretListCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/projectSecrets"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call projectSecretListValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return projectSecretListCall(_callback); + + } + + /** + * + * Lists API secrets + * @return ProjectSecretListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of API secrets -
0 Error -
+ */ + public ProjectSecretListRsp projectSecretList() throws ApiException { + ApiResponse localVarResp = projectSecretListWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * Lists API secrets + * @return ApiResponse<ProjectSecretListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of API secrets -
0 Error -
+ */ + public ApiResponse projectSecretListWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = projectSecretListValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Lists API secrets + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of API secrets -
0 Error -
+ */ + public okhttp3.Call projectSecretListAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = projectSecretListValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/AssociationTokensApi.java b/src/main/java/com/corbado/generated/api/AssociationTokensApi.java new file mode 100644 index 0000000..f78fb1f --- /dev/null +++ b/src/main/java/com/corbado/generated/api/AssociationTokensApi.java @@ -0,0 +1,204 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.AssociationTokenCreateReq; +import com.corbado.generated.model.AssociationTokenCreateRsp; +import com.corbado.generated.model.ErrorRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AssociationTokensApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AssociationTokensApi() { + this(Configuration.getDefaultApiClient()); + } + + public AssociationTokensApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for associationTokenCreate + * @param associationTokenCreateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Association token successfully created -
0 Error -
+ */ + public okhttp3.Call associationTokenCreateCall(AssociationTokenCreateReq associationTokenCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = associationTokenCreateReq; + + // create path and map variables + String localVarPath = "/v1/associationTokens"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call associationTokenCreateValidateBeforeCall(AssociationTokenCreateReq associationTokenCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'associationTokenCreateReq' is set + if (associationTokenCreateReq == null) { + throw new ApiException("Missing the required parameter 'associationTokenCreateReq' when calling associationTokenCreate(Async)"); + } + + return associationTokenCreateCall(associationTokenCreateReq, _callback); + + } + + /** + * + * Creates a new association token + * @param associationTokenCreateReq (required) + * @return AssociationTokenCreateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Association token successfully created -
0 Error -
+ */ + public AssociationTokenCreateRsp associationTokenCreate(AssociationTokenCreateReq associationTokenCreateReq) throws ApiException { + ApiResponse localVarResp = associationTokenCreateWithHttpInfo(associationTokenCreateReq); + return localVarResp.getData(); + } + + /** + * + * Creates a new association token + * @param associationTokenCreateReq (required) + * @return ApiResponse<AssociationTokenCreateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Association token successfully created -
0 Error -
+ */ + public ApiResponse associationTokenCreateWithHttpInfo(AssociationTokenCreateReq associationTokenCreateReq) throws ApiException { + okhttp3.Call localVarCall = associationTokenCreateValidateBeforeCall(associationTokenCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Creates a new association token + * @param associationTokenCreateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Association token successfully created -
0 Error -
+ */ + public okhttp3.Call associationTokenCreateAsync(AssociationTokenCreateReq associationTokenCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = associationTokenCreateValidateBeforeCall(associationTokenCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/AuthMethodsApi.java b/src/main/java/com/corbado/generated/api/AuthMethodsApi.java new file mode 100644 index 0000000..e9b8a72 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/AuthMethodsApi.java @@ -0,0 +1,204 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.AuthMethodsListReq; +import com.corbado.generated.model.AuthMethodsListRsp; +import com.corbado.generated.model.ErrorRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AuthMethodsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AuthMethodsApi() { + this(Configuration.getDefaultApiClient()); + } + + public AuthMethodsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for authMethodsList + * @param authMethodsListReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
+ */ + public okhttp3.Call authMethodsListCall(AuthMethodsListReq authMethodsListReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = authMethodsListReq; + + // create path and map variables + String localVarPath = "/v1/authMethods"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call authMethodsListValidateBeforeCall(AuthMethodsListReq authMethodsListReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'authMethodsListReq' is set + if (authMethodsListReq == null) { + throw new ApiException("Missing the required parameter 'authMethodsListReq' when calling authMethodsList(Async)"); + } + + return authMethodsListCall(authMethodsListReq, _callback); + + } + + /** + * + * Retrieves possible authentication methods for provided username + * @param authMethodsListReq (required) + * @return AuthMethodsListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
+ */ + public AuthMethodsListRsp authMethodsList(AuthMethodsListReq authMethodsListReq) throws ApiException { + ApiResponse localVarResp = authMethodsListWithHttpInfo(authMethodsListReq); + return localVarResp.getData(); + } + + /** + * + * Retrieves possible authentication methods for provided username + * @param authMethodsListReq (required) + * @return ApiResponse<AuthMethodsListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
+ */ + public ApiResponse authMethodsListWithHttpInfo(AuthMethodsListReq authMethodsListReq) throws ApiException { + okhttp3.Call localVarCall = authMethodsListValidateBeforeCall(authMethodsListReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Retrieves possible authentication methods for provided username + * @param authMethodsListReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
+ */ + public okhttp3.Call authMethodsListAsync(AuthMethodsListReq authMethodsListReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = authMethodsListValidateBeforeCall(authMethodsListReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/AuthTokensApi.java b/src/main/java/com/corbado/generated/api/AuthTokensApi.java new file mode 100644 index 0000000..3ff45a2 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/AuthTokensApi.java @@ -0,0 +1,204 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.AuthTokenValidateReq; +import com.corbado.generated.model.AuthTokenValidateRsp; +import com.corbado.generated.model.ErrorRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AuthTokensApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AuthTokensApi() { + this(Configuration.getDefaultApiClient()); + } + + public AuthTokensApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for authTokenValidate + * @param authTokenValidateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth token successfully validated -
0 Error -
+ */ + public okhttp3.Call authTokenValidateCall(AuthTokenValidateReq authTokenValidateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = authTokenValidateReq; + + // create path and map variables + String localVarPath = "/v1/authTokens/validate"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call authTokenValidateValidateBeforeCall(AuthTokenValidateReq authTokenValidateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'authTokenValidateReq' is set + if (authTokenValidateReq == null) { + throw new ApiException("Missing the required parameter 'authTokenValidateReq' when calling authTokenValidate(Async)"); + } + + return authTokenValidateCall(authTokenValidateReq, _callback); + + } + + /** + * + * Validates auth token and returns attached user data + * @param authTokenValidateReq (required) + * @return AuthTokenValidateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth token successfully validated -
0 Error -
+ */ + public AuthTokenValidateRsp authTokenValidate(AuthTokenValidateReq authTokenValidateReq) throws ApiException { + ApiResponse localVarResp = authTokenValidateWithHttpInfo(authTokenValidateReq); + return localVarResp.getData(); + } + + /** + * + * Validates auth token and returns attached user data + * @param authTokenValidateReq (required) + * @return ApiResponse<AuthTokenValidateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth token successfully validated -
0 Error -
+ */ + public ApiResponse authTokenValidateWithHttpInfo(AuthTokenValidateReq authTokenValidateReq) throws ApiException { + okhttp3.Call localVarCall = authTokenValidateValidateBeforeCall(authTokenValidateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Validates auth token and returns attached user data + * @param authTokenValidateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth token successfully validated -
0 Error -
+ */ + public okhttp3.Call authTokenValidateAsync(AuthTokenValidateReq authTokenValidateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = authTokenValidateValidateBeforeCall(authTokenValidateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/EmailMagicLinksApi.java b/src/main/java/com/corbado/generated/api/EmailMagicLinksApi.java new file mode 100644 index 0000000..c2e0999 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/EmailMagicLinksApi.java @@ -0,0 +1,604 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.EmailLinkGetRsp; +import com.corbado.generated.model.EmailLinkSendReq; +import com.corbado.generated.model.EmailLinkSendRsp; +import com.corbado.generated.model.EmailLinkValidateRsp; +import com.corbado.generated.model.EmailLinksDeleteReq; +import com.corbado.generated.model.EmailLinksValidateReq; +import com.corbado.generated.model.ErrorRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class EmailMagicLinksApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public EmailMagicLinksApi() { + this(Configuration.getDefaultApiClient()); + } + + public EmailMagicLinksApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for emailLinkDelete + * @param emailLinkID ID of email magic link (required) + * @param emailLinksDeleteReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public okhttp3.Call emailLinkDeleteCall(String emailLinkID, EmailLinksDeleteReq emailLinksDeleteReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = emailLinksDeleteReq; + + // create path and map variables + String localVarPath = "/v1/emailLinks/{emailLinkID}" + .replace("{" + "emailLinkID" + "}", localVarApiClient.escapeString(emailLinkID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call emailLinkDeleteValidateBeforeCall(String emailLinkID, EmailLinksDeleteReq emailLinksDeleteReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'emailLinkID' is set + if (emailLinkID == null) { + throw new ApiException("Missing the required parameter 'emailLinkID' when calling emailLinkDelete(Async)"); + } + + return emailLinkDeleteCall(emailLinkID, emailLinksDeleteReq, _callback); + + } + + /** + * + * Deletes an email magic link + * @param emailLinkID ID of email magic link (required) + * @param emailLinksDeleteReq (optional) + * @return EmailLinkValidateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public EmailLinkValidateRsp emailLinkDelete(String emailLinkID, EmailLinksDeleteReq emailLinksDeleteReq) throws ApiException { + ApiResponse localVarResp = emailLinkDeleteWithHttpInfo(emailLinkID, emailLinksDeleteReq); + return localVarResp.getData(); + } + + /** + * + * Deletes an email magic link + * @param emailLinkID ID of email magic link (required) + * @param emailLinksDeleteReq (optional) + * @return ApiResponse<EmailLinkValidateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public ApiResponse emailLinkDeleteWithHttpInfo(String emailLinkID, EmailLinksDeleteReq emailLinksDeleteReq) throws ApiException { + okhttp3.Call localVarCall = emailLinkDeleteValidateBeforeCall(emailLinkID, emailLinksDeleteReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Deletes an email magic link + * @param emailLinkID ID of email magic link (required) + * @param emailLinksDeleteReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public okhttp3.Call emailLinkDeleteAsync(String emailLinkID, EmailLinksDeleteReq emailLinksDeleteReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = emailLinkDeleteValidateBeforeCall(emailLinkID, emailLinksDeleteReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for emailLinkGet + * @param emailLinkID ID of email magic link (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains details of an email link -
0 Error -
+ */ + public okhttp3.Call emailLinkGetCall(String emailLinkID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/emailLinks/{emailLinkID}" + .replace("{" + "emailLinkID" + "}", localVarApiClient.escapeString(emailLinkID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call emailLinkGetValidateBeforeCall(String emailLinkID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'emailLinkID' is set + if (emailLinkID == null) { + throw new ApiException("Missing the required parameter 'emailLinkID' when calling emailLinkGet(Async)"); + } + + return emailLinkGetCall(emailLinkID, _callback); + + } + + /** + * + * Get an email magic link only one time after confirmed + * @param emailLinkID ID of email magic link (required) + * @return EmailLinkGetRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains details of an email link -
0 Error -
+ */ + public EmailLinkGetRsp emailLinkGet(String emailLinkID) throws ApiException { + ApiResponse localVarResp = emailLinkGetWithHttpInfo(emailLinkID); + return localVarResp.getData(); + } + + /** + * + * Get an email magic link only one time after confirmed + * @param emailLinkID ID of email magic link (required) + * @return ApiResponse<EmailLinkGetRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains details of an email link -
0 Error -
+ */ + public ApiResponse emailLinkGetWithHttpInfo(String emailLinkID) throws ApiException { + okhttp3.Call localVarCall = emailLinkGetValidateBeforeCall(emailLinkID, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Get an email magic link only one time after confirmed + * @param emailLinkID ID of email magic link (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains details of an email link -
0 Error -
+ */ + public okhttp3.Call emailLinkGetAsync(String emailLinkID, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = emailLinkGetValidateBeforeCall(emailLinkID, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for emailLinkSend + * @param emailLinkSendReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
+ */ + public okhttp3.Call emailLinkSendCall(EmailLinkSendReq emailLinkSendReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = emailLinkSendReq; + + // create path and map variables + String localVarPath = "/v1/emailLinks"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call emailLinkSendValidateBeforeCall(EmailLinkSendReq emailLinkSendReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'emailLinkSendReq' is set + if (emailLinkSendReq == null) { + throw new ApiException("Missing the required parameter 'emailLinkSendReq' when calling emailLinkSend(Async)"); + } + + return emailLinkSendCall(emailLinkSendReq, _callback); + + } + + /** + * + * Creates email magic link and sends it to given email address + * @param emailLinkSendReq (required) + * @return EmailLinkSendRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
+ */ + public EmailLinkSendRsp emailLinkSend(EmailLinkSendReq emailLinkSendReq) throws ApiException { + ApiResponse localVarResp = emailLinkSendWithHttpInfo(emailLinkSendReq); + return localVarResp.getData(); + } + + /** + * + * Creates email magic link and sends it to given email address + * @param emailLinkSendReq (required) + * @return ApiResponse<EmailLinkSendRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
+ */ + public ApiResponse emailLinkSendWithHttpInfo(EmailLinkSendReq emailLinkSendReq) throws ApiException { + okhttp3.Call localVarCall = emailLinkSendValidateBeforeCall(emailLinkSendReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Creates email magic link and sends it to given email address + * @param emailLinkSendReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
+ */ + public okhttp3.Call emailLinkSendAsync(EmailLinkSendReq emailLinkSendReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = emailLinkSendValidateBeforeCall(emailLinkSendReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for emailLinkValidate + * @param emailLinkID ID of email magic link (required) + * @param emailLinksValidateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public okhttp3.Call emailLinkValidateCall(String emailLinkID, EmailLinksValidateReq emailLinksValidateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = emailLinksValidateReq; + + // create path and map variables + String localVarPath = "/v1/emailLinks/{emailLinkID}/validate" + .replace("{" + "emailLinkID" + "}", localVarApiClient.escapeString(emailLinkID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call emailLinkValidateValidateBeforeCall(String emailLinkID, EmailLinksValidateReq emailLinksValidateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'emailLinkID' is set + if (emailLinkID == null) { + throw new ApiException("Missing the required parameter 'emailLinkID' when calling emailLinkValidate(Async)"); + } + + // verify the required parameter 'emailLinksValidateReq' is set + if (emailLinksValidateReq == null) { + throw new ApiException("Missing the required parameter 'emailLinksValidateReq' when calling emailLinkValidate(Async)"); + } + + return emailLinkValidateCall(emailLinkID, emailLinksValidateReq, _callback); + + } + + /** + * + * Validates email magic link token + * @param emailLinkID ID of email magic link (required) + * @param emailLinksValidateReq (required) + * @return EmailLinkValidateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public EmailLinkValidateRsp emailLinkValidate(String emailLinkID, EmailLinksValidateReq emailLinksValidateReq) throws ApiException { + ApiResponse localVarResp = emailLinkValidateWithHttpInfo(emailLinkID, emailLinksValidateReq); + return localVarResp.getData(); + } + + /** + * + * Validates email magic link token + * @param emailLinkID ID of email magic link (required) + * @param emailLinksValidateReq (required) + * @return ApiResponse<EmailLinkValidateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public ApiResponse emailLinkValidateWithHttpInfo(String emailLinkID, EmailLinksValidateReq emailLinksValidateReq) throws ApiException { + okhttp3.Call localVarCall = emailLinkValidateValidateBeforeCall(emailLinkID, emailLinksValidateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Validates email magic link token + * @param emailLinkID ID of email magic link (required) + * @param emailLinksValidateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public okhttp3.Call emailLinkValidateAsync(String emailLinkID, EmailLinksValidateReq emailLinksValidateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = emailLinkValidateValidateBeforeCall(emailLinkID, emailLinksValidateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/EmailOtpApi.java b/src/main/java/com/corbado/generated/api/EmailOtpApi.java new file mode 100644 index 0000000..f004b0d --- /dev/null +++ b/src/main/java/com/corbado/generated/api/EmailOtpApi.java @@ -0,0 +1,471 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.EmailCodeGetRsp; +import com.corbado.generated.model.EmailCodeSendReq; +import com.corbado.generated.model.EmailCodeSendRsp; +import com.corbado.generated.model.EmailCodeValidateReq; +import com.corbado.generated.model.EmailCodeValidateRsp; +import com.corbado.generated.model.ErrorRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class EmailOtpApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public EmailOtpApi() { + this(Configuration.getDefaultApiClient()); + } + + public EmailOtpApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for emailCodeGet + * @param emailCodeID ID of email OTP (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains details of an email OTP -
0 Error -
+ */ + public okhttp3.Call emailCodeGetCall(String emailCodeID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/emailCodes/{emailCodeID}" + .replace("{" + "emailCodeID" + "}", localVarApiClient.escapeString(emailCodeID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call emailCodeGetValidateBeforeCall(String emailCodeID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'emailCodeID' is set + if (emailCodeID == null) { + throw new ApiException("Missing the required parameter 'emailCodeID' when calling emailCodeGet(Async)"); + } + + return emailCodeGetCall(emailCodeID, _callback); + + } + + /** + * + * Get an email OTP only one time after confirmed + * @param emailCodeID ID of email OTP (required) + * @return EmailCodeGetRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains details of an email OTP -
0 Error -
+ */ + public EmailCodeGetRsp emailCodeGet(String emailCodeID) throws ApiException { + ApiResponse localVarResp = emailCodeGetWithHttpInfo(emailCodeID); + return localVarResp.getData(); + } + + /** + * + * Get an email OTP only one time after confirmed + * @param emailCodeID ID of email OTP (required) + * @return ApiResponse<EmailCodeGetRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains details of an email OTP -
0 Error -
+ */ + public ApiResponse emailCodeGetWithHttpInfo(String emailCodeID) throws ApiException { + okhttp3.Call localVarCall = emailCodeGetValidateBeforeCall(emailCodeID, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Get an email OTP only one time after confirmed + * @param emailCodeID ID of email OTP (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains details of an email OTP -
0 Error -
+ */ + public okhttp3.Call emailCodeGetAsync(String emailCodeID, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = emailCodeGetValidateBeforeCall(emailCodeID, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for emailCodeSend + * @param emailCodeSendReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
+ */ + public okhttp3.Call emailCodeSendCall(EmailCodeSendReq emailCodeSendReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = emailCodeSendReq; + + // create path and map variables + String localVarPath = "/v1/emailCodes"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call emailCodeSendValidateBeforeCall(EmailCodeSendReq emailCodeSendReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'emailCodeSendReq' is set + if (emailCodeSendReq == null) { + throw new ApiException("Missing the required parameter 'emailCodeSendReq' when calling emailCodeSend(Async)"); + } + + return emailCodeSendCall(emailCodeSendReq, _callback); + + } + + /** + * + * Creates email code and sends it to given email address + * @param emailCodeSendReq (required) + * @return EmailCodeSendRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
+ */ + public EmailCodeSendRsp emailCodeSend(EmailCodeSendReq emailCodeSendReq) throws ApiException { + ApiResponse localVarResp = emailCodeSendWithHttpInfo(emailCodeSendReq); + return localVarResp.getData(); + } + + /** + * + * Creates email code and sends it to given email address + * @param emailCodeSendReq (required) + * @return ApiResponse<EmailCodeSendRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
+ */ + public ApiResponse emailCodeSendWithHttpInfo(EmailCodeSendReq emailCodeSendReq) throws ApiException { + okhttp3.Call localVarCall = emailCodeSendValidateBeforeCall(emailCodeSendReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Creates email code and sends it to given email address + * @param emailCodeSendReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
+ */ + public okhttp3.Call emailCodeSendAsync(EmailCodeSendReq emailCodeSendReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = emailCodeSendValidateBeforeCall(emailCodeSendReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for emailCodeValidate + * @param emailCodeID ID of email OTP (required) + * @param emailCodeValidateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public okhttp3.Call emailCodeValidateCall(String emailCodeID, EmailCodeValidateReq emailCodeValidateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = emailCodeValidateReq; + + // create path and map variables + String localVarPath = "/v1/emailCodes/{emailCodeID}/validate" + .replace("{" + "emailCodeID" + "}", localVarApiClient.escapeString(emailCodeID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call emailCodeValidateValidateBeforeCall(String emailCodeID, EmailCodeValidateReq emailCodeValidateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'emailCodeID' is set + if (emailCodeID == null) { + throw new ApiException("Missing the required parameter 'emailCodeID' when calling emailCodeValidate(Async)"); + } + + // verify the required parameter 'emailCodeValidateReq' is set + if (emailCodeValidateReq == null) { + throw new ApiException("Missing the required parameter 'emailCodeValidateReq' when calling emailCodeValidate(Async)"); + } + + return emailCodeValidateCall(emailCodeID, emailCodeValidateReq, _callback); + + } + + /** + * + * Validates email code + * @param emailCodeID ID of email OTP (required) + * @param emailCodeValidateReq (required) + * @return EmailCodeValidateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public EmailCodeValidateRsp emailCodeValidate(String emailCodeID, EmailCodeValidateReq emailCodeValidateReq) throws ApiException { + ApiResponse localVarResp = emailCodeValidateWithHttpInfo(emailCodeID, emailCodeValidateReq); + return localVarResp.getData(); + } + + /** + * + * Validates email code + * @param emailCodeID ID of email OTP (required) + * @param emailCodeValidateReq (required) + * @return ApiResponse<EmailCodeValidateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public ApiResponse emailCodeValidateWithHttpInfo(String emailCodeID, EmailCodeValidateReq emailCodeValidateReq) throws ApiException { + okhttp3.Call localVarCall = emailCodeValidateValidateBeforeCall(emailCodeID, emailCodeValidateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Validates email code + * @param emailCodeID ID of email OTP (required) + * @param emailCodeValidateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public okhttp3.Call emailCodeValidateAsync(String emailCodeID, EmailCodeValidateReq emailCodeValidateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = emailCodeValidateValidateBeforeCall(emailCodeID, emailCodeValidateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/EmailTemplatesApi.java b/src/main/java/com/corbado/generated/api/EmailTemplatesApi.java new file mode 100644 index 0000000..359bbf9 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/EmailTemplatesApi.java @@ -0,0 +1,343 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.EmailTemplateCreateReq; +import com.corbado.generated.model.EmailTemplateCreateRsp; +import com.corbado.generated.model.EmailTemplateDeleteReq; +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.GenericRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class EmailTemplatesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public EmailTemplatesApi() { + this(Configuration.getDefaultApiClient()); + } + + public EmailTemplatesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for emailTemplateCreate + * @param emailTemplateCreateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email template successfully created -
0 Error -
+ */ + public okhttp3.Call emailTemplateCreateCall(EmailTemplateCreateReq emailTemplateCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = emailTemplateCreateReq; + + // create path and map variables + String localVarPath = "/v1/emailTemplates"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call emailTemplateCreateValidateBeforeCall(EmailTemplateCreateReq emailTemplateCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'emailTemplateCreateReq' is set + if (emailTemplateCreateReq == null) { + throw new ApiException("Missing the required parameter 'emailTemplateCreateReq' when calling emailTemplateCreate(Async)"); + } + + return emailTemplateCreateCall(emailTemplateCreateReq, _callback); + + } + + /** + * + * Creates a new email template + * @param emailTemplateCreateReq (required) + * @return EmailTemplateCreateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email template successfully created -
0 Error -
+ */ + public EmailTemplateCreateRsp emailTemplateCreate(EmailTemplateCreateReq emailTemplateCreateReq) throws ApiException { + ApiResponse localVarResp = emailTemplateCreateWithHttpInfo(emailTemplateCreateReq); + return localVarResp.getData(); + } + + /** + * + * Creates a new email template + * @param emailTemplateCreateReq (required) + * @return ApiResponse<EmailTemplateCreateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email template successfully created -
0 Error -
+ */ + public ApiResponse emailTemplateCreateWithHttpInfo(EmailTemplateCreateReq emailTemplateCreateReq) throws ApiException { + okhttp3.Call localVarCall = emailTemplateCreateValidateBeforeCall(emailTemplateCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Creates a new email template + * @param emailTemplateCreateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email template successfully created -
0 Error -
+ */ + public okhttp3.Call emailTemplateCreateAsync(EmailTemplateCreateReq emailTemplateCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = emailTemplateCreateValidateBeforeCall(emailTemplateCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for emailTemplateDelete + * @param emailTemplateID ID of email template (required) + * @param emailTemplateDeleteReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call emailTemplateDeleteCall(String emailTemplateID, EmailTemplateDeleteReq emailTemplateDeleteReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = emailTemplateDeleteReq; + + // create path and map variables + String localVarPath = "/v1/emailTemplates/{emailTemplateID}" + .replace("{" + "emailTemplateID" + "}", localVarApiClient.escapeString(emailTemplateID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call emailTemplateDeleteValidateBeforeCall(String emailTemplateID, EmailTemplateDeleteReq emailTemplateDeleteReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'emailTemplateID' is set + if (emailTemplateID == null) { + throw new ApiException("Missing the required parameter 'emailTemplateID' when calling emailTemplateDelete(Async)"); + } + + // verify the required parameter 'emailTemplateDeleteReq' is set + if (emailTemplateDeleteReq == null) { + throw new ApiException("Missing the required parameter 'emailTemplateDeleteReq' when calling emailTemplateDelete(Async)"); + } + + return emailTemplateDeleteCall(emailTemplateID, emailTemplateDeleteReq, _callback); + + } + + /** + * + * Deletes an email template + * @param emailTemplateID ID of email template (required) + * @param emailTemplateDeleteReq (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp emailTemplateDelete(String emailTemplateID, EmailTemplateDeleteReq emailTemplateDeleteReq) throws ApiException { + ApiResponse localVarResp = emailTemplateDeleteWithHttpInfo(emailTemplateID, emailTemplateDeleteReq); + return localVarResp.getData(); + } + + /** + * + * Deletes an email template + * @param emailTemplateID ID of email template (required) + * @param emailTemplateDeleteReq (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse emailTemplateDeleteWithHttpInfo(String emailTemplateID, EmailTemplateDeleteReq emailTemplateDeleteReq) throws ApiException { + okhttp3.Call localVarCall = emailTemplateDeleteValidateBeforeCall(emailTemplateID, emailTemplateDeleteReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Deletes an email template + * @param emailTemplateID ID of email template (required) + * @param emailTemplateDeleteReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call emailTemplateDeleteAsync(String emailTemplateID, EmailTemplateDeleteReq emailTemplateDeleteReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = emailTemplateDeleteValidateBeforeCall(emailTemplateID, emailTemplateDeleteReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/ExamplesApi.java b/src/main/java/com/corbado/generated/api/ExamplesApi.java new file mode 100644 index 0000000..3ccc8ef --- /dev/null +++ b/src/main/java/com/corbado/generated/api/ExamplesApi.java @@ -0,0 +1,203 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.ExampleGetRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ExamplesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ExamplesApi() { + this(Configuration.getDefaultApiClient()); + } + + public ExamplesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for exampleGet + * @param fileName Name of the example to get (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Example project successfully retrieved -
0 Error -
+ */ + public okhttp3.Call exampleGetCall(String fileName, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/examples/{fileName}" + .replace("{" + "fileName" + "}", localVarApiClient.escapeString(fileName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call exampleGetValidateBeforeCall(String fileName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'fileName' is set + if (fileName == null) { + throw new ApiException("Missing the required parameter 'fileName' when calling exampleGet(Async)"); + } + + return exampleGetCall(fileName, _callback); + + } + + /** + * + * Retrieves file containing the named example project + * @param fileName Name of the example to get (required) + * @return ExampleGetRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Example project successfully retrieved -
0 Error -
+ */ + public ExampleGetRsp exampleGet(String fileName) throws ApiException { + ApiResponse localVarResp = exampleGetWithHttpInfo(fileName); + return localVarResp.getData(); + } + + /** + * + * Retrieves file containing the named example project + * @param fileName Name of the example to get (required) + * @return ApiResponse<ExampleGetRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Example project successfully retrieved -
0 Error -
+ */ + public ApiResponse exampleGetWithHttpInfo(String fileName) throws ApiException { + okhttp3.Call localVarCall = exampleGetValidateBeforeCall(fileName, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Retrieves file containing the named example project + * @param fileName Name of the example to get (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Example project successfully retrieved -
0 Error -
+ */ + public okhttp3.Call exampleGetAsync(String fileName, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = exampleGetValidateBeforeCall(fileName, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/IOsAppConfigApi.java b/src/main/java/com/corbado/generated/api/IOsAppConfigApi.java new file mode 100644 index 0000000..bc2681d --- /dev/null +++ b/src/main/java/com/corbado/generated/api/IOsAppConfigApi.java @@ -0,0 +1,590 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.GenericRsp; +import com.corbado.generated.model.IOSAppConfigDeleteReq; +import com.corbado.generated.model.IOSAppConfigListRsp; +import com.corbado.generated.model.IOSAppConfigSaveReq; +import com.corbado.generated.model.IOSAppConfigSaveRsp; +import com.corbado.generated.model.IOSAppConfigUpdateReq; +import com.corbado.generated.model.IOSAppConfigUpdateRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class IOsAppConfigApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public IOsAppConfigApi() { + this(Configuration.getDefaultApiClient()); + } + + public IOsAppConfigApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for iOSAppConfigCreate + * @param ioSAppConfigSaveReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 iOS App successfully created -
0 Error -
+ */ + public okhttp3.Call iOSAppConfigCreateCall(IOSAppConfigSaveReq ioSAppConfigSaveReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = ioSAppConfigSaveReq; + + // create path and map variables + String localVarPath = "/v1/iosappconfig"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call iOSAppConfigCreateValidateBeforeCall(IOSAppConfigSaveReq ioSAppConfigSaveReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'ioSAppConfigSaveReq' is set + if (ioSAppConfigSaveReq == null) { + throw new ApiException("Missing the required parameter 'ioSAppConfigSaveReq' when calling iOSAppConfigCreate(Async)"); + } + + return iOSAppConfigCreateCall(ioSAppConfigSaveReq, _callback); + + } + + /** + * + * Creates a new iOS App Config + * @param ioSAppConfigSaveReq (required) + * @return IOSAppConfigSaveRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 iOS App successfully created -
0 Error -
+ */ + public IOSAppConfigSaveRsp iOSAppConfigCreate(IOSAppConfigSaveReq ioSAppConfigSaveReq) throws ApiException { + ApiResponse localVarResp = iOSAppConfigCreateWithHttpInfo(ioSAppConfigSaveReq); + return localVarResp.getData(); + } + + /** + * + * Creates a new iOS App Config + * @param ioSAppConfigSaveReq (required) + * @return ApiResponse<IOSAppConfigSaveRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 iOS App successfully created -
0 Error -
+ */ + public ApiResponse iOSAppConfigCreateWithHttpInfo(IOSAppConfigSaveReq ioSAppConfigSaveReq) throws ApiException { + okhttp3.Call localVarCall = iOSAppConfigCreateValidateBeforeCall(ioSAppConfigSaveReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Creates a new iOS App Config + * @param ioSAppConfigSaveReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 iOS App successfully created -
0 Error -
+ */ + public okhttp3.Call iOSAppConfigCreateAsync(IOSAppConfigSaveReq ioSAppConfigSaveReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = iOSAppConfigCreateValidateBeforeCall(ioSAppConfigSaveReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for iOSAppConfigDelete + * @param iosAppConfigID iOS App Config ID from create (required) + * @param ioSAppConfigDeleteReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call iOSAppConfigDeleteCall(String iosAppConfigID, IOSAppConfigDeleteReq ioSAppConfigDeleteReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = ioSAppConfigDeleteReq; + + // create path and map variables + String localVarPath = "/v1/iosappconfig/{iosAppConfigID}" + .replace("{" + "iosAppConfigID" + "}", localVarApiClient.escapeString(iosAppConfigID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call iOSAppConfigDeleteValidateBeforeCall(String iosAppConfigID, IOSAppConfigDeleteReq ioSAppConfigDeleteReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'iosAppConfigID' is set + if (iosAppConfigID == null) { + throw new ApiException("Missing the required parameter 'iosAppConfigID' when calling iOSAppConfigDelete(Async)"); + } + + return iOSAppConfigDeleteCall(iosAppConfigID, ioSAppConfigDeleteReq, _callback); + + } + + /** + * + * Deletes an iOS App Config + * @param iosAppConfigID iOS App Config ID from create (required) + * @param ioSAppConfigDeleteReq (optional) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp iOSAppConfigDelete(String iosAppConfigID, IOSAppConfigDeleteReq ioSAppConfigDeleteReq) throws ApiException { + ApiResponse localVarResp = iOSAppConfigDeleteWithHttpInfo(iosAppConfigID, ioSAppConfigDeleteReq); + return localVarResp.getData(); + } + + /** + * + * Deletes an iOS App Config + * @param iosAppConfigID iOS App Config ID from create (required) + * @param ioSAppConfigDeleteReq (optional) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse iOSAppConfigDeleteWithHttpInfo(String iosAppConfigID, IOSAppConfigDeleteReq ioSAppConfigDeleteReq) throws ApiException { + okhttp3.Call localVarCall = iOSAppConfigDeleteValidateBeforeCall(iosAppConfigID, ioSAppConfigDeleteReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Deletes an iOS App Config + * @param iosAppConfigID iOS App Config ID from create (required) + * @param ioSAppConfigDeleteReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call iOSAppConfigDeleteAsync(String iosAppConfigID, IOSAppConfigDeleteReq ioSAppConfigDeleteReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = iOSAppConfigDeleteValidateBeforeCall(iosAppConfigID, ioSAppConfigDeleteReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for iOSAppConfigGet + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 iOS App Config List successfully retrieved -
0 Error -
+ */ + public okhttp3.Call iOSAppConfigGetCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/iosappconfig"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call iOSAppConfigGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return iOSAppConfigGetCall(_callback); + + } + + /** + * + * Lists iOS App Configs for a project + * @return IOSAppConfigListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 iOS App Config List successfully retrieved -
0 Error -
+ */ + public IOSAppConfigListRsp iOSAppConfigGet() throws ApiException { + ApiResponse localVarResp = iOSAppConfigGetWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * Lists iOS App Configs for a project + * @return ApiResponse<IOSAppConfigListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 iOS App Config List successfully retrieved -
0 Error -
+ */ + public ApiResponse iOSAppConfigGetWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = iOSAppConfigGetValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Lists iOS App Configs for a project + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 iOS App Config List successfully retrieved -
0 Error -
+ */ + public okhttp3.Call iOSAppConfigGetAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = iOSAppConfigGetValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for iOSAppConfigPut + * @param iosAppConfigID ID from iOS config create (required) + * @param ioSAppConfigUpdateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains iOS app config -
0 Error -
+ */ + public okhttp3.Call iOSAppConfigPutCall(String iosAppConfigID, IOSAppConfigUpdateReq ioSAppConfigUpdateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = ioSAppConfigUpdateReq; + + // create path and map variables + String localVarPath = "/v1/iosappconfig/{iosAppConfigID}" + .replace("{" + "iosAppConfigID" + "}", localVarApiClient.escapeString(iosAppConfigID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call iOSAppConfigPutValidateBeforeCall(String iosAppConfigID, IOSAppConfigUpdateReq ioSAppConfigUpdateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'iosAppConfigID' is set + if (iosAppConfigID == null) { + throw new ApiException("Missing the required parameter 'iosAppConfigID' when calling iOSAppConfigPut(Async)"); + } + + return iOSAppConfigPutCall(iosAppConfigID, ioSAppConfigUpdateReq, _callback); + + } + + /** + * + * Updates an iOS app config by id + * @param iosAppConfigID ID from iOS config create (required) + * @param ioSAppConfigUpdateReq (optional) + * @return IOSAppConfigUpdateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains iOS app config -
0 Error -
+ */ + public IOSAppConfigUpdateRsp iOSAppConfigPut(String iosAppConfigID, IOSAppConfigUpdateReq ioSAppConfigUpdateReq) throws ApiException { + ApiResponse localVarResp = iOSAppConfigPutWithHttpInfo(iosAppConfigID, ioSAppConfigUpdateReq); + return localVarResp.getData(); + } + + /** + * + * Updates an iOS app config by id + * @param iosAppConfigID ID from iOS config create (required) + * @param ioSAppConfigUpdateReq (optional) + * @return ApiResponse<IOSAppConfigUpdateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains iOS app config -
0 Error -
+ */ + public ApiResponse iOSAppConfigPutWithHttpInfo(String iosAppConfigID, IOSAppConfigUpdateReq ioSAppConfigUpdateReq) throws ApiException { + okhttp3.Call localVarCall = iOSAppConfigPutValidateBeforeCall(iosAppConfigID, ioSAppConfigUpdateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Updates an iOS app config by id + * @param iosAppConfigID ID from iOS config create (required) + * @param ioSAppConfigUpdateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains iOS app config -
0 Error -
+ */ + public okhttp3.Call iOSAppConfigPutAsync(String iosAppConfigID, IOSAppConfigUpdateReq ioSAppConfigUpdateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = iOSAppConfigPutValidateBeforeCall(iosAppConfigID, ioSAppConfigUpdateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/LongSessionsApi.java b/src/main/java/com/corbado/generated/api/LongSessionsApi.java new file mode 100644 index 0000000..b0062de --- /dev/null +++ b/src/main/java/com/corbado/generated/api/LongSessionsApi.java @@ -0,0 +1,499 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.GenericRsp; +import com.corbado.generated.model.LongSessionGetRsp; +import com.corbado.generated.model.LongSessionListRsp; +import com.corbado.generated.model.LongSessionRevokeReq; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class LongSessionsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public LongSessionsApi() { + this(Configuration.getDefaultApiClient()); + } + + public LongSessionsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for longSessionGet + * @param sessionID ID of session (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains details of a long session -
0 Error -
+ */ + public okhttp3.Call longSessionGetCall(String sessionID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/longSessions/{sessionID}" + .replace("{" + "sessionID" + "}", localVarApiClient.escapeString(sessionID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call longSessionGetValidateBeforeCall(String sessionID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'sessionID' is set + if (sessionID == null) { + throw new ApiException("Missing the required parameter 'sessionID' when calling longSessionGet(Async)"); + } + + return longSessionGetCall(sessionID, _callback); + + } + + /** + * + * Get a long session by sessionID + * @param sessionID ID of session (required) + * @return LongSessionGetRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains details of a long session -
0 Error -
+ */ + public LongSessionGetRsp longSessionGet(String sessionID) throws ApiException { + ApiResponse localVarResp = longSessionGetWithHttpInfo(sessionID); + return localVarResp.getData(); + } + + /** + * + * Get a long session by sessionID + * @param sessionID ID of session (required) + * @return ApiResponse<LongSessionGetRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains details of a long session -
0 Error -
+ */ + public ApiResponse longSessionGetWithHttpInfo(String sessionID) throws ApiException { + okhttp3.Call localVarCall = longSessionGetValidateBeforeCall(sessionID, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Get a long session by sessionID + * @param sessionID ID of session (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains details of a long session -
0 Error -
+ */ + public okhttp3.Call longSessionGetAsync(String sessionID, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = longSessionGetValidateBeforeCall(sessionID, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for longSessionList + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of long sessions -
+ */ + public okhttp3.Call longSessionListCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/longSessions"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call longSessionListValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + return longSessionListCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Lists long sessions by provided filters + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return LongSessionListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of long sessions -
+ */ + public LongSessionListRsp longSessionList(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = longSessionListWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Lists long sessions by provided filters + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<LongSessionListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of long sessions -
+ */ + public ApiResponse longSessionListWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = longSessionListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Lists long sessions by provided filters + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of long sessions -
+ */ + public okhttp3.Call longSessionListAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = longSessionListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for longSessionRevoke + * @param sessionID ID of session (required) + * @param longSessionRevokeReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call longSessionRevokeCall(String sessionID, LongSessionRevokeReq longSessionRevokeReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = longSessionRevokeReq; + + // create path and map variables + String localVarPath = "/v1/longSessions/{sessionID}/revoke" + .replace("{" + "sessionID" + "}", localVarApiClient.escapeString(sessionID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call longSessionRevokeValidateBeforeCall(String sessionID, LongSessionRevokeReq longSessionRevokeReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'sessionID' is set + if (sessionID == null) { + throw new ApiException("Missing the required parameter 'sessionID' when calling longSessionRevoke(Async)"); + } + + return longSessionRevokeCall(sessionID, longSessionRevokeReq, _callback); + + } + + /** + * + * Revokes an active long session by sessionID + * @param sessionID ID of session (required) + * @param longSessionRevokeReq (optional) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp longSessionRevoke(String sessionID, LongSessionRevokeReq longSessionRevokeReq) throws ApiException { + ApiResponse localVarResp = longSessionRevokeWithHttpInfo(sessionID, longSessionRevokeReq); + return localVarResp.getData(); + } + + /** + * + * Revokes an active long session by sessionID + * @param sessionID ID of session (required) + * @param longSessionRevokeReq (optional) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse longSessionRevokeWithHttpInfo(String sessionID, LongSessionRevokeReq longSessionRevokeReq) throws ApiException { + okhttp3.Call localVarCall = longSessionRevokeValidateBeforeCall(sessionID, longSessionRevokeReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Revokes an active long session by sessionID + * @param sessionID ID of session (required) + * @param longSessionRevokeReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call longSessionRevokeAsync(String sessionID, LongSessionRevokeReq longSessionRevokeReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = longSessionRevokeValidateBeforeCall(sessionID, longSessionRevokeReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/PasskeysBiometricsApi.java b/src/main/java/com/corbado/generated/api/PasskeysBiometricsApi.java new file mode 100644 index 0000000..9f3fbf2 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/PasskeysBiometricsApi.java @@ -0,0 +1,2607 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.EmptyReq; +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.GenericRsp; +import com.corbado.generated.model.WebAuthnAssociateStartReq; +import com.corbado.generated.model.WebAuthnAssociateStartRsp; +import com.corbado.generated.model.WebAuthnAuthenticateFinishRsp; +import com.corbado.generated.model.WebAuthnAuthenticateStartReq; +import com.corbado.generated.model.WebAuthnAuthenticateStartRsp; +import com.corbado.generated.model.WebAuthnAuthenticatorUpdateReq; +import com.corbado.generated.model.WebAuthnCredentialExistsReq; +import com.corbado.generated.model.WebAuthnCredentialExistsRsp; +import com.corbado.generated.model.WebAuthnCredentialListRsp; +import com.corbado.generated.model.WebAuthnCredentialReq; +import com.corbado.generated.model.WebAuthnCredentialRsp; +import com.corbado.generated.model.WebAuthnFinishReq; +import com.corbado.generated.model.WebAuthnMediationStartReq; +import com.corbado.generated.model.WebAuthnMediationStartRsp; +import com.corbado.generated.model.WebAuthnRegisterFinishRsp; +import com.corbado.generated.model.WebAuthnRegisterStartReq; +import com.corbado.generated.model.WebAuthnRegisterStartRsp; +import com.corbado.generated.model.WebauthnSettingCreateReq; +import com.corbado.generated.model.WebauthnSettingCreateRsp; +import com.corbado.generated.model.WebauthnSettingDeleteReq; +import com.corbado.generated.model.WebauthnSettingGetRsp; +import com.corbado.generated.model.WebauthnSettingListRsp; +import com.corbado.generated.model.WebauthnSettingUpdateReq; +import com.corbado.generated.model.WebauthnSettingUpdateRsp; +import com.corbado.generated.model.WebauthnStatsAuthenticatorRsp; +import com.corbado.generated.model.WebauthnStatsTypeRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PasskeysBiometricsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PasskeysBiometricsApi() { + this(Configuration.getDefaultApiClient()); + } + + public PasskeysBiometricsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for webAuthnAssociateStart + * @param webAuthnAssociateStartReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) association started successfully -
0 Error -
+ */ + public okhttp3.Call webAuthnAssociateStartCall(WebAuthnAssociateStartReq webAuthnAssociateStartReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = webAuthnAssociateStartReq; + + // create path and map variables + String localVarPath = "/v1/webauthn/associate/start"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnAssociateStartValidateBeforeCall(WebAuthnAssociateStartReq webAuthnAssociateStartReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'webAuthnAssociateStartReq' is set + if (webAuthnAssociateStartReq == null) { + throw new ApiException("Missing the required parameter 'webAuthnAssociateStartReq' when calling webAuthnAssociateStart(Async)"); + } + + return webAuthnAssociateStartCall(webAuthnAssociateStartReq, _callback); + + } + + /** + * + * Starts association token flow for Passkeys (Biometrics) + * @param webAuthnAssociateStartReq (required) + * @return WebAuthnAssociateStartRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) association started successfully -
0 Error -
+ */ + public WebAuthnAssociateStartRsp webAuthnAssociateStart(WebAuthnAssociateStartReq webAuthnAssociateStartReq) throws ApiException { + ApiResponse localVarResp = webAuthnAssociateStartWithHttpInfo(webAuthnAssociateStartReq); + return localVarResp.getData(); + } + + /** + * + * Starts association token flow for Passkeys (Biometrics) + * @param webAuthnAssociateStartReq (required) + * @return ApiResponse<WebAuthnAssociateStartRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) association started successfully -
0 Error -
+ */ + public ApiResponse webAuthnAssociateStartWithHttpInfo(WebAuthnAssociateStartReq webAuthnAssociateStartReq) throws ApiException { + okhttp3.Call localVarCall = webAuthnAssociateStartValidateBeforeCall(webAuthnAssociateStartReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Starts association token flow for Passkeys (Biometrics) + * @param webAuthnAssociateStartReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) association started successfully -
0 Error -
+ */ + public okhttp3.Call webAuthnAssociateStartAsync(WebAuthnAssociateStartReq webAuthnAssociateStartReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnAssociateStartValidateBeforeCall(webAuthnAssociateStartReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnAuthenticateFinish + * @param webAuthnFinishReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
+ */ + public okhttp3.Call webAuthnAuthenticateFinishCall(WebAuthnFinishReq webAuthnFinishReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = webAuthnFinishReq; + + // create path and map variables + String localVarPath = "/v1/webauthn/authenticate/finish"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnAuthenticateFinishValidateBeforeCall(WebAuthnFinishReq webAuthnFinishReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'webAuthnFinishReq' is set + if (webAuthnFinishReq == null) { + throw new ApiException("Missing the required parameter 'webAuthnFinishReq' when calling webAuthnAuthenticateFinish(Async)"); + } + + return webAuthnAuthenticateFinishCall(webAuthnFinishReq, _callback); + + } + + /** + * + * Completes authentication of a user for Passkeys (Biometrics) + * @param webAuthnFinishReq (required) + * @return WebAuthnAuthenticateFinishRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
+ */ + public WebAuthnAuthenticateFinishRsp webAuthnAuthenticateFinish(WebAuthnFinishReq webAuthnFinishReq) throws ApiException { + ApiResponse localVarResp = webAuthnAuthenticateFinishWithHttpInfo(webAuthnFinishReq); + return localVarResp.getData(); + } + + /** + * + * Completes authentication of a user for Passkeys (Biometrics) + * @param webAuthnFinishReq (required) + * @return ApiResponse<WebAuthnAuthenticateFinishRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
+ */ + public ApiResponse webAuthnAuthenticateFinishWithHttpInfo(WebAuthnFinishReq webAuthnFinishReq) throws ApiException { + okhttp3.Call localVarCall = webAuthnAuthenticateFinishValidateBeforeCall(webAuthnFinishReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Completes authentication of a user for Passkeys (Biometrics) + * @param webAuthnFinishReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
+ */ + public okhttp3.Call webAuthnAuthenticateFinishAsync(WebAuthnFinishReq webAuthnFinishReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnAuthenticateFinishValidateBeforeCall(webAuthnFinishReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnAuthenticateStart + * @param webAuthnAuthenticateStartReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
+ */ + public okhttp3.Call webAuthnAuthenticateStartCall(WebAuthnAuthenticateStartReq webAuthnAuthenticateStartReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = webAuthnAuthenticateStartReq; + + // create path and map variables + String localVarPath = "/v1/webauthn/authenticate/start"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnAuthenticateStartValidateBeforeCall(WebAuthnAuthenticateStartReq webAuthnAuthenticateStartReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'webAuthnAuthenticateStartReq' is set + if (webAuthnAuthenticateStartReq == null) { + throw new ApiException("Missing the required parameter 'webAuthnAuthenticateStartReq' when calling webAuthnAuthenticateStart(Async)"); + } + + return webAuthnAuthenticateStartCall(webAuthnAuthenticateStartReq, _callback); + + } + + /** + * + * Starts authentication of a user for Passkeys (Biometrics) + * @param webAuthnAuthenticateStartReq (required) + * @return WebAuthnAuthenticateStartRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
+ */ + public WebAuthnAuthenticateStartRsp webAuthnAuthenticateStart(WebAuthnAuthenticateStartReq webAuthnAuthenticateStartReq) throws ApiException { + ApiResponse localVarResp = webAuthnAuthenticateStartWithHttpInfo(webAuthnAuthenticateStartReq); + return localVarResp.getData(); + } + + /** + * + * Starts authentication of a user for Passkeys (Biometrics) + * @param webAuthnAuthenticateStartReq (required) + * @return ApiResponse<WebAuthnAuthenticateStartRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
+ */ + public ApiResponse webAuthnAuthenticateStartWithHttpInfo(WebAuthnAuthenticateStartReq webAuthnAuthenticateStartReq) throws ApiException { + okhttp3.Call localVarCall = webAuthnAuthenticateStartValidateBeforeCall(webAuthnAuthenticateStartReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Starts authentication of a user for Passkeys (Biometrics) + * @param webAuthnAuthenticateStartReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
+ */ + public okhttp3.Call webAuthnAuthenticateStartAsync(WebAuthnAuthenticateStartReq webAuthnAuthenticateStartReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnAuthenticateStartValidateBeforeCall(webAuthnAuthenticateStartReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnAuthenticatorUpdate + * @param authenticatorID ID of authenticator (required) + * @param webAuthnAuthenticatorUpdateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call webAuthnAuthenticatorUpdateCall(String authenticatorID, WebAuthnAuthenticatorUpdateReq webAuthnAuthenticatorUpdateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = webAuthnAuthenticatorUpdateReq; + + // create path and map variables + String localVarPath = "/v1/webauthn/authenticator/{authenticatorID}" + .replace("{" + "authenticatorID" + "}", localVarApiClient.escapeString(authenticatorID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnAuthenticatorUpdateValidateBeforeCall(String authenticatorID, WebAuthnAuthenticatorUpdateReq webAuthnAuthenticatorUpdateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'authenticatorID' is set + if (authenticatorID == null) { + throw new ApiException("Missing the required parameter 'authenticatorID' when calling webAuthnAuthenticatorUpdate(Async)"); + } + + // verify the required parameter 'webAuthnAuthenticatorUpdateReq' is set + if (webAuthnAuthenticatorUpdateReq == null) { + throw new ApiException("Missing the required parameter 'webAuthnAuthenticatorUpdateReq' when calling webAuthnAuthenticatorUpdate(Async)"); + } + + return webAuthnAuthenticatorUpdateCall(authenticatorID, webAuthnAuthenticatorUpdateReq, _callback); + + } + + /** + * + * Update authenticator + * @param authenticatorID ID of authenticator (required) + * @param webAuthnAuthenticatorUpdateReq (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp webAuthnAuthenticatorUpdate(String authenticatorID, WebAuthnAuthenticatorUpdateReq webAuthnAuthenticatorUpdateReq) throws ApiException { + ApiResponse localVarResp = webAuthnAuthenticatorUpdateWithHttpInfo(authenticatorID, webAuthnAuthenticatorUpdateReq); + return localVarResp.getData(); + } + + /** + * + * Update authenticator + * @param authenticatorID ID of authenticator (required) + * @param webAuthnAuthenticatorUpdateReq (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse webAuthnAuthenticatorUpdateWithHttpInfo(String authenticatorID, WebAuthnAuthenticatorUpdateReq webAuthnAuthenticatorUpdateReq) throws ApiException { + okhttp3.Call localVarCall = webAuthnAuthenticatorUpdateValidateBeforeCall(authenticatorID, webAuthnAuthenticatorUpdateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Update authenticator + * @param authenticatorID ID of authenticator (required) + * @param webAuthnAuthenticatorUpdateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call webAuthnAuthenticatorUpdateAsync(String authenticatorID, WebAuthnAuthenticatorUpdateReq webAuthnAuthenticatorUpdateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnAuthenticatorUpdateValidateBeforeCall(authenticatorID, webAuthnAuthenticatorUpdateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnCredentialDelete + * @param userID ID of user (required) + * @param credentialID ID of credential (required) + * @param emptyReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call webAuthnCredentialDeleteCall(String userID, String credentialID, EmptyReq emptyReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = emptyReq; + + // create path and map variables + String localVarPath = "/v1/users/{userID}/credentials/{credentialID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "credentialID" + "}", localVarApiClient.escapeString(credentialID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnCredentialDeleteValidateBeforeCall(String userID, String credentialID, EmptyReq emptyReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling webAuthnCredentialDelete(Async)"); + } + + // verify the required parameter 'credentialID' is set + if (credentialID == null) { + throw new ApiException("Missing the required parameter 'credentialID' when calling webAuthnCredentialDelete(Async)"); + } + + // verify the required parameter 'emptyReq' is set + if (emptyReq == null) { + throw new ApiException("Missing the required parameter 'emptyReq' when calling webAuthnCredentialDelete(Async)"); + } + + return webAuthnCredentialDeleteCall(userID, credentialID, emptyReq, _callback); + + } + + /** + * + * Delete credential + * @param userID ID of user (required) + * @param credentialID ID of credential (required) + * @param emptyReq (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp webAuthnCredentialDelete(String userID, String credentialID, EmptyReq emptyReq) throws ApiException { + ApiResponse localVarResp = webAuthnCredentialDeleteWithHttpInfo(userID, credentialID, emptyReq); + return localVarResp.getData(); + } + + /** + * + * Delete credential + * @param userID ID of user (required) + * @param credentialID ID of credential (required) + * @param emptyReq (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse webAuthnCredentialDeleteWithHttpInfo(String userID, String credentialID, EmptyReq emptyReq) throws ApiException { + okhttp3.Call localVarCall = webAuthnCredentialDeleteValidateBeforeCall(userID, credentialID, emptyReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Delete credential + * @param userID ID of user (required) + * @param credentialID ID of credential (required) + * @param emptyReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call webAuthnCredentialDeleteAsync(String userID, String credentialID, EmptyReq emptyReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnCredentialDeleteValidateBeforeCall(userID, credentialID, emptyReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnCredentialExists + * @param webAuthnCredentialExistsReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) credentials check completed -
0 Error -
+ */ + public okhttp3.Call webAuthnCredentialExistsCall(WebAuthnCredentialExistsReq webAuthnCredentialExistsReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = webAuthnCredentialExistsReq; + + // create path and map variables + String localVarPath = "/v1/webauthn/credential/exists"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnCredentialExistsValidateBeforeCall(WebAuthnCredentialExistsReq webAuthnCredentialExistsReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'webAuthnCredentialExistsReq' is set + if (webAuthnCredentialExistsReq == null) { + throw new ApiException("Missing the required parameter 'webAuthnCredentialExistsReq' when calling webAuthnCredentialExists(Async)"); + } + + return webAuthnCredentialExistsCall(webAuthnCredentialExistsReq, _callback); + + } + + /** + * + * Checks if active webauthn credential exists for provided user and device + * @param webAuthnCredentialExistsReq (required) + * @return WebAuthnCredentialExistsRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) credentials check completed -
0 Error -
+ */ + public WebAuthnCredentialExistsRsp webAuthnCredentialExists(WebAuthnCredentialExistsReq webAuthnCredentialExistsReq) throws ApiException { + ApiResponse localVarResp = webAuthnCredentialExistsWithHttpInfo(webAuthnCredentialExistsReq); + return localVarResp.getData(); + } + + /** + * + * Checks if active webauthn credential exists for provided user and device + * @param webAuthnCredentialExistsReq (required) + * @return ApiResponse<WebAuthnCredentialExistsRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) credentials check completed -
0 Error -
+ */ + public ApiResponse webAuthnCredentialExistsWithHttpInfo(WebAuthnCredentialExistsReq webAuthnCredentialExistsReq) throws ApiException { + okhttp3.Call localVarCall = webAuthnCredentialExistsValidateBeforeCall(webAuthnCredentialExistsReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Checks if active webauthn credential exists for provided user and device + * @param webAuthnCredentialExistsReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) credentials check completed -
0 Error -
+ */ + public okhttp3.Call webAuthnCredentialExistsAsync(WebAuthnCredentialExistsReq webAuthnCredentialExistsReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnCredentialExistsValidateBeforeCall(webAuthnCredentialExistsReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnCredentialList + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Webauthn credential list successfully retrieved -
0 Error -
+ */ + public okhttp3.Call webAuthnCredentialListCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/webauthn/credential"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnCredentialListValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + return webAuthnCredentialListCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Lists webauthn credentials users + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return WebAuthnCredentialListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Webauthn credential list successfully retrieved -
0 Error -
+ */ + public WebAuthnCredentialListRsp webAuthnCredentialList(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = webAuthnCredentialListWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Lists webauthn credentials users + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<WebAuthnCredentialListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Webauthn credential list successfully retrieved -
0 Error -
+ */ + public ApiResponse webAuthnCredentialListWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = webAuthnCredentialListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Lists webauthn credentials users + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Webauthn credential list successfully retrieved -
0 Error -
+ */ + public okhttp3.Call webAuthnCredentialListAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnCredentialListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnCredentialUpdate + * @param credentialID ID of credential (required) + * @param webAuthnCredentialReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
+ */ + public okhttp3.Call webAuthnCredentialUpdateCall(String credentialID, WebAuthnCredentialReq webAuthnCredentialReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = webAuthnCredentialReq; + + // create path and map variables + String localVarPath = "/v1/webauthn/credential/{credentialID}" + .replace("{" + "credentialID" + "}", localVarApiClient.escapeString(credentialID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnCredentialUpdateValidateBeforeCall(String credentialID, WebAuthnCredentialReq webAuthnCredentialReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'credentialID' is set + if (credentialID == null) { + throw new ApiException("Missing the required parameter 'credentialID' when calling webAuthnCredentialUpdate(Async)"); + } + + // verify the required parameter 'webAuthnCredentialReq' is set + if (webAuthnCredentialReq == null) { + throw new ApiException("Missing the required parameter 'webAuthnCredentialReq' when calling webAuthnCredentialUpdate(Async)"); + } + + return webAuthnCredentialUpdateCall(credentialID, webAuthnCredentialReq, _callback); + + } + + /** + * + * Update credential + * @param credentialID ID of credential (required) + * @param webAuthnCredentialReq (required) + * @return WebAuthnCredentialRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
+ */ + public WebAuthnCredentialRsp webAuthnCredentialUpdate(String credentialID, WebAuthnCredentialReq webAuthnCredentialReq) throws ApiException { + ApiResponse localVarResp = webAuthnCredentialUpdateWithHttpInfo(credentialID, webAuthnCredentialReq); + return localVarResp.getData(); + } + + /** + * + * Update credential + * @param credentialID ID of credential (required) + * @param webAuthnCredentialReq (required) + * @return ApiResponse<WebAuthnCredentialRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
+ */ + public ApiResponse webAuthnCredentialUpdateWithHttpInfo(String credentialID, WebAuthnCredentialReq webAuthnCredentialReq) throws ApiException { + okhttp3.Call localVarCall = webAuthnCredentialUpdateValidateBeforeCall(credentialID, webAuthnCredentialReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Update credential + * @param credentialID ID of credential (required) + * @param webAuthnCredentialReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
+ */ + public okhttp3.Call webAuthnCredentialUpdateAsync(String credentialID, WebAuthnCredentialReq webAuthnCredentialReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnCredentialUpdateValidateBeforeCall(credentialID, webAuthnCredentialReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnMediationStart + * @param webAuthnMediationStartReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) mediation started successfully -
0 Error -
+ */ + public okhttp3.Call webAuthnMediationStartCall(WebAuthnMediationStartReq webAuthnMediationStartReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = webAuthnMediationStartReq; + + // create path and map variables + String localVarPath = "/v1/webauthn/mediation/start"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnMediationStartValidateBeforeCall(WebAuthnMediationStartReq webAuthnMediationStartReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'webAuthnMediationStartReq' is set + if (webAuthnMediationStartReq == null) { + throw new ApiException("Missing the required parameter 'webAuthnMediationStartReq' when calling webAuthnMediationStart(Async)"); + } + + return webAuthnMediationStartCall(webAuthnMediationStartReq, _callback); + + } + + /** + * + * Starts mediation for Passkeys (Biometrics) + * @param webAuthnMediationStartReq (required) + * @return WebAuthnMediationStartRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) mediation started successfully -
0 Error -
+ */ + public WebAuthnMediationStartRsp webAuthnMediationStart(WebAuthnMediationStartReq webAuthnMediationStartReq) throws ApiException { + ApiResponse localVarResp = webAuthnMediationStartWithHttpInfo(webAuthnMediationStartReq); + return localVarResp.getData(); + } + + /** + * + * Starts mediation for Passkeys (Biometrics) + * @param webAuthnMediationStartReq (required) + * @return ApiResponse<WebAuthnMediationStartRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) mediation started successfully -
0 Error -
+ */ + public ApiResponse webAuthnMediationStartWithHttpInfo(WebAuthnMediationStartReq webAuthnMediationStartReq) throws ApiException { + okhttp3.Call localVarCall = webAuthnMediationStartValidateBeforeCall(webAuthnMediationStartReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Starts mediation for Passkeys (Biometrics) + * @param webAuthnMediationStartReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) mediation started successfully -
0 Error -
+ */ + public okhttp3.Call webAuthnMediationStartAsync(WebAuthnMediationStartReq webAuthnMediationStartReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnMediationStartValidateBeforeCall(webAuthnMediationStartReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnRegisterFinish + * @param webAuthnFinishReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
+ */ + public okhttp3.Call webAuthnRegisterFinishCall(WebAuthnFinishReq webAuthnFinishReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = webAuthnFinishReq; + + // create path and map variables + String localVarPath = "/v1/webauthn/register/finish"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnRegisterFinishValidateBeforeCall(WebAuthnFinishReq webAuthnFinishReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'webAuthnFinishReq' is set + if (webAuthnFinishReq == null) { + throw new ApiException("Missing the required parameter 'webAuthnFinishReq' when calling webAuthnRegisterFinish(Async)"); + } + + return webAuthnRegisterFinishCall(webAuthnFinishReq, _callback); + + } + + /** + * + * Completes registration of a user for Passkeys (Biometrics) + * @param webAuthnFinishReq (required) + * @return WebAuthnRegisterFinishRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
+ */ + public WebAuthnRegisterFinishRsp webAuthnRegisterFinish(WebAuthnFinishReq webAuthnFinishReq) throws ApiException { + ApiResponse localVarResp = webAuthnRegisterFinishWithHttpInfo(webAuthnFinishReq); + return localVarResp.getData(); + } + + /** + * + * Completes registration of a user for Passkeys (Biometrics) + * @param webAuthnFinishReq (required) + * @return ApiResponse<WebAuthnRegisterFinishRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
+ */ + public ApiResponse webAuthnRegisterFinishWithHttpInfo(WebAuthnFinishReq webAuthnFinishReq) throws ApiException { + okhttp3.Call localVarCall = webAuthnRegisterFinishValidateBeforeCall(webAuthnFinishReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Completes registration of a user for Passkeys (Biometrics) + * @param webAuthnFinishReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
+ */ + public okhttp3.Call webAuthnRegisterFinishAsync(WebAuthnFinishReq webAuthnFinishReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnRegisterFinishValidateBeforeCall(webAuthnFinishReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnRegisterStart + * @param webAuthnRegisterStartReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) registration initiated successfully -
0 Error -
+ */ + public okhttp3.Call webAuthnRegisterStartCall(WebAuthnRegisterStartReq webAuthnRegisterStartReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = webAuthnRegisterStartReq; + + // create path and map variables + String localVarPath = "/v1/webauthn/register/start"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnRegisterStartValidateBeforeCall(WebAuthnRegisterStartReq webAuthnRegisterStartReq, final ApiCallback _callback) throws ApiException { + return webAuthnRegisterStartCall(webAuthnRegisterStartReq, _callback); + + } + + /** + * + * Starts registration of a user for Passkeys (Biometrics) + * @param webAuthnRegisterStartReq (optional) + * @return WebAuthnRegisterStartRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) registration initiated successfully -
0 Error -
+ */ + public WebAuthnRegisterStartRsp webAuthnRegisterStart(WebAuthnRegisterStartReq webAuthnRegisterStartReq) throws ApiException { + ApiResponse localVarResp = webAuthnRegisterStartWithHttpInfo(webAuthnRegisterStartReq); + return localVarResp.getData(); + } + + /** + * + * Starts registration of a user for Passkeys (Biometrics) + * @param webAuthnRegisterStartReq (optional) + * @return ApiResponse<WebAuthnRegisterStartRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) registration initiated successfully -
0 Error -
+ */ + public ApiResponse webAuthnRegisterStartWithHttpInfo(WebAuthnRegisterStartReq webAuthnRegisterStartReq) throws ApiException { + okhttp3.Call localVarCall = webAuthnRegisterStartValidateBeforeCall(webAuthnRegisterStartReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Starts registration of a user for Passkeys (Biometrics) + * @param webAuthnRegisterStartReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) registration initiated successfully -
0 Error -
+ */ + public okhttp3.Call webAuthnRegisterStartAsync(WebAuthnRegisterStartReq webAuthnRegisterStartReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnRegisterStartValidateBeforeCall(webAuthnRegisterStartReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnSettingCreate + * @param webauthnSettingCreateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) setting successfully created -
0 Error -
+ */ + public okhttp3.Call webAuthnSettingCreateCall(WebauthnSettingCreateReq webauthnSettingCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = webauthnSettingCreateReq; + + // create path and map variables + String localVarPath = "/v1/webauthn/settings"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnSettingCreateValidateBeforeCall(WebauthnSettingCreateReq webauthnSettingCreateReq, final ApiCallback _callback) throws ApiException { + return webAuthnSettingCreateCall(webauthnSettingCreateReq, _callback); + + } + + /** + * + * Creates a new setting for Passkeys (Biometrics) + * @param webauthnSettingCreateReq (optional) + * @return WebauthnSettingCreateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) setting successfully created -
0 Error -
+ */ + public WebauthnSettingCreateRsp webAuthnSettingCreate(WebauthnSettingCreateReq webauthnSettingCreateReq) throws ApiException { + ApiResponse localVarResp = webAuthnSettingCreateWithHttpInfo(webauthnSettingCreateReq); + return localVarResp.getData(); + } + + /** + * + * Creates a new setting for Passkeys (Biometrics) + * @param webauthnSettingCreateReq (optional) + * @return ApiResponse<WebauthnSettingCreateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) setting successfully created -
0 Error -
+ */ + public ApiResponse webAuthnSettingCreateWithHttpInfo(WebauthnSettingCreateReq webauthnSettingCreateReq) throws ApiException { + okhttp3.Call localVarCall = webAuthnSettingCreateValidateBeforeCall(webauthnSettingCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Creates a new setting for Passkeys (Biometrics) + * @param webauthnSettingCreateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkeys (Biometrics) setting successfully created -
0 Error -
+ */ + public okhttp3.Call webAuthnSettingCreateAsync(WebauthnSettingCreateReq webauthnSettingCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnSettingCreateValidateBeforeCall(webauthnSettingCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnSettingDelete + * @param settingID ID from create (required) + * @param webauthnSettingDeleteReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call webAuthnSettingDeleteCall(String settingID, WebauthnSettingDeleteReq webauthnSettingDeleteReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = webauthnSettingDeleteReq; + + // create path and map variables + String localVarPath = "/v1/webauthn/settings/{settingID}" + .replace("{" + "settingID" + "}", localVarApiClient.escapeString(settingID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnSettingDeleteValidateBeforeCall(String settingID, WebauthnSettingDeleteReq webauthnSettingDeleteReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settingID' is set + if (settingID == null) { + throw new ApiException("Missing the required parameter 'settingID' when calling webAuthnSettingDelete(Async)"); + } + + return webAuthnSettingDeleteCall(settingID, webauthnSettingDeleteReq, _callback); + + } + + /** + * + * Deletes a setting by id for Passkeys (Biometrics) + * @param settingID ID from create (required) + * @param webauthnSettingDeleteReq (optional) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp webAuthnSettingDelete(String settingID, WebauthnSettingDeleteReq webauthnSettingDeleteReq) throws ApiException { + ApiResponse localVarResp = webAuthnSettingDeleteWithHttpInfo(settingID, webauthnSettingDeleteReq); + return localVarResp.getData(); + } + + /** + * + * Deletes a setting by id for Passkeys (Biometrics) + * @param settingID ID from create (required) + * @param webauthnSettingDeleteReq (optional) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse webAuthnSettingDeleteWithHttpInfo(String settingID, WebauthnSettingDeleteReq webauthnSettingDeleteReq) throws ApiException { + okhttp3.Call localVarCall = webAuthnSettingDeleteValidateBeforeCall(settingID, webauthnSettingDeleteReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Deletes a setting by id for Passkeys (Biometrics) + * @param settingID ID from create (required) + * @param webauthnSettingDeleteReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call webAuthnSettingDeleteAsync(String settingID, WebauthnSettingDeleteReq webauthnSettingDeleteReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnSettingDeleteValidateBeforeCall(settingID, webauthnSettingDeleteReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnSettingGet + * @param settingID ID from create (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
+ */ + public okhttp3.Call webAuthnSettingGetCall(String settingID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/webauthn/settings/{settingID}" + .replace("{" + "settingID" + "}", localVarApiClient.escapeString(settingID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnSettingGetValidateBeforeCall(String settingID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settingID' is set + if (settingID == null) { + throw new ApiException("Missing the required parameter 'settingID' when calling webAuthnSettingGet(Async)"); + } + + return webAuthnSettingGetCall(settingID, _callback); + + } + + /** + * + * Gets a setting by id for Passkeys (Biometrics) + * @param settingID ID from create (required) + * @return WebauthnSettingGetRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
+ */ + public WebauthnSettingGetRsp webAuthnSettingGet(String settingID) throws ApiException { + ApiResponse localVarResp = webAuthnSettingGetWithHttpInfo(settingID); + return localVarResp.getData(); + } + + /** + * + * Gets a setting by id for Passkeys (Biometrics) + * @param settingID ID from create (required) + * @return ApiResponse<WebauthnSettingGetRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
+ */ + public ApiResponse webAuthnSettingGetWithHttpInfo(String settingID) throws ApiException { + okhttp3.Call localVarCall = webAuthnSettingGetValidateBeforeCall(settingID, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Gets a setting by id for Passkeys (Biometrics) + * @param settingID ID from create (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
+ */ + public okhttp3.Call webAuthnSettingGetAsync(String settingID, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnSettingGetValidateBeforeCall(settingID, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnSettingList + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains a list of all Passkeys (Biometrics) settings -
0 Error -
+ */ + public okhttp3.Call webAuthnSettingListCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/webauthn/settings"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnSettingListValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + return webAuthnSettingListCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Lists all settings for Passkeys (Biometrics) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return WebauthnSettingListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains a list of all Passkeys (Biometrics) settings -
0 Error -
+ */ + public WebauthnSettingListRsp webAuthnSettingList(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = webAuthnSettingListWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Lists all settings for Passkeys (Biometrics) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<WebauthnSettingListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains a list of all Passkeys (Biometrics) settings -
0 Error -
+ */ + public ApiResponse webAuthnSettingListWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = webAuthnSettingListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Lists all settings for Passkeys (Biometrics) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains a list of all Passkeys (Biometrics) settings -
0 Error -
+ */ + public okhttp3.Call webAuthnSettingListAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnSettingListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnSettingPut + * @param settingID ID from create (required) + * @param webauthnSettingUpdateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
+ */ + public okhttp3.Call webAuthnSettingPutCall(String settingID, WebauthnSettingUpdateReq webauthnSettingUpdateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = webauthnSettingUpdateReq; + + // create path and map variables + String localVarPath = "/v1/webauthn/settings/{settingID}" + .replace("{" + "settingID" + "}", localVarApiClient.escapeString(settingID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnSettingPutValidateBeforeCall(String settingID, WebauthnSettingUpdateReq webauthnSettingUpdateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'settingID' is set + if (settingID == null) { + throw new ApiException("Missing the required parameter 'settingID' when calling webAuthnSettingPut(Async)"); + } + + return webAuthnSettingPutCall(settingID, webauthnSettingUpdateReq, _callback); + + } + + /** + * + * Updates a setting by id for Passkeys (Biometrics) + * @param settingID ID from create (required) + * @param webauthnSettingUpdateReq (optional) + * @return WebauthnSettingUpdateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
+ */ + public WebauthnSettingUpdateRsp webAuthnSettingPut(String settingID, WebauthnSettingUpdateReq webauthnSettingUpdateReq) throws ApiException { + ApiResponse localVarResp = webAuthnSettingPutWithHttpInfo(settingID, webauthnSettingUpdateReq); + return localVarResp.getData(); + } + + /** + * + * Updates a setting by id for Passkeys (Biometrics) + * @param settingID ID from create (required) + * @param webauthnSettingUpdateReq (optional) + * @return ApiResponse<WebauthnSettingUpdateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
+ */ + public ApiResponse webAuthnSettingPutWithHttpInfo(String settingID, WebauthnSettingUpdateReq webauthnSettingUpdateReq) throws ApiException { + okhttp3.Call localVarCall = webAuthnSettingPutValidateBeforeCall(settingID, webauthnSettingUpdateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Updates a setting by id for Passkeys (Biometrics) + * @param settingID ID from create (required) + * @param webauthnSettingUpdateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
+ */ + public okhttp3.Call webAuthnSettingPutAsync(String settingID, WebauthnSettingUpdateReq webauthnSettingUpdateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnSettingPutValidateBeforeCall(settingID, webauthnSettingUpdateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnStatsAuthenticator + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) authenticator statistics -
0 Error -
+ */ + public okhttp3.Call webAuthnStatsAuthenticatorCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/webauthn/stats/authenticator"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + if (granularity != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnStatsAuthenticatorValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'granularity' is set + if (granularity == null) { + throw new ApiException("Missing the required parameter 'granularity' when calling webAuthnStatsAuthenticator(Async)"); + } + + return webAuthnStatsAuthenticatorCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Provides Passkeys (Biometrics) authenticator statistics + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return WebauthnStatsAuthenticatorRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) authenticator statistics -
0 Error -
+ */ + public WebauthnStatsAuthenticatorRsp webAuthnStatsAuthenticator(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = webAuthnStatsAuthenticatorWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Provides Passkeys (Biometrics) authenticator statistics + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<WebauthnStatsAuthenticatorRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) authenticator statistics -
0 Error -
+ */ + public ApiResponse webAuthnStatsAuthenticatorWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = webAuthnStatsAuthenticatorValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Provides Passkeys (Biometrics) authenticator statistics + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) authenticator statistics -
0 Error -
+ */ + public okhttp3.Call webAuthnStatsAuthenticatorAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnStatsAuthenticatorValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for webAuthnStatsType + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) statistics -
0 Error -
+ */ + public okhttp3.Call webAuthnStatsTypeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/webauthn/stats/type"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + if (granularity != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webAuthnStatsTypeValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'granularity' is set + if (granularity == null) { + throw new ApiException("Missing the required parameter 'granularity' when calling webAuthnStatsType(Async)"); + } + + return webAuthnStatsTypeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Provides Passkeys (Biometrics) type statistics + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return WebauthnStatsTypeRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) statistics -
0 Error -
+ */ + public WebauthnStatsTypeRsp webAuthnStatsType(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = webAuthnStatsTypeWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Provides Passkeys (Biometrics) type statistics + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<WebauthnStatsTypeRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) statistics -
0 Error -
+ */ + public ApiResponse webAuthnStatsTypeWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = webAuthnStatsTypeValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Provides Passkeys (Biometrics) type statistics + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) statistics -
0 Error -
+ */ + public okhttp3.Call webAuthnStatsTypeAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webAuthnStatsTypeValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/ProjectConfigApi.java b/src/main/java/com/corbado/generated/api/ProjectConfigApi.java new file mode 100644 index 0000000..35c1d59 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/ProjectConfigApi.java @@ -0,0 +1,579 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.EmptyReq; +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.GenericRsp; +import com.corbado.generated.model.ProjectConfigGetRsp; +import com.corbado.generated.model.ProjectConfigSaveReq; +import com.corbado.generated.model.ProjectConfigWebhookTestReq; +import com.corbado.generated.model.ProjectConfigWebhookTestRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ProjectConfigApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ProjectConfigApi() { + this(Configuration.getDefaultApiClient()); + } + + public ProjectConfigApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for projectActivate + * @param emptyReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call projectActivateCall(EmptyReq emptyReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = emptyReq; + + // create path and map variables + String localVarPath = "/v1/projects/activate"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call projectActivateValidateBeforeCall(EmptyReq emptyReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'emptyReq' is set + if (emptyReq == null) { + throw new ApiException("Missing the required parameter 'emptyReq' when calling projectActivate(Async)"); + } + + return projectActivateCall(emptyReq, _callback); + + } + + /** + * + * Activates the project + * @param emptyReq (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp projectActivate(EmptyReq emptyReq) throws ApiException { + ApiResponse localVarResp = projectActivateWithHttpInfo(emptyReq); + return localVarResp.getData(); + } + + /** + * + * Activates the project + * @param emptyReq (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse projectActivateWithHttpInfo(EmptyReq emptyReq) throws ApiException { + okhttp3.Call localVarCall = projectActivateValidateBeforeCall(emptyReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Activates the project + * @param emptyReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call projectActivateAsync(EmptyReq emptyReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = projectActivateValidateBeforeCall(emptyReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for projectConfigGet + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Project config successfully retrieved -
0 Error -
+ */ + public okhttp3.Call projectConfigGetCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/projectConfig"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call projectConfigGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return projectConfigGetCall(_callback); + + } + + /** + * + * Retrieves project config by projectID inferred from authentication + * @return ProjectConfigGetRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Project config successfully retrieved -
0 Error -
+ */ + public ProjectConfigGetRsp projectConfigGet() throws ApiException { + ApiResponse localVarResp = projectConfigGetWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * Retrieves project config by projectID inferred from authentication + * @return ApiResponse<ProjectConfigGetRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Project config successfully retrieved -
0 Error -
+ */ + public ApiResponse projectConfigGetWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = projectConfigGetValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Retrieves project config by projectID inferred from authentication + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Project config successfully retrieved -
0 Error -
+ */ + public okhttp3.Call projectConfigGetAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = projectConfigGetValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for projectConfigSave + * @param projectConfigSaveReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Project config successfully saved -
0 Error -
+ */ + public okhttp3.Call projectConfigSaveCall(ProjectConfigSaveReq projectConfigSaveReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = projectConfigSaveReq; + + // create path and map variables + String localVarPath = "/v1/projectConfig"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call projectConfigSaveValidateBeforeCall(ProjectConfigSaveReq projectConfigSaveReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'projectConfigSaveReq' is set + if (projectConfigSaveReq == null) { + throw new ApiException("Missing the required parameter 'projectConfigSaveReq' when calling projectConfigSave(Async)"); + } + + return projectConfigSaveCall(projectConfigSaveReq, _callback); + + } + + /** + * + * Saves project config + * @param projectConfigSaveReq (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Project config successfully saved -
0 Error -
+ */ + public GenericRsp projectConfigSave(ProjectConfigSaveReq projectConfigSaveReq) throws ApiException { + ApiResponse localVarResp = projectConfigSaveWithHttpInfo(projectConfigSaveReq); + return localVarResp.getData(); + } + + /** + * + * Saves project config + * @param projectConfigSaveReq (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Project config successfully saved -
0 Error -
+ */ + public ApiResponse projectConfigSaveWithHttpInfo(ProjectConfigSaveReq projectConfigSaveReq) throws ApiException { + okhttp3.Call localVarCall = projectConfigSaveValidateBeforeCall(projectConfigSaveReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Saves project config + * @param projectConfigSaveReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Project config successfully saved -
0 Error -
+ */ + public okhttp3.Call projectConfigSaveAsync(ProjectConfigSaveReq projectConfigSaveReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = projectConfigSaveValidateBeforeCall(projectConfigSaveReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for projectConfigWebhookTest + * @param projectConfigWebhookTestReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation result -
0 Error -
+ */ + public okhttp3.Call projectConfigWebhookTestCall(ProjectConfigWebhookTestReq projectConfigWebhookTestReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = projectConfigWebhookTestReq; + + // create path and map variables + String localVarPath = "/v1/projectConfig/testWebhook"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call projectConfigWebhookTestValidateBeforeCall(ProjectConfigWebhookTestReq projectConfigWebhookTestReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'projectConfigWebhookTestReq' is set + if (projectConfigWebhookTestReq == null) { + throw new ApiException("Missing the required parameter 'projectConfigWebhookTestReq' when calling projectConfigWebhookTest(Async)"); + } + + return projectConfigWebhookTestCall(projectConfigWebhookTestReq, _callback); + + } + + /** + * + * Tests webhook backend + * @param projectConfigWebhookTestReq (required) + * @return ProjectConfigWebhookTestRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation result -
0 Error -
+ */ + public ProjectConfigWebhookTestRsp projectConfigWebhookTest(ProjectConfigWebhookTestReq projectConfigWebhookTestReq) throws ApiException { + ApiResponse localVarResp = projectConfigWebhookTestWithHttpInfo(projectConfigWebhookTestReq); + return localVarResp.getData(); + } + + /** + * + * Tests webhook backend + * @param projectConfigWebhookTestReq (required) + * @return ApiResponse<ProjectConfigWebhookTestRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation result -
0 Error -
+ */ + public ApiResponse projectConfigWebhookTestWithHttpInfo(ProjectConfigWebhookTestReq projectConfigWebhookTestReq) throws ApiException { + okhttp3.Call localVarCall = projectConfigWebhookTestValidateBeforeCall(projectConfigWebhookTestReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Tests webhook backend + * @param projectConfigWebhookTestReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation result -
0 Error -
+ */ + public okhttp3.Call projectConfigWebhookTestAsync(ProjectConfigWebhookTestReq projectConfigWebhookTestReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = projectConfigWebhookTestValidateBeforeCall(projectConfigWebhookTestReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/RequestLogsApi.java b/src/main/java/com/corbado/generated/api/RequestLogsApi.java new file mode 100644 index 0000000..2c4cf11 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/RequestLogsApi.java @@ -0,0 +1,385 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.RequestLogGetRsp; +import com.corbado.generated.model.RequestLogsListRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class RequestLogsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public RequestLogsApi() { + this(Configuration.getDefaultApiClient()); + } + + public RequestLogsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for requestLogGet + * @param requestID ID of request (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Request log successfully retrieved -
0 Error -
+ */ + public okhttp3.Call requestLogGetCall(String requestID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/requestLogs/{requestID}" + .replace("{" + "requestID" + "}", localVarApiClient.escapeString(requestID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call requestLogGetValidateBeforeCall(String requestID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'requestID' is set + if (requestID == null) { + throw new ApiException("Missing the required parameter 'requestID' when calling requestLogGet(Async)"); + } + + return requestLogGetCall(requestID, remoteAddress, userAgent, _callback); + + } + + /** + * + * Retrieves request log entry by ID. If multiple requests with the same ID are found, the most recent one is returned + * @param requestID ID of request (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @return RequestLogGetRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Request log successfully retrieved -
0 Error -
+ */ + public RequestLogGetRsp requestLogGet(String requestID, String remoteAddress, String userAgent) throws ApiException { + ApiResponse localVarResp = requestLogGetWithHttpInfo(requestID, remoteAddress, userAgent); + return localVarResp.getData(); + } + + /** + * + * Retrieves request log entry by ID. If multiple requests with the same ID are found, the most recent one is returned + * @param requestID ID of request (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @return ApiResponse<RequestLogGetRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Request log successfully retrieved -
0 Error -
+ */ + public ApiResponse requestLogGetWithHttpInfo(String requestID, String remoteAddress, String userAgent) throws ApiException { + okhttp3.Call localVarCall = requestLogGetValidateBeforeCall(requestID, remoteAddress, userAgent, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Retrieves request log entry by ID. If multiple requests with the same ID are found, the most recent one is returned + * @param requestID ID of request (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Request log successfully retrieved -
0 Error -
+ */ + public okhttp3.Call requestLogGetAsync(String requestID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = requestLogGetValidateBeforeCall(requestID, remoteAddress, userAgent, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for requestLogsList + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Request logs successfully retrieved -
0 Error -
+ */ + public okhttp3.Call requestLogsListCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/requestLogs"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call requestLogsListValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + return requestLogsListCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Lists request logs for given filters + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return RequestLogsListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Request logs successfully retrieved -
0 Error -
+ */ + public RequestLogsListRsp requestLogsList(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = requestLogsListWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Lists request logs for given filters + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<RequestLogsListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Request logs successfully retrieved -
0 Error -
+ */ + public ApiResponse requestLogsListWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = requestLogsListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Lists request logs for given filters + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Request logs successfully retrieved -
0 Error -
+ */ + public okhttp3.Call requestLogsListAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = requestLogsListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/SessionConfigApi.java b/src/main/java/com/corbado/generated/api/SessionConfigApi.java new file mode 100644 index 0000000..2f6e756 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/SessionConfigApi.java @@ -0,0 +1,331 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.AppType; +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.GenericRsp; +import com.corbado.generated.model.SessionConfigGetRsp; +import com.corbado.generated.model.SessionConfigUpdateReq; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SessionConfigApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SessionConfigApi() { + this(Configuration.getDefaultApiClient()); + } + + public SessionConfigApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for sessionConfigGet + * @param appType Application type (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Session config successfully retrieved -
0 Error -
+ */ + public okhttp3.Call sessionConfigGetCall(AppType appType, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/sessionConfig"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (appType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("appType", appType)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sessionConfigGetValidateBeforeCall(AppType appType, final ApiCallback _callback) throws ApiException { + return sessionConfigGetCall(appType, _callback); + + } + + /** + * + * Retrieves session config by projectID inferred from authentication + * @param appType Application type (optional) + * @return SessionConfigGetRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Session config successfully retrieved -
0 Error -
+ */ + public SessionConfigGetRsp sessionConfigGet(AppType appType) throws ApiException { + ApiResponse localVarResp = sessionConfigGetWithHttpInfo(appType); + return localVarResp.getData(); + } + + /** + * + * Retrieves session config by projectID inferred from authentication + * @param appType Application type (optional) + * @return ApiResponse<SessionConfigGetRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Session config successfully retrieved -
0 Error -
+ */ + public ApiResponse sessionConfigGetWithHttpInfo(AppType appType) throws ApiException { + okhttp3.Call localVarCall = sessionConfigGetValidateBeforeCall(appType, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Retrieves session config by projectID inferred from authentication + * @param appType Application type (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Session config successfully retrieved -
0 Error -
+ */ + public okhttp3.Call sessionConfigGetAsync(AppType appType, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = sessionConfigGetValidateBeforeCall(appType, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for sessionConfigUpdate + * @param sessionConfigUpdateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Session config successfully saved -
0 Error -
+ */ + public okhttp3.Call sessionConfigUpdateCall(SessionConfigUpdateReq sessionConfigUpdateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = sessionConfigUpdateReq; + + // create path and map variables + String localVarPath = "/v1/sessionConfig"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sessionConfigUpdateValidateBeforeCall(SessionConfigUpdateReq sessionConfigUpdateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'sessionConfigUpdateReq' is set + if (sessionConfigUpdateReq == null) { + throw new ApiException("Missing the required parameter 'sessionConfigUpdateReq' when calling sessionConfigUpdate(Async)"); + } + + return sessionConfigUpdateCall(sessionConfigUpdateReq, _callback); + + } + + /** + * + * Updates session config + * @param sessionConfigUpdateReq (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Session config successfully saved -
0 Error -
+ */ + public GenericRsp sessionConfigUpdate(SessionConfigUpdateReq sessionConfigUpdateReq) throws ApiException { + ApiResponse localVarResp = sessionConfigUpdateWithHttpInfo(sessionConfigUpdateReq); + return localVarResp.getData(); + } + + /** + * + * Updates session config + * @param sessionConfigUpdateReq (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Session config successfully saved -
0 Error -
+ */ + public ApiResponse sessionConfigUpdateWithHttpInfo(SessionConfigUpdateReq sessionConfigUpdateReq) throws ApiException { + okhttp3.Call localVarCall = sessionConfigUpdateValidateBeforeCall(sessionConfigUpdateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Updates session config + * @param sessionConfigUpdateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Session config successfully saved -
0 Error -
+ */ + public okhttp3.Call sessionConfigUpdateAsync(SessionConfigUpdateReq sessionConfigUpdateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = sessionConfigUpdateValidateBeforeCall(sessionConfigUpdateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/SmsOtpApi.java b/src/main/java/com/corbado/generated/api/SmsOtpApi.java new file mode 100644 index 0000000..d26fd57 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/SmsOtpApi.java @@ -0,0 +1,343 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.SmsCodeSendReq; +import com.corbado.generated.model.SmsCodeSendRsp; +import com.corbado.generated.model.SmsCodeValidateReq; +import com.corbado.generated.model.SmsCodeValidateRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SmsOtpApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SmsOtpApi() { + this(Configuration.getDefaultApiClient()); + } + + public SmsOtpApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for smsCodeSend + * @param smsCodeSendReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 SMS successfully sent -
0 Error -
+ */ + public okhttp3.Call smsCodeSendCall(SmsCodeSendReq smsCodeSendReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = smsCodeSendReq; + + // create path and map variables + String localVarPath = "/v1/smsCodes"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call smsCodeSendValidateBeforeCall(SmsCodeSendReq smsCodeSendReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'smsCodeSendReq' is set + if (smsCodeSendReq == null) { + throw new ApiException("Missing the required parameter 'smsCodeSendReq' when calling smsCodeSend(Async)"); + } + + return smsCodeSendCall(smsCodeSendReq, _callback); + + } + + /** + * + * Creates SMS OTP and sends it to given phone number + * @param smsCodeSendReq (required) + * @return SmsCodeSendRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 SMS successfully sent -
0 Error -
+ */ + public SmsCodeSendRsp smsCodeSend(SmsCodeSendReq smsCodeSendReq) throws ApiException { + ApiResponse localVarResp = smsCodeSendWithHttpInfo(smsCodeSendReq); + return localVarResp.getData(); + } + + /** + * + * Creates SMS OTP and sends it to given phone number + * @param smsCodeSendReq (required) + * @return ApiResponse<SmsCodeSendRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 SMS successfully sent -
0 Error -
+ */ + public ApiResponse smsCodeSendWithHttpInfo(SmsCodeSendReq smsCodeSendReq) throws ApiException { + okhttp3.Call localVarCall = smsCodeSendValidateBeforeCall(smsCodeSendReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Creates SMS OTP and sends it to given phone number + * @param smsCodeSendReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 SMS successfully sent -
0 Error -
+ */ + public okhttp3.Call smsCodeSendAsync(SmsCodeSendReq smsCodeSendReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = smsCodeSendValidateBeforeCall(smsCodeSendReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for smsCodeValidate + * @param smsCodeID ID of SMS OTP (required) + * @param smsCodeValidateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public okhttp3.Call smsCodeValidateCall(String smsCodeID, SmsCodeValidateReq smsCodeValidateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = smsCodeValidateReq; + + // create path and map variables + String localVarPath = "/v1/smsCodes/{smsCodeID}/validate" + .replace("{" + "smsCodeID" + "}", localVarApiClient.escapeString(smsCodeID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call smsCodeValidateValidateBeforeCall(String smsCodeID, SmsCodeValidateReq smsCodeValidateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'smsCodeID' is set + if (smsCodeID == null) { + throw new ApiException("Missing the required parameter 'smsCodeID' when calling smsCodeValidate(Async)"); + } + + // verify the required parameter 'smsCodeValidateReq' is set + if (smsCodeValidateReq == null) { + throw new ApiException("Missing the required parameter 'smsCodeValidateReq' when calling smsCodeValidate(Async)"); + } + + return smsCodeValidateCall(smsCodeID, smsCodeValidateReq, _callback); + + } + + /** + * + * Validates SMS OTP + * @param smsCodeID ID of SMS OTP (required) + * @param smsCodeValidateReq (required) + * @return SmsCodeValidateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public SmsCodeValidateRsp smsCodeValidate(String smsCodeID, SmsCodeValidateReq smsCodeValidateReq) throws ApiException { + ApiResponse localVarResp = smsCodeValidateWithHttpInfo(smsCodeID, smsCodeValidateReq); + return localVarResp.getData(); + } + + /** + * + * Validates SMS OTP + * @param smsCodeID ID of SMS OTP (required) + * @param smsCodeValidateReq (required) + * @return ApiResponse<SmsCodeValidateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public ApiResponse smsCodeValidateWithHttpInfo(String smsCodeID, SmsCodeValidateReq smsCodeValidateReq) throws ApiException { + okhttp3.Call localVarCall = smsCodeValidateValidateBeforeCall(smsCodeID, smsCodeValidateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Validates SMS OTP + * @param smsCodeID ID of SMS OTP (required) + * @param smsCodeValidateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Validation was successful -
0 Error -
+ */ + public okhttp3.Call smsCodeValidateAsync(String smsCodeID, SmsCodeValidateReq smsCodeValidateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = smsCodeValidateValidateBeforeCall(smsCodeID, smsCodeValidateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/SmsTemplatesApi.java b/src/main/java/com/corbado/generated/api/SmsTemplatesApi.java new file mode 100644 index 0000000..cc78d2d --- /dev/null +++ b/src/main/java/com/corbado/generated/api/SmsTemplatesApi.java @@ -0,0 +1,343 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.GenericRsp; +import com.corbado.generated.model.SmsTemplateCreateReq; +import com.corbado.generated.model.SmsTemplateCreateRsp; +import com.corbado.generated.model.SmsTemplateDeleteReq; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SmsTemplatesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SmsTemplatesApi() { + this(Configuration.getDefaultApiClient()); + } + + public SmsTemplatesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for smsTemplateCreate + * @param smsTemplateCreateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 SMS template successfully created -
0 Error -
+ */ + public okhttp3.Call smsTemplateCreateCall(SmsTemplateCreateReq smsTemplateCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = smsTemplateCreateReq; + + // create path and map variables + String localVarPath = "/v1/smsTemplates"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call smsTemplateCreateValidateBeforeCall(SmsTemplateCreateReq smsTemplateCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'smsTemplateCreateReq' is set + if (smsTemplateCreateReq == null) { + throw new ApiException("Missing the required parameter 'smsTemplateCreateReq' when calling smsTemplateCreate(Async)"); + } + + return smsTemplateCreateCall(smsTemplateCreateReq, _callback); + + } + + /** + * + * Creates a new SMS template + * @param smsTemplateCreateReq (required) + * @return SmsTemplateCreateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 SMS template successfully created -
0 Error -
+ */ + public SmsTemplateCreateRsp smsTemplateCreate(SmsTemplateCreateReq smsTemplateCreateReq) throws ApiException { + ApiResponse localVarResp = smsTemplateCreateWithHttpInfo(smsTemplateCreateReq); + return localVarResp.getData(); + } + + /** + * + * Creates a new SMS template + * @param smsTemplateCreateReq (required) + * @return ApiResponse<SmsTemplateCreateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 SMS template successfully created -
0 Error -
+ */ + public ApiResponse smsTemplateCreateWithHttpInfo(SmsTemplateCreateReq smsTemplateCreateReq) throws ApiException { + okhttp3.Call localVarCall = smsTemplateCreateValidateBeforeCall(smsTemplateCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Creates a new SMS template + * @param smsTemplateCreateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 SMS template successfully created -
0 Error -
+ */ + public okhttp3.Call smsTemplateCreateAsync(SmsTemplateCreateReq smsTemplateCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = smsTemplateCreateValidateBeforeCall(smsTemplateCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for smsTemplateDelete + * @param smsTemplateID ID of SMS template (required) + * @param smsTemplateDeleteReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call smsTemplateDeleteCall(String smsTemplateID, SmsTemplateDeleteReq smsTemplateDeleteReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = smsTemplateDeleteReq; + + // create path and map variables + String localVarPath = "/v1/smsTemplates/{smsTemplateID}" + .replace("{" + "smsTemplateID" + "}", localVarApiClient.escapeString(smsTemplateID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call smsTemplateDeleteValidateBeforeCall(String smsTemplateID, SmsTemplateDeleteReq smsTemplateDeleteReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'smsTemplateID' is set + if (smsTemplateID == null) { + throw new ApiException("Missing the required parameter 'smsTemplateID' when calling smsTemplateDelete(Async)"); + } + + // verify the required parameter 'smsTemplateDeleteReq' is set + if (smsTemplateDeleteReq == null) { + throw new ApiException("Missing the required parameter 'smsTemplateDeleteReq' when calling smsTemplateDelete(Async)"); + } + + return smsTemplateDeleteCall(smsTemplateID, smsTemplateDeleteReq, _callback); + + } + + /** + * + * Deletes an SMS template + * @param smsTemplateID ID of SMS template (required) + * @param smsTemplateDeleteReq (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp smsTemplateDelete(String smsTemplateID, SmsTemplateDeleteReq smsTemplateDeleteReq) throws ApiException { + ApiResponse localVarResp = smsTemplateDeleteWithHttpInfo(smsTemplateID, smsTemplateDeleteReq); + return localVarResp.getData(); + } + + /** + * + * Deletes an SMS template + * @param smsTemplateID ID of SMS template (required) + * @param smsTemplateDeleteReq (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse smsTemplateDeleteWithHttpInfo(String smsTemplateID, SmsTemplateDeleteReq smsTemplateDeleteReq) throws ApiException { + okhttp3.Call localVarCall = smsTemplateDeleteValidateBeforeCall(smsTemplateID, smsTemplateDeleteReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Deletes an SMS template + * @param smsTemplateID ID of SMS template (required) + * @param smsTemplateDeleteReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call smsTemplateDeleteAsync(String smsTemplateID, SmsTemplateDeleteReq smsTemplateDeleteReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = smsTemplateDeleteValidateBeforeCall(smsTemplateID, smsTemplateDeleteReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/UserApi.java b/src/main/java/com/corbado/generated/api/UserApi.java new file mode 100644 index 0000000..8f56627 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/UserApi.java @@ -0,0 +1,2757 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.GenericRsp; +import com.corbado.generated.model.UserAuthLogListRsp; +import com.corbado.generated.model.UserCreateReq; +import com.corbado.generated.model.UserCreateRsp; +import com.corbado.generated.model.UserCustomLoginIdentifierCreateReq; +import com.corbado.generated.model.UserCustomLoginIdentifierCreateRsp; +import com.corbado.generated.model.UserCustomLoginIdentifierDeleteReq; +import com.corbado.generated.model.UserCustomLoginIdentifierGetRsp; +import com.corbado.generated.model.UserDeleteReq; +import com.corbado.generated.model.UserDeviceListRsp; +import com.corbado.generated.model.UserEmailCreateReq; +import com.corbado.generated.model.UserEmailCreateRsp; +import com.corbado.generated.model.UserEmailDeleteReq; +import com.corbado.generated.model.UserEmailGetRsp; +import com.corbado.generated.model.UserExistsReq; +import com.corbado.generated.model.UserExistsRsp; +import com.corbado.generated.model.UserGetRsp; +import com.corbado.generated.model.UserListRsp; +import com.corbado.generated.model.UserPhoneNumberCreateReq; +import com.corbado.generated.model.UserPhoneNumberCreateRsp; +import com.corbado.generated.model.UserPhoneNumberDeleteReq; +import com.corbado.generated.model.UserPhoneNumberGetRsp; +import com.corbado.generated.model.UserStatsListRsp; +import com.corbado.generated.model.UserUpdateReq; +import com.corbado.generated.model.UserUpdateRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class UserApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public UserApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for userAuthLogList + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
+ */ + public okhttp3.Call userAuthLogListCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/userauthlogs"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userAuthLogListValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + return userAuthLogListCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Lists user auth log + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return UserAuthLogListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
+ */ + public UserAuthLogListRsp userAuthLogList(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = userAuthLogListWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Lists user auth log + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<UserAuthLogListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
+ */ + public ApiResponse userAuthLogListWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = userAuthLogListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Lists user auth log + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
+ */ + public okhttp3.Call userAuthLogListAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userAuthLogListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userCreate + * @param userCreateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User successfully created -
0 Error -
+ */ + public okhttp3.Call userCreateCall(UserCreateReq userCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userCreateReq; + + // create path and map variables + String localVarPath = "/v1/users"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userCreateValidateBeforeCall(UserCreateReq userCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userCreateReq' is set + if (userCreateReq == null) { + throw new ApiException("Missing the required parameter 'userCreateReq' when calling userCreate(Async)"); + } + + return userCreateCall(userCreateReq, _callback); + + } + + /** + * + * Creates a new user + * @param userCreateReq (required) + * @return UserCreateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User successfully created -
0 Error -
+ */ + public UserCreateRsp userCreate(UserCreateReq userCreateReq) throws ApiException { + ApiResponse localVarResp = userCreateWithHttpInfo(userCreateReq); + return localVarResp.getData(); + } + + /** + * + * Creates a new user + * @param userCreateReq (required) + * @return ApiResponse<UserCreateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User successfully created -
0 Error -
+ */ + public ApiResponse userCreateWithHttpInfo(UserCreateReq userCreateReq) throws ApiException { + okhttp3.Call localVarCall = userCreateValidateBeforeCall(userCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Creates a new user + * @param userCreateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User successfully created -
0 Error -
+ */ + public okhttp3.Call userCreateAsync(UserCreateReq userCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userCreateValidateBeforeCall(userCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userCustomLoginIdentifierCreate + * @param userID ID of user (required) + * @param userCustomLoginIdentifierCreateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User custom login identifier created -
0 Error -
+ */ + public okhttp3.Call userCustomLoginIdentifierCreateCall(String userID, UserCustomLoginIdentifierCreateReq userCustomLoginIdentifierCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userCustomLoginIdentifierCreateReq; + + // create path and map variables + String localVarPath = "/v1/users/{userID}/customLoginIdentifiers" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userCustomLoginIdentifierCreateValidateBeforeCall(String userID, UserCustomLoginIdentifierCreateReq userCustomLoginIdentifierCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userCustomLoginIdentifierCreate(Async)"); + } + + // verify the required parameter 'userCustomLoginIdentifierCreateReq' is set + if (userCustomLoginIdentifierCreateReq == null) { + throw new ApiException("Missing the required parameter 'userCustomLoginIdentifierCreateReq' when calling userCustomLoginIdentifierCreate(Async)"); + } + + return userCustomLoginIdentifierCreateCall(userID, userCustomLoginIdentifierCreateReq, _callback); + + } + + /** + * + * Add a custom login identifier to an existing user + * @param userID ID of user (required) + * @param userCustomLoginIdentifierCreateReq (required) + * @return UserCustomLoginIdentifierCreateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User custom login identifier created -
0 Error -
+ */ + public UserCustomLoginIdentifierCreateRsp userCustomLoginIdentifierCreate(String userID, UserCustomLoginIdentifierCreateReq userCustomLoginIdentifierCreateReq) throws ApiException { + ApiResponse localVarResp = userCustomLoginIdentifierCreateWithHttpInfo(userID, userCustomLoginIdentifierCreateReq); + return localVarResp.getData(); + } + + /** + * + * Add a custom login identifier to an existing user + * @param userID ID of user (required) + * @param userCustomLoginIdentifierCreateReq (required) + * @return ApiResponse<UserCustomLoginIdentifierCreateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User custom login identifier created -
0 Error -
+ */ + public ApiResponse userCustomLoginIdentifierCreateWithHttpInfo(String userID, UserCustomLoginIdentifierCreateReq userCustomLoginIdentifierCreateReq) throws ApiException { + okhttp3.Call localVarCall = userCustomLoginIdentifierCreateValidateBeforeCall(userID, userCustomLoginIdentifierCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Add a custom login identifier to an existing user + * @param userID ID of user (required) + * @param userCustomLoginIdentifierCreateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User custom login identifier created -
0 Error -
+ */ + public okhttp3.Call userCustomLoginIdentifierCreateAsync(String userID, UserCustomLoginIdentifierCreateReq userCustomLoginIdentifierCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userCustomLoginIdentifierCreateValidateBeforeCall(userID, userCustomLoginIdentifierCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userCustomLoginIdentifierDelete + * @param userID ID of user (required) + * @param customLoginIdentifierID ID of custom login identifier (required) + * @param userCustomLoginIdentifierDeleteReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call userCustomLoginIdentifierDeleteCall(String userID, String customLoginIdentifierID, UserCustomLoginIdentifierDeleteReq userCustomLoginIdentifierDeleteReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userCustomLoginIdentifierDeleteReq; + + // create path and map variables + String localVarPath = "/v1/users/{userID}/customLoginIdentifiers/{customLoginIdentifierID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "customLoginIdentifierID" + "}", localVarApiClient.escapeString(customLoginIdentifierID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userCustomLoginIdentifierDeleteValidateBeforeCall(String userID, String customLoginIdentifierID, UserCustomLoginIdentifierDeleteReq userCustomLoginIdentifierDeleteReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userCustomLoginIdentifierDelete(Async)"); + } + + // verify the required parameter 'customLoginIdentifierID' is set + if (customLoginIdentifierID == null) { + throw new ApiException("Missing the required parameter 'customLoginIdentifierID' when calling userCustomLoginIdentifierDelete(Async)"); + } + + // verify the required parameter 'userCustomLoginIdentifierDeleteReq' is set + if (userCustomLoginIdentifierDeleteReq == null) { + throw new ApiException("Missing the required parameter 'userCustomLoginIdentifierDeleteReq' when calling userCustomLoginIdentifierDelete(Async)"); + } + + return userCustomLoginIdentifierDeleteCall(userID, customLoginIdentifierID, userCustomLoginIdentifierDeleteReq, _callback); + + } + + /** + * + * Delete a user's custom login identifier + * @param userID ID of user (required) + * @param customLoginIdentifierID ID of custom login identifier (required) + * @param userCustomLoginIdentifierDeleteReq (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp userCustomLoginIdentifierDelete(String userID, String customLoginIdentifierID, UserCustomLoginIdentifierDeleteReq userCustomLoginIdentifierDeleteReq) throws ApiException { + ApiResponse localVarResp = userCustomLoginIdentifierDeleteWithHttpInfo(userID, customLoginIdentifierID, userCustomLoginIdentifierDeleteReq); + return localVarResp.getData(); + } + + /** + * + * Delete a user's custom login identifier + * @param userID ID of user (required) + * @param customLoginIdentifierID ID of custom login identifier (required) + * @param userCustomLoginIdentifierDeleteReq (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse userCustomLoginIdentifierDeleteWithHttpInfo(String userID, String customLoginIdentifierID, UserCustomLoginIdentifierDeleteReq userCustomLoginIdentifierDeleteReq) throws ApiException { + okhttp3.Call localVarCall = userCustomLoginIdentifierDeleteValidateBeforeCall(userID, customLoginIdentifierID, userCustomLoginIdentifierDeleteReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Delete a user's custom login identifier + * @param userID ID of user (required) + * @param customLoginIdentifierID ID of custom login identifier (required) + * @param userCustomLoginIdentifierDeleteReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call userCustomLoginIdentifierDeleteAsync(String userID, String customLoginIdentifierID, UserCustomLoginIdentifierDeleteReq userCustomLoginIdentifierDeleteReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userCustomLoginIdentifierDeleteValidateBeforeCall(userID, customLoginIdentifierID, userCustomLoginIdentifierDeleteReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userCustomLoginIdentifierGet + * @param userID ID of user (required) + * @param customLoginIdentifierID ID of custom login identifier (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User custom login identifier successfully retrieved -
0 Error -
+ */ + public okhttp3.Call userCustomLoginIdentifierGetCall(String userID, String customLoginIdentifierID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/users/{userID}/customLoginIdentifiers/{customLoginIdentifierID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "customLoginIdentifierID" + "}", localVarApiClient.escapeString(customLoginIdentifierID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userCustomLoginIdentifierGetValidateBeforeCall(String userID, String customLoginIdentifierID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userCustomLoginIdentifierGet(Async)"); + } + + // verify the required parameter 'customLoginIdentifierID' is set + if (customLoginIdentifierID == null) { + throw new ApiException("Missing the required parameter 'customLoginIdentifierID' when calling userCustomLoginIdentifierGet(Async)"); + } + + return userCustomLoginIdentifierGetCall(userID, customLoginIdentifierID, remoteAddress, userAgent, _callback); + + } + + /** + * + * Get a user's custom login identifier + * @param userID ID of user (required) + * @param customLoginIdentifierID ID of custom login identifier (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @return UserCustomLoginIdentifierGetRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User custom login identifier successfully retrieved -
0 Error -
+ */ + public UserCustomLoginIdentifierGetRsp userCustomLoginIdentifierGet(String userID, String customLoginIdentifierID, String remoteAddress, String userAgent) throws ApiException { + ApiResponse localVarResp = userCustomLoginIdentifierGetWithHttpInfo(userID, customLoginIdentifierID, remoteAddress, userAgent); + return localVarResp.getData(); + } + + /** + * + * Get a user's custom login identifier + * @param userID ID of user (required) + * @param customLoginIdentifierID ID of custom login identifier (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @return ApiResponse<UserCustomLoginIdentifierGetRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User custom login identifier successfully retrieved -
0 Error -
+ */ + public ApiResponse userCustomLoginIdentifierGetWithHttpInfo(String userID, String customLoginIdentifierID, String remoteAddress, String userAgent) throws ApiException { + okhttp3.Call localVarCall = userCustomLoginIdentifierGetValidateBeforeCall(userID, customLoginIdentifierID, remoteAddress, userAgent, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Get a user's custom login identifier + * @param userID ID of user (required) + * @param customLoginIdentifierID ID of custom login identifier (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User custom login identifier successfully retrieved -
0 Error -
+ */ + public okhttp3.Call userCustomLoginIdentifierGetAsync(String userID, String customLoginIdentifierID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userCustomLoginIdentifierGetValidateBeforeCall(userID, customLoginIdentifierID, remoteAddress, userAgent, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userDelete + * @param userID ID of user (required) + * @param userDeleteReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call userDeleteCall(String userID, UserDeleteReq userDeleteReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userDeleteReq; + + // create path and map variables + String localVarPath = "/v1/users/{userID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userDeleteValidateBeforeCall(String userID, UserDeleteReq userDeleteReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userDelete(Async)"); + } + + // verify the required parameter 'userDeleteReq' is set + if (userDeleteReq == null) { + throw new ApiException("Missing the required parameter 'userDeleteReq' when calling userDelete(Async)"); + } + + return userDeleteCall(userID, userDeleteReq, _callback); + + } + + /** + * + * Deletes a user + * @param userID ID of user (required) + * @param userDeleteReq (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp userDelete(String userID, UserDeleteReq userDeleteReq) throws ApiException { + ApiResponse localVarResp = userDeleteWithHttpInfo(userID, userDeleteReq); + return localVarResp.getData(); + } + + /** + * + * Deletes a user + * @param userID ID of user (required) + * @param userDeleteReq (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse userDeleteWithHttpInfo(String userID, UserDeleteReq userDeleteReq) throws ApiException { + okhttp3.Call localVarCall = userDeleteValidateBeforeCall(userID, userDeleteReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Deletes a user + * @param userID ID of user (required) + * @param userDeleteReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call userDeleteAsync(String userID, UserDeleteReq userDeleteReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userDeleteValidateBeforeCall(userID, userDeleteReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userDeviceList + * @param userID ID of user (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all devices -
+ */ + public okhttp3.Call userDeviceListCall(String userID, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/users/{userID}/devices" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userDeviceListValidateBeforeCall(String userID, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userDeviceList(Async)"); + } + + return userDeviceListCall(userID, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Provides all register devices for given user + * @param userID ID of user (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return UserDeviceListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all devices -
+ */ + public UserDeviceListRsp userDeviceList(String userID, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = userDeviceListWithHttpInfo(userID, remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Provides all register devices for given user + * @param userID ID of user (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<UserDeviceListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all devices -
+ */ + public ApiResponse userDeviceListWithHttpInfo(String userID, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = userDeviceListValidateBeforeCall(userID, remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Provides all register devices for given user + * @param userID ID of user (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all devices -
+ */ + public okhttp3.Call userDeviceListAsync(String userID, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userDeviceListValidateBeforeCall(userID, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userEmailCreate + * @param userID ID of user (required) + * @param userEmailCreateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User email found -
0 Error -
+ */ + public okhttp3.Call userEmailCreateCall(String userID, UserEmailCreateReq userEmailCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userEmailCreateReq; + + // create path and map variables + String localVarPath = "/v1/users/{userID}/emails" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userEmailCreateValidateBeforeCall(String userID, UserEmailCreateReq userEmailCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userEmailCreate(Async)"); + } + + // verify the required parameter 'userEmailCreateReq' is set + if (userEmailCreateReq == null) { + throw new ApiException("Missing the required parameter 'userEmailCreateReq' when calling userEmailCreate(Async)"); + } + + return userEmailCreateCall(userID, userEmailCreateReq, _callback); + + } + + /** + * + * Add an email to an existing user + * @param userID ID of user (required) + * @param userEmailCreateReq (required) + * @return UserEmailCreateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User email found -
0 Error -
+ */ + public UserEmailCreateRsp userEmailCreate(String userID, UserEmailCreateReq userEmailCreateReq) throws ApiException { + ApiResponse localVarResp = userEmailCreateWithHttpInfo(userID, userEmailCreateReq); + return localVarResp.getData(); + } + + /** + * + * Add an email to an existing user + * @param userID ID of user (required) + * @param userEmailCreateReq (required) + * @return ApiResponse<UserEmailCreateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User email found -
0 Error -
+ */ + public ApiResponse userEmailCreateWithHttpInfo(String userID, UserEmailCreateReq userEmailCreateReq) throws ApiException { + okhttp3.Call localVarCall = userEmailCreateValidateBeforeCall(userID, userEmailCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Add an email to an existing user + * @param userID ID of user (required) + * @param userEmailCreateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User email found -
0 Error -
+ */ + public okhttp3.Call userEmailCreateAsync(String userID, UserEmailCreateReq userEmailCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userEmailCreateValidateBeforeCall(userID, userEmailCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userEmailDelete + * @param userID ID of user (required) + * @param emailID ID of email (required) + * @param userEmailDeleteReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call userEmailDeleteCall(String userID, String emailID, UserEmailDeleteReq userEmailDeleteReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userEmailDeleteReq; + + // create path and map variables + String localVarPath = "/v1/users/{userID}/emails/{emailID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "emailID" + "}", localVarApiClient.escapeString(emailID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userEmailDeleteValidateBeforeCall(String userID, String emailID, UserEmailDeleteReq userEmailDeleteReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userEmailDelete(Async)"); + } + + // verify the required parameter 'emailID' is set + if (emailID == null) { + throw new ApiException("Missing the required parameter 'emailID' when calling userEmailDelete(Async)"); + } + + // verify the required parameter 'userEmailDeleteReq' is set + if (userEmailDeleteReq == null) { + throw new ApiException("Missing the required parameter 'userEmailDeleteReq' when calling userEmailDelete(Async)"); + } + + return userEmailDeleteCall(userID, emailID, userEmailDeleteReq, _callback); + + } + + /** + * + * Delete a user's email + * @param userID ID of user (required) + * @param emailID ID of email (required) + * @param userEmailDeleteReq (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp userEmailDelete(String userID, String emailID, UserEmailDeleteReq userEmailDeleteReq) throws ApiException { + ApiResponse localVarResp = userEmailDeleteWithHttpInfo(userID, emailID, userEmailDeleteReq); + return localVarResp.getData(); + } + + /** + * + * Delete a user's email + * @param userID ID of user (required) + * @param emailID ID of email (required) + * @param userEmailDeleteReq (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse userEmailDeleteWithHttpInfo(String userID, String emailID, UserEmailDeleteReq userEmailDeleteReq) throws ApiException { + okhttp3.Call localVarCall = userEmailDeleteValidateBeforeCall(userID, emailID, userEmailDeleteReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Delete a user's email + * @param userID ID of user (required) + * @param emailID ID of email (required) + * @param userEmailDeleteReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call userEmailDeleteAsync(String userID, String emailID, UserEmailDeleteReq userEmailDeleteReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userEmailDeleteValidateBeforeCall(userID, emailID, userEmailDeleteReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userEmailGet + * @param userID ID of user (required) + * @param emailID ID of email (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User email successfully created -
0 Error -
+ */ + public okhttp3.Call userEmailGetCall(String userID, String emailID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/users/{userID}/emails/{emailID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "emailID" + "}", localVarApiClient.escapeString(emailID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userEmailGetValidateBeforeCall(String userID, String emailID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userEmailGet(Async)"); + } + + // verify the required parameter 'emailID' is set + if (emailID == null) { + throw new ApiException("Missing the required parameter 'emailID' when calling userEmailGet(Async)"); + } + + return userEmailGetCall(userID, emailID, remoteAddress, userAgent, _callback); + + } + + /** + * + * Get a user's email + * @param userID ID of user (required) + * @param emailID ID of email (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @return UserEmailGetRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User email successfully created -
0 Error -
+ */ + public UserEmailGetRsp userEmailGet(String userID, String emailID, String remoteAddress, String userAgent) throws ApiException { + ApiResponse localVarResp = userEmailGetWithHttpInfo(userID, emailID, remoteAddress, userAgent); + return localVarResp.getData(); + } + + /** + * + * Get a user's email + * @param userID ID of user (required) + * @param emailID ID of email (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @return ApiResponse<UserEmailGetRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User email successfully created -
0 Error -
+ */ + public ApiResponse userEmailGetWithHttpInfo(String userID, String emailID, String remoteAddress, String userAgent) throws ApiException { + okhttp3.Call localVarCall = userEmailGetValidateBeforeCall(userID, emailID, remoteAddress, userAgent, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Get a user's email + * @param userID ID of user (required) + * @param emailID ID of email (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User email successfully created -
0 Error -
+ */ + public okhttp3.Call userEmailGetAsync(String userID, String emailID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userEmailGetValidateBeforeCall(userID, emailID, remoteAddress, userAgent, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userExists + * @param userExistsReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User existence check completed -
0 Error -
+ */ + public okhttp3.Call userExistsCall(UserExistsReq userExistsReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userExistsReq; + + // create path and map variables + String localVarPath = "/v1/users/exists"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userExistsValidateBeforeCall(UserExistsReq userExistsReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userExistsReq' is set + if (userExistsReq == null) { + throw new ApiException("Missing the required parameter 'userExistsReq' when calling userExists(Async)"); + } + + return userExistsCall(userExistsReq, _callback); + + } + + /** + * + * Checks if a confirmed user exists for provided login identifier + * @param userExistsReq (required) + * @return UserExistsRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User existence check completed -
0 Error -
+ */ + public UserExistsRsp userExists(UserExistsReq userExistsReq) throws ApiException { + ApiResponse localVarResp = userExistsWithHttpInfo(userExistsReq); + return localVarResp.getData(); + } + + /** + * + * Checks if a confirmed user exists for provided login identifier + * @param userExistsReq (required) + * @return ApiResponse<UserExistsRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User existence check completed -
0 Error -
+ */ + public ApiResponse userExistsWithHttpInfo(UserExistsReq userExistsReq) throws ApiException { + okhttp3.Call localVarCall = userExistsValidateBeforeCall(userExistsReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Checks if a confirmed user exists for provided login identifier + * @param userExistsReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User existence check completed -
0 Error -
+ */ + public okhttp3.Call userExistsAsync(UserExistsReq userExistsReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userExistsValidateBeforeCall(userExistsReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userGet + * @param userID ID of user (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User successfully retrieved -
0 Error -
+ */ + public okhttp3.Call userGetCall(String userID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/users/{userID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userGetValidateBeforeCall(String userID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userGet(Async)"); + } + + return userGetCall(userID, remoteAddress, userAgent, _callback); + + } + + /** + * + * Get a user by ID + * @param userID ID of user (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @return UserGetRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User successfully retrieved -
0 Error -
+ */ + public UserGetRsp userGet(String userID, String remoteAddress, String userAgent) throws ApiException { + ApiResponse localVarResp = userGetWithHttpInfo(userID, remoteAddress, userAgent); + return localVarResp.getData(); + } + + /** + * + * Get a user by ID + * @param userID ID of user (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @return ApiResponse<UserGetRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User successfully retrieved -
0 Error -
+ */ + public ApiResponse userGetWithHttpInfo(String userID, String remoteAddress, String userAgent) throws ApiException { + okhttp3.Call localVarCall = userGetValidateBeforeCall(userID, remoteAddress, userAgent, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Get a user by ID + * @param userID ID of user (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User successfully retrieved -
0 Error -
+ */ + public okhttp3.Call userGetAsync(String userID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userGetValidateBeforeCall(userID, remoteAddress, userAgent, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userList + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Users successfully retrieved -
0 Error -
+ */ + public okhttp3.Call userListCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/users"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userListValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + return userListCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Lists project users + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return UserListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Users successfully retrieved -
0 Error -
+ */ + public UserListRsp userList(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = userListWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Lists project users + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<UserListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Users successfully retrieved -
0 Error -
+ */ + public ApiResponse userListWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = userListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Lists project users + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Users successfully retrieved -
0 Error -
+ */ + public okhttp3.Call userListAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userPhoneNumberCreate + * @param userID ID of user (required) + * @param userPhoneNumberCreateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User phone number successfully added -
0 Error -
+ */ + public okhttp3.Call userPhoneNumberCreateCall(String userID, UserPhoneNumberCreateReq userPhoneNumberCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userPhoneNumberCreateReq; + + // create path and map variables + String localVarPath = "/v1/users/{userID}/phoneNumbers" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userPhoneNumberCreateValidateBeforeCall(String userID, UserPhoneNumberCreateReq userPhoneNumberCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userPhoneNumberCreate(Async)"); + } + + // verify the required parameter 'userPhoneNumberCreateReq' is set + if (userPhoneNumberCreateReq == null) { + throw new ApiException("Missing the required parameter 'userPhoneNumberCreateReq' when calling userPhoneNumberCreate(Async)"); + } + + return userPhoneNumberCreateCall(userID, userPhoneNumberCreateReq, _callback); + + } + + /** + * + * Add a phone number to an existing user + * @param userID ID of user (required) + * @param userPhoneNumberCreateReq (required) + * @return UserPhoneNumberCreateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User phone number successfully added -
0 Error -
+ */ + public UserPhoneNumberCreateRsp userPhoneNumberCreate(String userID, UserPhoneNumberCreateReq userPhoneNumberCreateReq) throws ApiException { + ApiResponse localVarResp = userPhoneNumberCreateWithHttpInfo(userID, userPhoneNumberCreateReq); + return localVarResp.getData(); + } + + /** + * + * Add a phone number to an existing user + * @param userID ID of user (required) + * @param userPhoneNumberCreateReq (required) + * @return ApiResponse<UserPhoneNumberCreateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User phone number successfully added -
0 Error -
+ */ + public ApiResponse userPhoneNumberCreateWithHttpInfo(String userID, UserPhoneNumberCreateReq userPhoneNumberCreateReq) throws ApiException { + okhttp3.Call localVarCall = userPhoneNumberCreateValidateBeforeCall(userID, userPhoneNumberCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Add a phone number to an existing user + * @param userID ID of user (required) + * @param userPhoneNumberCreateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User phone number successfully added -
0 Error -
+ */ + public okhttp3.Call userPhoneNumberCreateAsync(String userID, UserPhoneNumberCreateReq userPhoneNumberCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userPhoneNumberCreateValidateBeforeCall(userID, userPhoneNumberCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userPhoneNumberDelete + * @param userID ID of user (required) + * @param phoneNumberID ID of phone number (required) + * @param userPhoneNumberDeleteReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call userPhoneNumberDeleteCall(String userID, String phoneNumberID, UserPhoneNumberDeleteReq userPhoneNumberDeleteReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userPhoneNumberDeleteReq; + + // create path and map variables + String localVarPath = "/v1/users/{userID}/phoneNumbers/{phoneNumberID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "phoneNumberID" + "}", localVarApiClient.escapeString(phoneNumberID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userPhoneNumberDeleteValidateBeforeCall(String userID, String phoneNumberID, UserPhoneNumberDeleteReq userPhoneNumberDeleteReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userPhoneNumberDelete(Async)"); + } + + // verify the required parameter 'phoneNumberID' is set + if (phoneNumberID == null) { + throw new ApiException("Missing the required parameter 'phoneNumberID' when calling userPhoneNumberDelete(Async)"); + } + + // verify the required parameter 'userPhoneNumberDeleteReq' is set + if (userPhoneNumberDeleteReq == null) { + throw new ApiException("Missing the required parameter 'userPhoneNumberDeleteReq' when calling userPhoneNumberDelete(Async)"); + } + + return userPhoneNumberDeleteCall(userID, phoneNumberID, userPhoneNumberDeleteReq, _callback); + + } + + /** + * + * Delete a user's phone number + * @param userID ID of user (required) + * @param phoneNumberID ID of phone number (required) + * @param userPhoneNumberDeleteReq (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp userPhoneNumberDelete(String userID, String phoneNumberID, UserPhoneNumberDeleteReq userPhoneNumberDeleteReq) throws ApiException { + ApiResponse localVarResp = userPhoneNumberDeleteWithHttpInfo(userID, phoneNumberID, userPhoneNumberDeleteReq); + return localVarResp.getData(); + } + + /** + * + * Delete a user's phone number + * @param userID ID of user (required) + * @param phoneNumberID ID of phone number (required) + * @param userPhoneNumberDeleteReq (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse userPhoneNumberDeleteWithHttpInfo(String userID, String phoneNumberID, UserPhoneNumberDeleteReq userPhoneNumberDeleteReq) throws ApiException { + okhttp3.Call localVarCall = userPhoneNumberDeleteValidateBeforeCall(userID, phoneNumberID, userPhoneNumberDeleteReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Delete a user's phone number + * @param userID ID of user (required) + * @param phoneNumberID ID of phone number (required) + * @param userPhoneNumberDeleteReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call userPhoneNumberDeleteAsync(String userID, String phoneNumberID, UserPhoneNumberDeleteReq userPhoneNumberDeleteReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userPhoneNumberDeleteValidateBeforeCall(userID, phoneNumberID, userPhoneNumberDeleteReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userPhoneNumberGet + * @param userID ID of user (required) + * @param phoneNumberID ID of phone number (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User phone number found -
0 Error -
+ */ + public okhttp3.Call userPhoneNumberGetCall(String userID, String phoneNumberID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/users/{userID}/phoneNumbers/{phoneNumberID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "phoneNumberID" + "}", localVarApiClient.escapeString(phoneNumberID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userPhoneNumberGetValidateBeforeCall(String userID, String phoneNumberID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userPhoneNumberGet(Async)"); + } + + // verify the required parameter 'phoneNumberID' is set + if (phoneNumberID == null) { + throw new ApiException("Missing the required parameter 'phoneNumberID' when calling userPhoneNumberGet(Async)"); + } + + return userPhoneNumberGetCall(userID, phoneNumberID, remoteAddress, userAgent, _callback); + + } + + /** + * + * Get a user's phone number + * @param userID ID of user (required) + * @param phoneNumberID ID of phone number (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @return UserPhoneNumberGetRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User phone number found -
0 Error -
+ */ + public UserPhoneNumberGetRsp userPhoneNumberGet(String userID, String phoneNumberID, String remoteAddress, String userAgent) throws ApiException { + ApiResponse localVarResp = userPhoneNumberGetWithHttpInfo(userID, phoneNumberID, remoteAddress, userAgent); + return localVarResp.getData(); + } + + /** + * + * Get a user's phone number + * @param userID ID of user (required) + * @param phoneNumberID ID of phone number (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @return ApiResponse<UserPhoneNumberGetRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User phone number found -
0 Error -
+ */ + public ApiResponse userPhoneNumberGetWithHttpInfo(String userID, String phoneNumberID, String remoteAddress, String userAgent) throws ApiException { + okhttp3.Call localVarCall = userPhoneNumberGetValidateBeforeCall(userID, phoneNumberID, remoteAddress, userAgent, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Get a user's phone number + * @param userID ID of user (required) + * @param phoneNumberID ID of phone number (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User phone number found -
0 Error -
+ */ + public okhttp3.Call userPhoneNumberGetAsync(String userID, String phoneNumberID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userPhoneNumberGetValidateBeforeCall(userID, phoneNumberID, remoteAddress, userAgent, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userStatsList + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for user data -
+ */ + public okhttp3.Call userStatsListCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/users/stats"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + if (granularity != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userStatsListValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'granularity' is set + if (granularity == null) { + throw new ApiException("Missing the required parameter 'granularity' when calling userStatsList(Async)"); + } + + return userStatsListCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Provides aggregated user stats for project + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return UserStatsListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for user data -
+ */ + public UserStatsListRsp userStatsList(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = userStatsListWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Provides aggregated user stats for project + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<UserStatsListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for user data -
+ */ + public ApiResponse userStatsListWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = userStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Provides aggregated user stats for project + * @param granularity Data granularity (required) + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for user data -
+ */ + public okhttp3.Call userStatsListAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userUpdate + * @param userID ID of user (required) + * @param userUpdateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User successfully updated -
0 Error -
+ */ + public okhttp3.Call userUpdateCall(String userID, UserUpdateReq userUpdateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userUpdateReq; + + // create path and map variables + String localVarPath = "/v1/users/{userID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userUpdateValidateBeforeCall(String userID, UserUpdateReq userUpdateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userUpdate(Async)"); + } + + // verify the required parameter 'userUpdateReq' is set + if (userUpdateReq == null) { + throw new ApiException("Missing the required parameter 'userUpdateReq' when calling userUpdate(Async)"); + } + + return userUpdateCall(userID, userUpdateReq, _callback); + + } + + /** + * + * Updates a user + * @param userID ID of user (required) + * @param userUpdateReq (required) + * @return UserUpdateRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User successfully updated -
0 Error -
+ */ + public UserUpdateRsp userUpdate(String userID, UserUpdateReq userUpdateReq) throws ApiException { + ApiResponse localVarResp = userUpdateWithHttpInfo(userID, userUpdateReq); + return localVarResp.getData(); + } + + /** + * + * Updates a user + * @param userID ID of user (required) + * @param userUpdateReq (required) + * @return ApiResponse<UserUpdateRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User successfully updated -
0 Error -
+ */ + public ApiResponse userUpdateWithHttpInfo(String userID, UserUpdateReq userUpdateReq) throws ApiException { + okhttp3.Call localVarCall = userUpdateValidateBeforeCall(userID, userUpdateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Updates a user + * @param userID ID of user (required) + * @param userUpdateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User successfully updated -
0 Error -
+ */ + public okhttp3.Call userUpdateAsync(String userID, UserUpdateReq userUpdateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userUpdateValidateBeforeCall(userID, userUpdateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/ValidationApi.java b/src/main/java/com/corbado/generated/api/ValidationApi.java new file mode 100644 index 0000000..39a0577 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/ValidationApi.java @@ -0,0 +1,333 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.ValidateEmailReq; +import com.corbado.generated.model.ValidateEmailRsp; +import com.corbado.generated.model.ValidatePhoneNumberReq; +import com.corbado.generated.model.ValidatePhoneNumberRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ValidationApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ValidationApi() { + this(Configuration.getDefaultApiClient()); + } + + public ValidationApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for validateEmail + * @param validateEmailReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email validated -
0 Error -
+ */ + public okhttp3.Call validateEmailCall(ValidateEmailReq validateEmailReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = validateEmailReq; + + // create path and map variables + String localVarPath = "/v1/validate/email"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call validateEmailValidateBeforeCall(ValidateEmailReq validateEmailReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'validateEmailReq' is set + if (validateEmailReq == null) { + throw new ApiException("Missing the required parameter 'validateEmailReq' when calling validateEmail(Async)"); + } + + return validateEmailCall(validateEmailReq, _callback); + + } + + /** + * + * Validates email + * @param validateEmailReq (required) + * @return ValidateEmailRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email validated -
0 Error -
+ */ + public ValidateEmailRsp validateEmail(ValidateEmailReq validateEmailReq) throws ApiException { + ApiResponse localVarResp = validateEmailWithHttpInfo(validateEmailReq); + return localVarResp.getData(); + } + + /** + * + * Validates email + * @param validateEmailReq (required) + * @return ApiResponse<ValidateEmailRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email validated -
0 Error -
+ */ + public ApiResponse validateEmailWithHttpInfo(ValidateEmailReq validateEmailReq) throws ApiException { + okhttp3.Call localVarCall = validateEmailValidateBeforeCall(validateEmailReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Validates email + * @param validateEmailReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Email validated -
0 Error -
+ */ + public okhttp3.Call validateEmailAsync(ValidateEmailReq validateEmailReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = validateEmailValidateBeforeCall(validateEmailReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for validatePhoneNumber + * @param validatePhoneNumberReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Phone number validated -
0 Error -
+ */ + public okhttp3.Call validatePhoneNumberCall(ValidatePhoneNumberReq validatePhoneNumberReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = validatePhoneNumberReq; + + // create path and map variables + String localVarPath = "/v1/validate/phoneNumber"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call validatePhoneNumberValidateBeforeCall(ValidatePhoneNumberReq validatePhoneNumberReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'validatePhoneNumberReq' is set + if (validatePhoneNumberReq == null) { + throw new ApiException("Missing the required parameter 'validatePhoneNumberReq' when calling validatePhoneNumber(Async)"); + } + + return validatePhoneNumberCall(validatePhoneNumberReq, _callback); + + } + + /** + * + * Validates phone number + * @param validatePhoneNumberReq (required) + * @return ValidatePhoneNumberRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Phone number validated -
0 Error -
+ */ + public ValidatePhoneNumberRsp validatePhoneNumber(ValidatePhoneNumberReq validatePhoneNumberReq) throws ApiException { + ApiResponse localVarResp = validatePhoneNumberWithHttpInfo(validatePhoneNumberReq); + return localVarResp.getData(); + } + + /** + * + * Validates phone number + * @param validatePhoneNumberReq (required) + * @return ApiResponse<ValidatePhoneNumberRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Phone number validated -
0 Error -
+ */ + public ApiResponse validatePhoneNumberWithHttpInfo(ValidatePhoneNumberReq validatePhoneNumberReq) throws ApiException { + okhttp3.Call localVarCall = validatePhoneNumberValidateBeforeCall(validatePhoneNumberReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Validates phone number + * @param validatePhoneNumberReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Phone number validated -
0 Error -
+ */ + public okhttp3.Call validatePhoneNumberAsync(ValidatePhoneNumberReq validatePhoneNumberReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = validatePhoneNumberValidateBeforeCall(validatePhoneNumberReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/WebhookLogsApi.java b/src/main/java/com/corbado/generated/api/WebhookLogsApi.java new file mode 100644 index 0000000..cd038a1 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/WebhookLogsApi.java @@ -0,0 +1,241 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.WebhookLogsListRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class WebhookLogsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public WebhookLogsApi() { + this(Configuration.getDefaultApiClient()); + } + + public WebhookLogsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for webhookLogsList + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Webhook logs successfully retrieved -
0 Error -
+ */ + public okhttp3.Call webhookLogsListCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/webhookLogs"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (remoteAddress != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); + } + + if (userAgent != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call webhookLogsListValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + return webhookLogsListCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Lists webhook logs for given filters + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return WebhookLogsListRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Webhook logs successfully retrieved -
0 Error -
+ */ + public WebhookLogsListRsp webhookLogsList(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = webhookLogsListWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Lists webhook logs for given filters + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<WebhookLogsListRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Webhook logs successfully retrieved -
0 Error -
+ */ + public ApiResponse webhookLogsListWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = webhookLogsListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Lists webhook logs for given filters + * @param remoteAddress Client's remote address (optional) + * @param userAgent Client's user agent (optional) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Webhook logs successfully retrieved -
0 Error -
+ */ + public okhttp3.Call webhookLogsListAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = webhookLogsListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/invoker/ApiCallback.java b/src/main/java/com/corbado/generated/invoker/ApiCallback.java new file mode 100644 index 0000000..d94711a --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.invoker; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/src/main/java/com/corbado/generated/invoker/ApiClient.java b/src/main/java/com/corbado/generated/invoker/ApiClient.java new file mode 100644 index 0000000..b310bd3 --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/ApiClient.java @@ -0,0 +1,1592 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.invoker; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import com.corbado.generated.invoker.auth.Authentication; +import com.corbado.generated.invoker.auth.HttpBasicAuth; +import com.corbado.generated.invoker.auth.HttpBearerAuth; +import com.corbado.generated.invoker.auth.ApiKeyAuth; + +/** + *

ApiClient class.

+ */ +public class ApiClient { + + private String basePath = "https://backendapi.corbado.io"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "https://backendapi.corbado.io", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("basicAuth", new HttpBasicAuth()); + authentications.put("bearerAuth", new HttpBearerAuth("bearer")); + authentications.put("projectID", new ApiKeyAuth("header", "X-Corbado-ProjectID")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("basicAuth", new HttpBasicAuth()); + authentications.put("bearerAuth", new HttpBearerAuth("bearer")); + authentications.put("projectID", new ApiKeyAuth("header", "X-Corbado-ProjectID")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1.0.0/java"); + + authentications = new HashMap(); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g https://backendapi.corbado.io + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

Getter for the field keyManagers.

+ * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + *

Getter for the field dateFormat.

+ * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + *

Setter for the field dateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link com.corbado.generated.invoker.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + JSON.setDateFormat(dateFormat); + return this; + } + + /** + *

Set SqlDateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link com.corbado.generated.invoker.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + JSON.setSqlDateFormat(dateFormat); + return this; + } + + /** + *

Set OffsetDateTimeFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link com.corbado.generated.invoker.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

Set LocalDateFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link com.corbado.generated.invoker.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateFormat(dateFormat); + return this; + } + + /** + *

Set LenientOnJson.

+ * + * @param lenientOnJson a boolean + * @return a {@link com.corbado.generated.invoker.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + JSON.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + setBearerToken(() -> bearerToken); + } + + /** + * Helper method to set the supplier of access tokens for Bearer authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setBearerToken(Supplier tokenSupplier) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(tokenSupplier); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = JSON.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(o); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws com.corbado.generated.invoker.ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws com.corbado.generated.invoker.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws com.corbado.generated.invoker.ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws com.corbado.generated.invoker.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws com.corbado.generated.invoker.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws com.corbado.generated.invoker.ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object + */ + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object + */ + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentTypePure)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); + } + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws com.corbado.generated.invoker.ApiException If fails to update the parameters + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/src/main/java/com/corbado/generated/invoker/ApiException.java b/src/main/java/com/corbado/generated/invoker/ApiException.java new file mode 100644 index 0000000..3131669 --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/ApiException.java @@ -0,0 +1,167 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.invoker; + +import java.util.Map; +import java.util.List; + + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

+ */ + public ApiException() {} + + /** + *

Constructor for ApiException.

+ * + * @param throwable a {@link java.lang.Throwable} object + */ + public ApiException(Throwable throwable) { + super(throwable); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + */ + public ApiException(String message) { + super(message); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, Map> responseHeaders, String responseBody) { + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message a {@link java.lang.String} object + */ + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + /** + *

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/src/main/java/com/corbado/generated/invoker/ApiResponse.java b/src/main/java/com/corbado/generated/invoker/ApiResponse.java new file mode 100644 index 0000000..fcccace --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.invoker; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + *

Constructor for ApiResponse.

+ * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + *

Get the status code.

+ * + * @return the status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + *

Get the headers.

+ * + * @return a {@link java.util.Map} of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + *

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/src/main/java/com/corbado/generated/invoker/Configuration.java b/src/main/java/com/corbado/generated/invoker/Configuration.java new file mode 100644 index 0000000..dda21e3 --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/Configuration.java @@ -0,0 +1,41 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.invoker; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class Configuration { + public static final String VERSION = "1.0.0"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/src/main/java/com/corbado/generated/invoker/GzipRequestInterceptor.java b/src/main/java/com/corbado/generated/invoker/GzipRequestInterceptor.java new file mode 100644 index 0000000..3a57344 --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.invoker; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/src/main/java/com/corbado/generated/invoker/JSON.java b/src/main/java/com/corbado/generated/invoker/JSON.java new file mode 100644 index 0000000..a18c915 --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/JSON.java @@ -0,0 +1,606 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.invoker; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AndroidAppConfigDeleteReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AndroidAppConfigItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AndroidAppConfigListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AndroidAppConfigSaveReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AndroidAppConfigSaveRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AndroidAppConfigUpdateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AndroidAppConfigUpdateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AssociationTokenCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AssociationTokenCreateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AssociationTokenCreateRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AuthMethodsListReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AuthMethodsListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AuthMethodsListRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AuthTokenValidateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AuthTokenValidateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ClientInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.CustomLoginIdentifier.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.Email.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCode.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCodeGetRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCodeGetRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCodeSendReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCodeSendRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCodeSendRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCodeValidateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCodeValidateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLink.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinkGetRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinkGetRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinkSendReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinkSendRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinkSendRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinkValidateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinksDeleteReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinksValidateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailTemplateCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailTemplateCreateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailTemplateCreateRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailTemplateDeleteReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailValidationResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmptyReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ErrorRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ErrorRspAllOfError.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ErrorRspAllOfErrorValidation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ExampleGetRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.FullUser.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.GenericRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IOSAppConfigDeleteReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IOSAppConfigItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IOSAppConfigListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IOSAppConfigSaveReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IOSAppConfigSaveRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IOSAppConfigUpdateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IOSAppConfigUpdateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSession.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSessionGetRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSessionGetRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSessionListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSessionListRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSessionRevokeReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.Paging.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PhoneNumber.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PhoneNumberValidationResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectConfigGetRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectConfigSaveReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectConfigWebhookTestReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectConfigWebhookTestRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectConfigWebhookTestRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectSecretCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectSecretCreateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectSecretDeleteReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectSecretItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectSecretListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.RequestData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.RequestLog.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.RequestLogGetRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.RequestLogsListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.RequestLogsListRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionConfigGetRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionConfigUpdateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionTokenCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionTokenCreateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionTokenCreateRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionTokenVerifyReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionTokenVerifyRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionTokenVerifyRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsCodeSendReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsCodeSendRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsCodeSendRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsCodeValidateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsCodeValidateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsTemplateCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsTemplateCreateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsTemplateCreateRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsTemplateDeleteReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBackupState.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBackupStateGetRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBrowserDetailedStats.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBrowserDetailedStatsListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBrowserDetailedStatsListRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBrowserStats.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBrowserStatsListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBrowserStatsListRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingDetailedStats.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingDetailedStatsListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingDetailedStatsListRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingEnums.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingEnumsGetRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingOSDetailedStats.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingOSDetailedStatsListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingOSDetailedStatsListRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingOSStats.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingOSStatsListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingOSStatsListRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingRawListRow.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingRawListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingStats.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingStatsListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingStatsListRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.User.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserAuthLog.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserAuthLogListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserAuthLogListRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCreateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCreateRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCustomLoginIdentifierCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCustomLoginIdentifierCreateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCustomLoginIdentifierCreateRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCustomLoginIdentifierDeleteReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCustomLoginIdentifierGetRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCustomLoginIdentifierGetRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserDeleteReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserDevice.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserDeviceListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserEmail.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserEmailCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserEmailCreateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserEmailCreateRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserEmailDeleteReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserEmailGetRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserEmailGetRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserExistsReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserExistsRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserGetRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserListRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserPhoneNumber.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserPhoneNumberCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserPhoneNumberCreateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserPhoneNumberCreateRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserPhoneNumberDeleteReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserPhoneNumberGetRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserPhoneNumberGetRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserSocialAccount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserStats.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserStatsListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserStatsListRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserUpdateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserUpdateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserUsername.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ValidateEmailReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ValidateEmailRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ValidatePhoneNumberReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ValidatePhoneNumberRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ValidationEmail.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ValidationPhoneNumber.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnAssociateStartReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnAssociateStartRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnAuthenticateFinishRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnAuthenticateStartReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnAuthenticateStartRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnAuthenticateSuccess.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnAuthenticatorUpdateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnCredentialExistsReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnCredentialExistsRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnCredentialItemRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnCredentialListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnCredentialReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnCredentialRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnFinishReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnMediationStartReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnMediationStartRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnRegisterFinishRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnRegisterStartReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnRegisterStartRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingCreate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingCreateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingDeleteReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingGetRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingUpdateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingUpdateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnStatsAuthenticator.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnStatsAuthenticatorRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnStatsAuthenticatorRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnStatsType.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnStatsTypeRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnStatsTypeRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebhookLog.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebhookLogsListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebhookLogsListRspAllOfData.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/src/main/java/com/corbado/generated/invoker/Pair.java b/src/main/java/com/corbado/generated/invoker/Pair.java new file mode 100644 index 0000000..980d67b --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/Pair.java @@ -0,0 +1,57 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.invoker; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/src/main/java/com/corbado/generated/invoker/ProgressRequestBody.java b/src/main/java/com/corbado/generated/invoker/ProgressRequestBody.java new file mode 100644 index 0000000..8e2e582 --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.invoker; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/src/main/java/com/corbado/generated/invoker/ProgressResponseBody.java b/src/main/java/com/corbado/generated/invoker/ProgressResponseBody.java new file mode 100644 index 0000000..ac7e811 --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.invoker; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java b/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java new file mode 100644 index 0000000..684b89f --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java @@ -0,0 +1,59 @@ +package com.corbado.generated.invoker; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/src/main/java/com/corbado/generated/invoker/ServerVariable.java b/src/main/java/com/corbado/generated/invoker/ServerVariable.java new file mode 100644 index 0000000..8e8412a --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/ServerVariable.java @@ -0,0 +1,24 @@ +package com.corbado.generated.invoker; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/src/main/java/com/corbado/generated/invoker/StringUtil.java b/src/main/java/com/corbado/generated/invoker/StringUtil.java new file mode 100644 index 0000000..48de038 --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.invoker; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java b/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java new file mode 100644 index 0000000..c5e1662 --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.invoker.auth; + +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/src/main/java/com/corbado/generated/invoker/auth/Authentication.java b/src/main/java/com/corbado/generated/invoker/auth/Authentication.java new file mode 100644 index 0000000..b840d7e --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.invoker.auth; + +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/src/main/java/com/corbado/generated/invoker/auth/HttpBasicAuth.java b/src/main/java/com/corbado/generated/invoker/auth/HttpBasicAuth.java new file mode 100644 index 0000000..c04cc0c --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/auth/HttpBasicAuth.java @@ -0,0 +1,55 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.invoker.auth; + +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java b/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java new file mode 100644 index 0000000..b3333f8 --- /dev/null +++ b/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java @@ -0,0 +1,75 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.invoker.auth; + +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.Pair; + +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java b/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000..51c6a83 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java @@ -0,0 +1,146 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import com.corbado.generated.invoker.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/src/main/java/com/corbado/generated/model/AndroidAppConfigDeleteReq.java b/src/main/java/com/corbado/generated/model/AndroidAppConfigDeleteReq.java new file mode 100644 index 0000000..1eef03e --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AndroidAppConfigDeleteReq.java @@ -0,0 +1,237 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AndroidAppConfigDeleteReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class AndroidAppConfigDeleteReq { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public AndroidAppConfigDeleteReq() { + } + + public AndroidAppConfigDeleteReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public AndroidAppConfigDeleteReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AndroidAppConfigDeleteReq androidAppConfigDeleteReq = (AndroidAppConfigDeleteReq) o; + return Objects.equals(this.requestID, androidAppConfigDeleteReq.requestID) && + Objects.equals(this.clientInfo, androidAppConfigDeleteReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AndroidAppConfigDeleteReq {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AndroidAppConfigDeleteReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AndroidAppConfigDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AndroidAppConfigDeleteReq is not found in the empty JSON string", AndroidAppConfigDeleteReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AndroidAppConfigDeleteReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidAppConfigDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AndroidAppConfigDeleteReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AndroidAppConfigDeleteReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AndroidAppConfigDeleteReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AndroidAppConfigDeleteReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AndroidAppConfigDeleteReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AndroidAppConfigDeleteReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of AndroidAppConfigDeleteReq + * @throws IOException if the JSON string is invalid with respect to AndroidAppConfigDeleteReq + */ + public static AndroidAppConfigDeleteReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AndroidAppConfigDeleteReq.class); + } + + /** + * Convert an instance of AndroidAppConfigDeleteReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AndroidAppConfigItem.java b/src/main/java/com/corbado/generated/model/AndroidAppConfigItem.java new file mode 100644 index 0000000..70b1260 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AndroidAppConfigItem.java @@ -0,0 +1,394 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AndroidAppConfigItem + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class AndroidAppConfigItem { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; + @SerializedName(SERIALIZED_NAME_PROJECT_I_D) + private String projectID; + + public static final String SERIALIZED_NAME_PACKAGE_NAME = "packageName"; + @SerializedName(SERIALIZED_NAME_PACKAGE_NAME) + private String packageName; + + public static final String SERIALIZED_NAME_FINGERPRINT = "fingerprint"; + @SerializedName(SERIALIZED_NAME_FINGERPRINT) + private String fingerprint; + + public static final String SERIALIZED_NAME_BASE64_U_R_L = "base64URL"; + @SerializedName(SERIALIZED_NAME_BASE64_U_R_L) + private String base64URL; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public AndroidAppConfigItem() { + } + + public AndroidAppConfigItem id(String id) { + this.id = id; + return this; + } + + /** + * ID of Android app configuration + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public AndroidAppConfigItem projectID(String projectID) { + this.projectID = projectID; + return this; + } + + /** + * ID of project + * @return projectID + **/ + @javax.annotation.Nonnull + public String getProjectID() { + return projectID; + } + + public void setProjectID(String projectID) { + this.projectID = projectID; + } + + + public AndroidAppConfigItem packageName(String packageName) { + this.packageName = packageName; + return this; + } + + /** + * Get packageName + * @return packageName + **/ + @javax.annotation.Nonnull + public String getPackageName() { + return packageName; + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + + public AndroidAppConfigItem fingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + /** + * Get fingerprint + * @return fingerprint + **/ + @javax.annotation.Nonnull + public String getFingerprint() { + return fingerprint; + } + + public void setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + } + + + public AndroidAppConfigItem base64URL(String base64URL) { + this.base64URL = base64URL; + return this; + } + + /** + * Get base64URL + * @return base64URL + **/ + @javax.annotation.Nonnull + public String getBase64URL() { + return base64URL; + } + + public void setBase64URL(String base64URL) { + this.base64URL = base64URL; + } + + + public AndroidAppConfigItem created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public AndroidAppConfigItem updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AndroidAppConfigItem androidAppConfigItem = (AndroidAppConfigItem) o; + return Objects.equals(this.id, androidAppConfigItem.id) && + Objects.equals(this.projectID, androidAppConfigItem.projectID) && + Objects.equals(this.packageName, androidAppConfigItem.packageName) && + Objects.equals(this.fingerprint, androidAppConfigItem.fingerprint) && + Objects.equals(this.base64URL, androidAppConfigItem.base64URL) && + Objects.equals(this.created, androidAppConfigItem.created) && + Objects.equals(this.updated, androidAppConfigItem.updated); + } + + @Override + public int hashCode() { + return Objects.hash(id, projectID, packageName, fingerprint, base64URL, created, updated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AndroidAppConfigItem {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); + sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); + sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n"); + sb.append(" base64URL: ").append(toIndentedString(base64URL)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("projectID"); + openapiFields.add("packageName"); + openapiFields.add("fingerprint"); + openapiFields.add("base64URL"); + openapiFields.add("created"); + openapiFields.add("updated"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("projectID"); + openapiRequiredFields.add("packageName"); + openapiRequiredFields.add("fingerprint"); + openapiRequiredFields.add("base64URL"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AndroidAppConfigItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AndroidAppConfigItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AndroidAppConfigItem is not found in the empty JSON string", AndroidAppConfigItem.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AndroidAppConfigItem.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidAppConfigItem` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AndroidAppConfigItem.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("projectID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); + } + if (!jsonObj.get("packageName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").toString())); + } + if (!jsonObj.get("fingerprint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fingerprint").toString())); + } + if (!jsonObj.get("base64URL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `base64URL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("base64URL").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AndroidAppConfigItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AndroidAppConfigItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AndroidAppConfigItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AndroidAppConfigItem value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AndroidAppConfigItem read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AndroidAppConfigItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of AndroidAppConfigItem + * @throws IOException if the JSON string is invalid with respect to AndroidAppConfigItem + */ + public static AndroidAppConfigItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AndroidAppConfigItem.class); + } + + /** + * Convert an instance of AndroidAppConfigItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AndroidAppConfigListRsp.java b/src/main/java/com/corbado/generated/model/AndroidAppConfigListRsp.java new file mode 100644 index 0000000..77e61f8 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AndroidAppConfigListRsp.java @@ -0,0 +1,378 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.AndroidAppConfigItem; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AndroidAppConfigListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class AndroidAppConfigListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_ROWS = "rows"; + @SerializedName(SERIALIZED_NAME_ROWS) + private List rows = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public AndroidAppConfigListRsp() { + } + + public AndroidAppConfigListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public AndroidAppConfigListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public AndroidAppConfigListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public AndroidAppConfigListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public AndroidAppConfigListRsp rows(List rows) { + this.rows = rows; + return this; + } + + public AndroidAppConfigListRsp addRowsItem(AndroidAppConfigItem rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * @return rows + **/ + @javax.annotation.Nonnull + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + + public AndroidAppConfigListRsp paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AndroidAppConfigListRsp androidAppConfigListRsp = (AndroidAppConfigListRsp) o; + return Objects.equals(this.httpStatusCode, androidAppConfigListRsp.httpStatusCode) && + Objects.equals(this.message, androidAppConfigListRsp.message) && + Objects.equals(this.requestData, androidAppConfigListRsp.requestData) && + Objects.equals(this.runtime, androidAppConfigListRsp.runtime) && + Objects.equals(this.rows, androidAppConfigListRsp.rows) && + Objects.equals(this.paging, androidAppConfigListRsp.paging); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, rows, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AndroidAppConfigListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("rows"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("rows"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AndroidAppConfigListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AndroidAppConfigListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AndroidAppConfigListRsp is not found in the empty JSON string", AndroidAppConfigListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AndroidAppConfigListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidAppConfigListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AndroidAppConfigListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rows` to be an array in the JSON string but got `%s`", jsonObj.get("rows").toString())); + } + + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + // validate the required field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + AndroidAppConfigItem.validateJsonElement(jsonArrayrows.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AndroidAppConfigListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AndroidAppConfigListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AndroidAppConfigListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AndroidAppConfigListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AndroidAppConfigListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AndroidAppConfigListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of AndroidAppConfigListRsp + * @throws IOException if the JSON string is invalid with respect to AndroidAppConfigListRsp + */ + public static AndroidAppConfigListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AndroidAppConfigListRsp.class); + } + + /** + * Convert an instance of AndroidAppConfigListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AndroidAppConfigSaveReq.java b/src/main/java/com/corbado/generated/model/AndroidAppConfigSaveReq.java new file mode 100644 index 0000000..2660fbd --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AndroidAppConfigSaveReq.java @@ -0,0 +1,304 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AndroidAppConfigSaveReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class AndroidAppConfigSaveReq { + public static final String SERIALIZED_NAME_PACKAGE_NAME = "packageName"; + @SerializedName(SERIALIZED_NAME_PACKAGE_NAME) + private String packageName; + + public static final String SERIALIZED_NAME_FINGERPRINT = "fingerprint"; + @SerializedName(SERIALIZED_NAME_FINGERPRINT) + private String fingerprint; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public AndroidAppConfigSaveReq() { + } + + public AndroidAppConfigSaveReq packageName(String packageName) { + this.packageName = packageName; + return this; + } + + /** + * Get packageName + * @return packageName + **/ + @javax.annotation.Nonnull + public String getPackageName() { + return packageName; + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + + public AndroidAppConfigSaveReq fingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + /** + * Get fingerprint + * @return fingerprint + **/ + @javax.annotation.Nonnull + public String getFingerprint() { + return fingerprint; + } + + public void setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + } + + + public AndroidAppConfigSaveReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public AndroidAppConfigSaveReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AndroidAppConfigSaveReq androidAppConfigSaveReq = (AndroidAppConfigSaveReq) o; + return Objects.equals(this.packageName, androidAppConfigSaveReq.packageName) && + Objects.equals(this.fingerprint, androidAppConfigSaveReq.fingerprint) && + Objects.equals(this.requestID, androidAppConfigSaveReq.requestID) && + Objects.equals(this.clientInfo, androidAppConfigSaveReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(packageName, fingerprint, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AndroidAppConfigSaveReq {\n"); + sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); + sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("packageName"); + openapiFields.add("fingerprint"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("packageName"); + openapiRequiredFields.add("fingerprint"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AndroidAppConfigSaveReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AndroidAppConfigSaveReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AndroidAppConfigSaveReq is not found in the empty JSON string", AndroidAppConfigSaveReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AndroidAppConfigSaveReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidAppConfigSaveReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AndroidAppConfigSaveReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("packageName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").toString())); + } + if (!jsonObj.get("fingerprint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fingerprint").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AndroidAppConfigSaveReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AndroidAppConfigSaveReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AndroidAppConfigSaveReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AndroidAppConfigSaveReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AndroidAppConfigSaveReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AndroidAppConfigSaveReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of AndroidAppConfigSaveReq + * @throws IOException if the JSON string is invalid with respect to AndroidAppConfigSaveReq + */ + public static AndroidAppConfigSaveReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AndroidAppConfigSaveReq.class); + } + + /** + * Convert an instance of AndroidAppConfigSaveReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AndroidAppConfigSaveRsp.java b/src/main/java/com/corbado/generated/model/AndroidAppConfigSaveRsp.java new file mode 100644 index 0000000..d6c9670 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AndroidAppConfigSaveRsp.java @@ -0,0 +1,510 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AndroidAppConfigSaveRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class AndroidAppConfigSaveRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; + @SerializedName(SERIALIZED_NAME_PROJECT_I_D) + private String projectID; + + public static final String SERIALIZED_NAME_PACKAGE_NAME = "packageName"; + @SerializedName(SERIALIZED_NAME_PACKAGE_NAME) + private String packageName; + + public static final String SERIALIZED_NAME_FINGERPRINT = "fingerprint"; + @SerializedName(SERIALIZED_NAME_FINGERPRINT) + private String fingerprint; + + public static final String SERIALIZED_NAME_BASE64_U_R_L = "base64URL"; + @SerializedName(SERIALIZED_NAME_BASE64_U_R_L) + private String base64URL; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public AndroidAppConfigSaveRsp() { + } + + public AndroidAppConfigSaveRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public AndroidAppConfigSaveRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public AndroidAppConfigSaveRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public AndroidAppConfigSaveRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public AndroidAppConfigSaveRsp id(String id) { + this.id = id; + return this; + } + + /** + * ID of Android app configuration + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public AndroidAppConfigSaveRsp projectID(String projectID) { + this.projectID = projectID; + return this; + } + + /** + * ID of project + * @return projectID + **/ + @javax.annotation.Nonnull + public String getProjectID() { + return projectID; + } + + public void setProjectID(String projectID) { + this.projectID = projectID; + } + + + public AndroidAppConfigSaveRsp packageName(String packageName) { + this.packageName = packageName; + return this; + } + + /** + * Get packageName + * @return packageName + **/ + @javax.annotation.Nonnull + public String getPackageName() { + return packageName; + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + + public AndroidAppConfigSaveRsp fingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + /** + * Get fingerprint + * @return fingerprint + **/ + @javax.annotation.Nonnull + public String getFingerprint() { + return fingerprint; + } + + public void setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + } + + + public AndroidAppConfigSaveRsp base64URL(String base64URL) { + this.base64URL = base64URL; + return this; + } + + /** + * Get base64URL + * @return base64URL + **/ + @javax.annotation.Nonnull + public String getBase64URL() { + return base64URL; + } + + public void setBase64URL(String base64URL) { + this.base64URL = base64URL; + } + + + public AndroidAppConfigSaveRsp created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public AndroidAppConfigSaveRsp updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AndroidAppConfigSaveRsp androidAppConfigSaveRsp = (AndroidAppConfigSaveRsp) o; + return Objects.equals(this.httpStatusCode, androidAppConfigSaveRsp.httpStatusCode) && + Objects.equals(this.message, androidAppConfigSaveRsp.message) && + Objects.equals(this.requestData, androidAppConfigSaveRsp.requestData) && + Objects.equals(this.runtime, androidAppConfigSaveRsp.runtime) && + Objects.equals(this.id, androidAppConfigSaveRsp.id) && + Objects.equals(this.projectID, androidAppConfigSaveRsp.projectID) && + Objects.equals(this.packageName, androidAppConfigSaveRsp.packageName) && + Objects.equals(this.fingerprint, androidAppConfigSaveRsp.fingerprint) && + Objects.equals(this.base64URL, androidAppConfigSaveRsp.base64URL) && + Objects.equals(this.created, androidAppConfigSaveRsp.created) && + Objects.equals(this.updated, androidAppConfigSaveRsp.updated); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, id, projectID, packageName, fingerprint, base64URL, created, updated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AndroidAppConfigSaveRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); + sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); + sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n"); + sb.append(" base64URL: ").append(toIndentedString(base64URL)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("id"); + openapiFields.add("projectID"); + openapiFields.add("packageName"); + openapiFields.add("fingerprint"); + openapiFields.add("base64URL"); + openapiFields.add("created"); + openapiFields.add("updated"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("projectID"); + openapiRequiredFields.add("packageName"); + openapiRequiredFields.add("fingerprint"); + openapiRequiredFields.add("base64URL"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AndroidAppConfigSaveRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AndroidAppConfigSaveRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AndroidAppConfigSaveRsp is not found in the empty JSON string", AndroidAppConfigSaveRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AndroidAppConfigSaveRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidAppConfigSaveRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AndroidAppConfigSaveRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("projectID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); + } + if (!jsonObj.get("packageName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").toString())); + } + if (!jsonObj.get("fingerprint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fingerprint").toString())); + } + if (!jsonObj.get("base64URL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `base64URL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("base64URL").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AndroidAppConfigSaveRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AndroidAppConfigSaveRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AndroidAppConfigSaveRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AndroidAppConfigSaveRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AndroidAppConfigSaveRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AndroidAppConfigSaveRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of AndroidAppConfigSaveRsp + * @throws IOException if the JSON string is invalid with respect to AndroidAppConfigSaveRsp + */ + public static AndroidAppConfigSaveRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AndroidAppConfigSaveRsp.class); + } + + /** + * Convert an instance of AndroidAppConfigSaveRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateReq.java b/src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateReq.java new file mode 100644 index 0000000..980f839 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateReq.java @@ -0,0 +1,304 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AndroidAppConfigUpdateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class AndroidAppConfigUpdateReq { + public static final String SERIALIZED_NAME_PACKAGE_NAME = "packageName"; + @SerializedName(SERIALIZED_NAME_PACKAGE_NAME) + private String packageName; + + public static final String SERIALIZED_NAME_FINGERPRINT = "fingerprint"; + @SerializedName(SERIALIZED_NAME_FINGERPRINT) + private String fingerprint; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public AndroidAppConfigUpdateReq() { + } + + public AndroidAppConfigUpdateReq packageName(String packageName) { + this.packageName = packageName; + return this; + } + + /** + * Get packageName + * @return packageName + **/ + @javax.annotation.Nonnull + public String getPackageName() { + return packageName; + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + + public AndroidAppConfigUpdateReq fingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + /** + * Get fingerprint + * @return fingerprint + **/ + @javax.annotation.Nonnull + public String getFingerprint() { + return fingerprint; + } + + public void setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + } + + + public AndroidAppConfigUpdateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public AndroidAppConfigUpdateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AndroidAppConfigUpdateReq androidAppConfigUpdateReq = (AndroidAppConfigUpdateReq) o; + return Objects.equals(this.packageName, androidAppConfigUpdateReq.packageName) && + Objects.equals(this.fingerprint, androidAppConfigUpdateReq.fingerprint) && + Objects.equals(this.requestID, androidAppConfigUpdateReq.requestID) && + Objects.equals(this.clientInfo, androidAppConfigUpdateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(packageName, fingerprint, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AndroidAppConfigUpdateReq {\n"); + sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); + sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("packageName"); + openapiFields.add("fingerprint"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("packageName"); + openapiRequiredFields.add("fingerprint"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AndroidAppConfigUpdateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AndroidAppConfigUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AndroidAppConfigUpdateReq is not found in the empty JSON string", AndroidAppConfigUpdateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AndroidAppConfigUpdateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidAppConfigUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AndroidAppConfigUpdateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("packageName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").toString())); + } + if (!jsonObj.get("fingerprint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fingerprint").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AndroidAppConfigUpdateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AndroidAppConfigUpdateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AndroidAppConfigUpdateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AndroidAppConfigUpdateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AndroidAppConfigUpdateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AndroidAppConfigUpdateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of AndroidAppConfigUpdateReq + * @throws IOException if the JSON string is invalid with respect to AndroidAppConfigUpdateReq + */ + public static AndroidAppConfigUpdateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AndroidAppConfigUpdateReq.class); + } + + /** + * Convert an instance of AndroidAppConfigUpdateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateRsp.java b/src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateRsp.java new file mode 100644 index 0000000..82b2b1b --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateRsp.java @@ -0,0 +1,510 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AndroidAppConfigUpdateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class AndroidAppConfigUpdateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; + @SerializedName(SERIALIZED_NAME_PROJECT_I_D) + private String projectID; + + public static final String SERIALIZED_NAME_PACKAGE_NAME = "packageName"; + @SerializedName(SERIALIZED_NAME_PACKAGE_NAME) + private String packageName; + + public static final String SERIALIZED_NAME_FINGERPRINT = "fingerprint"; + @SerializedName(SERIALIZED_NAME_FINGERPRINT) + private String fingerprint; + + public static final String SERIALIZED_NAME_BASE64_U_R_L = "base64URL"; + @SerializedName(SERIALIZED_NAME_BASE64_U_R_L) + private String base64URL; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public AndroidAppConfigUpdateRsp() { + } + + public AndroidAppConfigUpdateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public AndroidAppConfigUpdateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public AndroidAppConfigUpdateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public AndroidAppConfigUpdateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public AndroidAppConfigUpdateRsp id(String id) { + this.id = id; + return this; + } + + /** + * ID of Android app configuration + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public AndroidAppConfigUpdateRsp projectID(String projectID) { + this.projectID = projectID; + return this; + } + + /** + * ID of project + * @return projectID + **/ + @javax.annotation.Nonnull + public String getProjectID() { + return projectID; + } + + public void setProjectID(String projectID) { + this.projectID = projectID; + } + + + public AndroidAppConfigUpdateRsp packageName(String packageName) { + this.packageName = packageName; + return this; + } + + /** + * Get packageName + * @return packageName + **/ + @javax.annotation.Nonnull + public String getPackageName() { + return packageName; + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + + public AndroidAppConfigUpdateRsp fingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + /** + * Get fingerprint + * @return fingerprint + **/ + @javax.annotation.Nonnull + public String getFingerprint() { + return fingerprint; + } + + public void setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + } + + + public AndroidAppConfigUpdateRsp base64URL(String base64URL) { + this.base64URL = base64URL; + return this; + } + + /** + * Get base64URL + * @return base64URL + **/ + @javax.annotation.Nonnull + public String getBase64URL() { + return base64URL; + } + + public void setBase64URL(String base64URL) { + this.base64URL = base64URL; + } + + + public AndroidAppConfigUpdateRsp created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public AndroidAppConfigUpdateRsp updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AndroidAppConfigUpdateRsp androidAppConfigUpdateRsp = (AndroidAppConfigUpdateRsp) o; + return Objects.equals(this.httpStatusCode, androidAppConfigUpdateRsp.httpStatusCode) && + Objects.equals(this.message, androidAppConfigUpdateRsp.message) && + Objects.equals(this.requestData, androidAppConfigUpdateRsp.requestData) && + Objects.equals(this.runtime, androidAppConfigUpdateRsp.runtime) && + Objects.equals(this.id, androidAppConfigUpdateRsp.id) && + Objects.equals(this.projectID, androidAppConfigUpdateRsp.projectID) && + Objects.equals(this.packageName, androidAppConfigUpdateRsp.packageName) && + Objects.equals(this.fingerprint, androidAppConfigUpdateRsp.fingerprint) && + Objects.equals(this.base64URL, androidAppConfigUpdateRsp.base64URL) && + Objects.equals(this.created, androidAppConfigUpdateRsp.created) && + Objects.equals(this.updated, androidAppConfigUpdateRsp.updated); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, id, projectID, packageName, fingerprint, base64URL, created, updated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AndroidAppConfigUpdateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); + sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); + sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n"); + sb.append(" base64URL: ").append(toIndentedString(base64URL)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("id"); + openapiFields.add("projectID"); + openapiFields.add("packageName"); + openapiFields.add("fingerprint"); + openapiFields.add("base64URL"); + openapiFields.add("created"); + openapiFields.add("updated"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("projectID"); + openapiRequiredFields.add("packageName"); + openapiRequiredFields.add("fingerprint"); + openapiRequiredFields.add("base64URL"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AndroidAppConfigUpdateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AndroidAppConfigUpdateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AndroidAppConfigUpdateRsp is not found in the empty JSON string", AndroidAppConfigUpdateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AndroidAppConfigUpdateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidAppConfigUpdateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AndroidAppConfigUpdateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("projectID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); + } + if (!jsonObj.get("packageName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").toString())); + } + if (!jsonObj.get("fingerprint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fingerprint").toString())); + } + if (!jsonObj.get("base64URL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `base64URL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("base64URL").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AndroidAppConfigUpdateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AndroidAppConfigUpdateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AndroidAppConfigUpdateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AndroidAppConfigUpdateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AndroidAppConfigUpdateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AndroidAppConfigUpdateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of AndroidAppConfigUpdateRsp + * @throws IOException if the JSON string is invalid with respect to AndroidAppConfigUpdateRsp + */ + public static AndroidAppConfigUpdateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AndroidAppConfigUpdateRsp.class); + } + + /** + * Convert an instance of AndroidAppConfigUpdateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AppType.java b/src/main/java/com/corbado/generated/model/AppType.java new file mode 100644 index 0000000..57f9c80 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AppType.java @@ -0,0 +1,80 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Application type + */ +@JsonAdapter(AppType.Adapter.class) +public enum AppType { + + EMPTY("empty"), + + WEB("web"), + + NATIVE("native"); + + private String value; + + AppType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AppType fromValue(String value) { + for (AppType b : AppType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AppType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AppType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AppType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AppType.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AssociationTokenCreateReq.java b/src/main/java/com/corbado/generated/model/AssociationTokenCreateReq.java new file mode 100644 index 0000000..6075eeb --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AssociationTokenCreateReq.java @@ -0,0 +1,303 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.corbado.generated.model.LoginIdentifierType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AssociationTokenCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class AssociationTokenCreateReq { + public static final String SERIALIZED_NAME_LOGIN_IDENTIFIER = "loginIdentifier"; + @SerializedName(SERIALIZED_NAME_LOGIN_IDENTIFIER) + private String loginIdentifier; + + public static final String SERIALIZED_NAME_LOGIN_IDENTIFIER_TYPE = "loginIdentifierType"; + @SerializedName(SERIALIZED_NAME_LOGIN_IDENTIFIER_TYPE) + private LoginIdentifierType loginIdentifierType; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public AssociationTokenCreateReq() { + } + + public AssociationTokenCreateReq loginIdentifier(String loginIdentifier) { + this.loginIdentifier = loginIdentifier; + return this; + } + + /** + * Get loginIdentifier + * @return loginIdentifier + **/ + @javax.annotation.Nonnull + public String getLoginIdentifier() { + return loginIdentifier; + } + + public void setLoginIdentifier(String loginIdentifier) { + this.loginIdentifier = loginIdentifier; + } + + + public AssociationTokenCreateReq loginIdentifierType(LoginIdentifierType loginIdentifierType) { + this.loginIdentifierType = loginIdentifierType; + return this; + } + + /** + * Get loginIdentifierType + * @return loginIdentifierType + **/ + @javax.annotation.Nonnull + public LoginIdentifierType getLoginIdentifierType() { + return loginIdentifierType; + } + + public void setLoginIdentifierType(LoginIdentifierType loginIdentifierType) { + this.loginIdentifierType = loginIdentifierType; + } + + + public AssociationTokenCreateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public AssociationTokenCreateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nonnull + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssociationTokenCreateReq associationTokenCreateReq = (AssociationTokenCreateReq) o; + return Objects.equals(this.loginIdentifier, associationTokenCreateReq.loginIdentifier) && + Objects.equals(this.loginIdentifierType, associationTokenCreateReq.loginIdentifierType) && + Objects.equals(this.requestID, associationTokenCreateReq.requestID) && + Objects.equals(this.clientInfo, associationTokenCreateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(loginIdentifier, loginIdentifierType, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssociationTokenCreateReq {\n"); + sb.append(" loginIdentifier: ").append(toIndentedString(loginIdentifier)).append("\n"); + sb.append(" loginIdentifierType: ").append(toIndentedString(loginIdentifierType)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("loginIdentifier"); + openapiFields.add("loginIdentifierType"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("loginIdentifier"); + openapiRequiredFields.add("loginIdentifierType"); + openapiRequiredFields.add("clientInfo"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssociationTokenCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AssociationTokenCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AssociationTokenCreateReq is not found in the empty JSON string", AssociationTokenCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AssociationTokenCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssociationTokenCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AssociationTokenCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("loginIdentifier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loginIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginIdentifier").toString())); + } + // validate the required field `loginIdentifierType` + LoginIdentifierType.validateJsonElement(jsonObj.get("loginIdentifierType")); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the required field `clientInfo` + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssociationTokenCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssociationTokenCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssociationTokenCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssociationTokenCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssociationTokenCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssociationTokenCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssociationTokenCreateReq + * @throws IOException if the JSON string is invalid with respect to AssociationTokenCreateReq + */ + public static AssociationTokenCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssociationTokenCreateReq.class); + } + + /** + * Convert an instance of AssociationTokenCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AssociationTokenCreateRsp.java b/src/main/java/com/corbado/generated/model/AssociationTokenCreateRsp.java new file mode 100644 index 0000000..363e262 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AssociationTokenCreateRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.AssociationTokenCreateRspAllOfData; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AssociationTokenCreateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class AssociationTokenCreateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private AssociationTokenCreateRspAllOfData data; + + public AssociationTokenCreateRsp() { + } + + public AssociationTokenCreateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public AssociationTokenCreateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public AssociationTokenCreateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public AssociationTokenCreateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public AssociationTokenCreateRsp data(AssociationTokenCreateRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public AssociationTokenCreateRspAllOfData getData() { + return data; + } + + public void setData(AssociationTokenCreateRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssociationTokenCreateRsp associationTokenCreateRsp = (AssociationTokenCreateRsp) o; + return Objects.equals(this.httpStatusCode, associationTokenCreateRsp.httpStatusCode) && + Objects.equals(this.message, associationTokenCreateRsp.message) && + Objects.equals(this.requestData, associationTokenCreateRsp.requestData) && + Objects.equals(this.runtime, associationTokenCreateRsp.runtime) && + Objects.equals(this.data, associationTokenCreateRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssociationTokenCreateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssociationTokenCreateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AssociationTokenCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AssociationTokenCreateRsp is not found in the empty JSON string", AssociationTokenCreateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AssociationTokenCreateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssociationTokenCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AssociationTokenCreateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + AssociationTokenCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssociationTokenCreateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssociationTokenCreateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssociationTokenCreateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssociationTokenCreateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssociationTokenCreateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssociationTokenCreateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssociationTokenCreateRsp + * @throws IOException if the JSON string is invalid with respect to AssociationTokenCreateRsp + */ + public static AssociationTokenCreateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssociationTokenCreateRsp.class); + } + + /** + * Convert an instance of AssociationTokenCreateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AssociationTokenCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/AssociationTokenCreateRspAllOfData.java new file mode 100644 index 0000000..894c17f --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AssociationTokenCreateRspAllOfData.java @@ -0,0 +1,235 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AssociationTokenCreateRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class AssociationTokenCreateRspAllOfData { + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + private String token; + + public static final String SERIALIZED_NAME_REJECTION_REASON = "rejectionReason"; + @SerializedName(SERIALIZED_NAME_REJECTION_REASON) + private String rejectionReason; + + public AssociationTokenCreateRspAllOfData() { + } + + public AssociationTokenCreateRspAllOfData token(String token) { + this.token = token; + return this; + } + + /** + * Get token + * @return token + **/ + @javax.annotation.Nullable + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + + public AssociationTokenCreateRspAllOfData rejectionReason(String rejectionReason) { + this.rejectionReason = rejectionReason; + return this; + } + + /** + * Get rejectionReason + * @return rejectionReason + **/ + @javax.annotation.Nullable + public String getRejectionReason() { + return rejectionReason; + } + + public void setRejectionReason(String rejectionReason) { + this.rejectionReason = rejectionReason; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssociationTokenCreateRspAllOfData associationTokenCreateRspAllOfData = (AssociationTokenCreateRspAllOfData) o; + return Objects.equals(this.token, associationTokenCreateRspAllOfData.token) && + Objects.equals(this.rejectionReason, associationTokenCreateRspAllOfData.rejectionReason); + } + + @Override + public int hashCode() { + return Objects.hash(token, rejectionReason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssociationTokenCreateRspAllOfData {\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" rejectionReason: ").append(toIndentedString(rejectionReason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("token"); + openapiFields.add("rejectionReason"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AssociationTokenCreateRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AssociationTokenCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AssociationTokenCreateRspAllOfData is not found in the empty JSON string", AssociationTokenCreateRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AssociationTokenCreateRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssociationTokenCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("token") != null && !jsonObj.get("token").isJsonNull()) && !jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + if ((jsonObj.get("rejectionReason") != null && !jsonObj.get("rejectionReason").isJsonNull()) && !jsonObj.get("rejectionReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rejectionReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rejectionReason").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssociationTokenCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssociationTokenCreateRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssociationTokenCreateRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssociationTokenCreateRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssociationTokenCreateRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssociationTokenCreateRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssociationTokenCreateRspAllOfData + * @throws IOException if the JSON string is invalid with respect to AssociationTokenCreateRspAllOfData + */ + public static AssociationTokenCreateRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssociationTokenCreateRspAllOfData.class); + } + + /** + * Convert an instance of AssociationTokenCreateRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AuthMethod.java b/src/main/java/com/corbado/generated/model/AuthMethod.java new file mode 100644 index 0000000..187870b --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AuthMethod.java @@ -0,0 +1,82 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Authentication methods + */ +@JsonAdapter(AuthMethod.Adapter.class) +public enum AuthMethod { + + EMAIL("email"), + + PHONE_NUMBER("phone_number"), + + WEBAUTHN("webauthn"), + + PASSWORD("password"); + + private String value; + + AuthMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AuthMethod fromValue(String value) { + for (AuthMethod b : AuthMethod.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AuthMethod enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AuthMethod read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AuthMethod.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AuthMethod.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AuthMethodsListReq.java b/src/main/java/com/corbado/generated/model/AuthMethodsListReq.java new file mode 100644 index 0000000..623dce7 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AuthMethodsListReq.java @@ -0,0 +1,273 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AuthMethodsListReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class AuthMethodsListReq { + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public AuthMethodsListReq() { + } + + public AuthMethodsListReq username(String username) { + this.username = username; + return this; + } + + /** + * Client's username + * @return username + **/ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + public AuthMethodsListReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public AuthMethodsListReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nonnull + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthMethodsListReq authMethodsListReq = (AuthMethodsListReq) o; + return Objects.equals(this.username, authMethodsListReq.username) && + Objects.equals(this.requestID, authMethodsListReq.requestID) && + Objects.equals(this.clientInfo, authMethodsListReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(username, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthMethodsListReq {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("username"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("clientInfo"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AuthMethodsListReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthMethodsListReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthMethodsListReq is not found in the empty JSON string", AuthMethodsListReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AuthMethodsListReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthMethodsListReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AuthMethodsListReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the required field `clientInfo` + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuthMethodsListReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthMethodsListReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthMethodsListReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AuthMethodsListReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AuthMethodsListReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthMethodsListReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthMethodsListReq + * @throws IOException if the JSON string is invalid with respect to AuthMethodsListReq + */ + public static AuthMethodsListReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthMethodsListReq.class); + } + + /** + * Convert an instance of AuthMethodsListReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AuthMethodsListRsp.java b/src/main/java/com/corbado/generated/model/AuthMethodsListRsp.java new file mode 100644 index 0000000..c6627c0 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AuthMethodsListRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.AuthMethodsListRspAllOfData; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AuthMethodsListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class AuthMethodsListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private AuthMethodsListRspAllOfData data; + + public AuthMethodsListRsp() { + } + + public AuthMethodsListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public AuthMethodsListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public AuthMethodsListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public AuthMethodsListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public AuthMethodsListRsp data(AuthMethodsListRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public AuthMethodsListRspAllOfData getData() { + return data; + } + + public void setData(AuthMethodsListRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthMethodsListRsp authMethodsListRsp = (AuthMethodsListRsp) o; + return Objects.equals(this.httpStatusCode, authMethodsListRsp.httpStatusCode) && + Objects.equals(this.message, authMethodsListRsp.message) && + Objects.equals(this.requestData, authMethodsListRsp.requestData) && + Objects.equals(this.runtime, authMethodsListRsp.runtime) && + Objects.equals(this.data, authMethodsListRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthMethodsListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AuthMethodsListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthMethodsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthMethodsListRsp is not found in the empty JSON string", AuthMethodsListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AuthMethodsListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthMethodsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AuthMethodsListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + AuthMethodsListRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuthMethodsListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthMethodsListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthMethodsListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AuthMethodsListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AuthMethodsListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthMethodsListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthMethodsListRsp + * @throws IOException if the JSON string is invalid with respect to AuthMethodsListRsp + */ + public static AuthMethodsListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthMethodsListRsp.class); + } + + /** + * Convert an instance of AuthMethodsListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AuthMethodsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/AuthMethodsListRspAllOfData.java new file mode 100644 index 0000000..d0ff59a --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AuthMethodsListRspAllOfData.java @@ -0,0 +1,299 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.AuthMethod; +import com.corbado.generated.model.Paging; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AuthMethodsListRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class AuthMethodsListRspAllOfData { + public static final String SERIALIZED_NAME_SELECT_METHODS = "selectMethods"; + @SerializedName(SERIALIZED_NAME_SELECT_METHODS) + private List selectMethods = new ArrayList<>(); + + public static final String SERIALIZED_NAME_POSSIBLE_METHODS = "possibleMethods"; + @SerializedName(SERIALIZED_NAME_POSSIBLE_METHODS) + private List possibleMethods = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public AuthMethodsListRspAllOfData() { + } + + public AuthMethodsListRspAllOfData selectMethods(List selectMethods) { + this.selectMethods = selectMethods; + return this; + } + + public AuthMethodsListRspAllOfData addSelectMethodsItem(AuthMethod selectMethodsItem) { + if (this.selectMethods == null) { + this.selectMethods = new ArrayList<>(); + } + this.selectMethods.add(selectMethodsItem); + return this; + } + + /** + * Get selectMethods + * @return selectMethods + **/ + @javax.annotation.Nonnull + public List getSelectMethods() { + return selectMethods; + } + + public void setSelectMethods(List selectMethods) { + this.selectMethods = selectMethods; + } + + + public AuthMethodsListRspAllOfData possibleMethods(List possibleMethods) { + this.possibleMethods = possibleMethods; + return this; + } + + public AuthMethodsListRspAllOfData addPossibleMethodsItem(AuthMethod possibleMethodsItem) { + if (this.possibleMethods == null) { + this.possibleMethods = new ArrayList<>(); + } + this.possibleMethods.add(possibleMethodsItem); + return this; + } + + /** + * Get possibleMethods + * @return possibleMethods + **/ + @javax.annotation.Nonnull + public List getPossibleMethods() { + return possibleMethods; + } + + public void setPossibleMethods(List possibleMethods) { + this.possibleMethods = possibleMethods; + } + + + public AuthMethodsListRspAllOfData paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthMethodsListRspAllOfData authMethodsListRspAllOfData = (AuthMethodsListRspAllOfData) o; + return Objects.equals(this.selectMethods, authMethodsListRspAllOfData.selectMethods) && + Objects.equals(this.possibleMethods, authMethodsListRspAllOfData.possibleMethods) && + Objects.equals(this.paging, authMethodsListRspAllOfData.paging); + } + + @Override + public int hashCode() { + return Objects.hash(selectMethods, possibleMethods, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthMethodsListRspAllOfData {\n"); + sb.append(" selectMethods: ").append(toIndentedString(selectMethods)).append("\n"); + sb.append(" possibleMethods: ").append(toIndentedString(possibleMethods)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("selectMethods"); + openapiFields.add("possibleMethods"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("selectMethods"); + openapiRequiredFields.add("possibleMethods"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AuthMethodsListRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthMethodsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthMethodsListRspAllOfData is not found in the empty JSON string", AuthMethodsListRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AuthMethodsListRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthMethodsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AuthMethodsListRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("selectMethods") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("selectMethods").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `selectMethods` to be an array in the JSON string but got `%s`", jsonObj.get("selectMethods").toString())); + } + // ensure the required json array is present + if (jsonObj.get("possibleMethods") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("possibleMethods").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `possibleMethods` to be an array in the JSON string but got `%s`", jsonObj.get("possibleMethods").toString())); + } + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuthMethodsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthMethodsListRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthMethodsListRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AuthMethodsListRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AuthMethodsListRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthMethodsListRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthMethodsListRspAllOfData + * @throws IOException if the JSON string is invalid with respect to AuthMethodsListRspAllOfData + */ + public static AuthMethodsListRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthMethodsListRspAllOfData.class); + } + + /** + * Convert an instance of AuthMethodsListRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AuthTokenValidateReq.java b/src/main/java/com/corbado/generated/model/AuthTokenValidateReq.java new file mode 100644 index 0000000..a861ce3 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AuthTokenValidateReq.java @@ -0,0 +1,273 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AuthTokenValidateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class AuthTokenValidateReq { + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + private String token; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public AuthTokenValidateReq() { + } + + public AuthTokenValidateReq token(String token) { + this.token = token; + return this; + } + + /** + * Get token + * @return token + **/ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + + public AuthTokenValidateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public AuthTokenValidateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nonnull + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthTokenValidateReq authTokenValidateReq = (AuthTokenValidateReq) o; + return Objects.equals(this.token, authTokenValidateReq.token) && + Objects.equals(this.requestID, authTokenValidateReq.requestID) && + Objects.equals(this.clientInfo, authTokenValidateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(token, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthTokenValidateReq {\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("token"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("token"); + openapiRequiredFields.add("clientInfo"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AuthTokenValidateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthTokenValidateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthTokenValidateReq is not found in the empty JSON string", AuthTokenValidateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AuthTokenValidateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthTokenValidateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AuthTokenValidateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the required field `clientInfo` + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuthTokenValidateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthTokenValidateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthTokenValidateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AuthTokenValidateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AuthTokenValidateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthTokenValidateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthTokenValidateReq + * @throws IOException if the JSON string is invalid with respect to AuthTokenValidateReq + */ + public static AuthTokenValidateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthTokenValidateReq.class); + } + + /** + * Convert an instance of AuthTokenValidateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AuthTokenValidateRsp.java b/src/main/java/com/corbado/generated/model/AuthTokenValidateRsp.java new file mode 100644 index 0000000..cab43c7 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AuthTokenValidateRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.SessionTokenVerifyRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AuthTokenValidateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class AuthTokenValidateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private SessionTokenVerifyRspAllOfData data; + + public AuthTokenValidateRsp() { + } + + public AuthTokenValidateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public AuthTokenValidateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public AuthTokenValidateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public AuthTokenValidateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public AuthTokenValidateRsp data(SessionTokenVerifyRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public SessionTokenVerifyRspAllOfData getData() { + return data; + } + + public void setData(SessionTokenVerifyRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthTokenValidateRsp authTokenValidateRsp = (AuthTokenValidateRsp) o; + return Objects.equals(this.httpStatusCode, authTokenValidateRsp.httpStatusCode) && + Objects.equals(this.message, authTokenValidateRsp.message) && + Objects.equals(this.requestData, authTokenValidateRsp.requestData) && + Objects.equals(this.runtime, authTokenValidateRsp.runtime) && + Objects.equals(this.data, authTokenValidateRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthTokenValidateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AuthTokenValidateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthTokenValidateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthTokenValidateRsp is not found in the empty JSON string", AuthTokenValidateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AuthTokenValidateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthTokenValidateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AuthTokenValidateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + SessionTokenVerifyRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuthTokenValidateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthTokenValidateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthTokenValidateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AuthTokenValidateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AuthTokenValidateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthTokenValidateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthTokenValidateRsp + * @throws IOException if the JSON string is invalid with respect to AuthTokenValidateRsp + */ + public static AuthTokenValidateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthTokenValidateRsp.class); + } + + /** + * Convert an instance of AuthTokenValidateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ClientInfo.java b/src/main/java/com/corbado/generated/model/ClientInfo.java new file mode 100644 index 0000000..21e68e4 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ClientInfo.java @@ -0,0 +1,244 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ClientInfo + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ClientInfo { + public static final String SERIALIZED_NAME_REMOTE_ADDRESS = "remoteAddress"; + @SerializedName(SERIALIZED_NAME_REMOTE_ADDRESS) + private String remoteAddress; + + public static final String SERIALIZED_NAME_USER_AGENT = "userAgent"; + @SerializedName(SERIALIZED_NAME_USER_AGENT) + private String userAgent; + + public ClientInfo() { + } + + public ClientInfo remoteAddress(String remoteAddress) { + this.remoteAddress = remoteAddress; + return this; + } + + /** + * client's IP address + * @return remoteAddress + **/ + @javax.annotation.Nonnull + public String getRemoteAddress() { + return remoteAddress; + } + + public void setRemoteAddress(String remoteAddress) { + this.remoteAddress = remoteAddress; + } + + + public ClientInfo userAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + * client's User Agent + * @return userAgent + **/ + @javax.annotation.Nonnull + public String getUserAgent() { + return userAgent; + } + + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientInfo clientInfo = (ClientInfo) o; + return Objects.equals(this.remoteAddress, clientInfo.remoteAddress) && + Objects.equals(this.userAgent, clientInfo.userAgent); + } + + @Override + public int hashCode() { + return Objects.hash(remoteAddress, userAgent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClientInfo {\n"); + sb.append(" remoteAddress: ").append(toIndentedString(remoteAddress)).append("\n"); + sb.append(" userAgent: ").append(toIndentedString(userAgent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("remoteAddress"); + openapiFields.add("userAgent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("remoteAddress"); + openapiRequiredFields.add("userAgent"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ClientInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ClientInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ClientInfo is not found in the empty JSON string", ClientInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ClientInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClientInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ClientInfo.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("remoteAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `remoteAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remoteAddress").toString())); + } + if (!jsonObj.get("userAgent").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userAgent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userAgent").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ClientInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClientInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClientInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ClientInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ClientInfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ClientInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClientInfo + * @throws IOException if the JSON string is invalid with respect to ClientInfo + */ + public static ClientInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClientInfo.class); + } + + /** + * Convert an instance of ClientInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/CustomLoginIdentifier.java b/src/main/java/com/corbado/generated/model/CustomLoginIdentifier.java new file mode 100644 index 0000000..73fe5a4 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/CustomLoginIdentifier.java @@ -0,0 +1,333 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * CustomLoginIdentifier + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class CustomLoginIdentifier { + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + private String ID; + + public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER) + private String identifier; + + public static final String SERIALIZED_NAME_ADDITIONAL_DATA = "additionalData"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_DATA) + private String additionalData; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public CustomLoginIdentifier() { + } + + public CustomLoginIdentifier ID(String ID) { + this.ID = ID; + return this; + } + + /** + * ID of the phone number + * @return ID + **/ + @javax.annotation.Nonnull + public String getID() { + return ID; + } + + public void setID(String ID) { + this.ID = ID; + } + + + public CustomLoginIdentifier identifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get identifier + * @return identifier + **/ + @javax.annotation.Nonnull + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + + public CustomLoginIdentifier additionalData(String additionalData) { + this.additionalData = additionalData; + return this; + } + + /** + * Get additionalData + * @return additionalData + **/ + @javax.annotation.Nullable + public String getAdditionalData() { + return additionalData; + } + + public void setAdditionalData(String additionalData) { + this.additionalData = additionalData; + } + + + public CustomLoginIdentifier created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public CustomLoginIdentifier updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomLoginIdentifier customLoginIdentifier = (CustomLoginIdentifier) o; + return Objects.equals(this.ID, customLoginIdentifier.ID) && + Objects.equals(this.identifier, customLoginIdentifier.identifier) && + Objects.equals(this.additionalData, customLoginIdentifier.additionalData) && + Objects.equals(this.created, customLoginIdentifier.created) && + Objects.equals(this.updated, customLoginIdentifier.updated); + } + + @Override + public int hashCode() { + return Objects.hash(ID, identifier, additionalData, created, updated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomLoginIdentifier {\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append(" additionalData: ").append(toIndentedString(additionalData)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ID"); + openapiFields.add("identifier"); + openapiFields.add("additionalData"); + openapiFields.add("created"); + openapiFields.add("updated"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ID"); + openapiRequiredFields.add("identifier"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CustomLoginIdentifier + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CustomLoginIdentifier.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CustomLoginIdentifier is not found in the empty JSON string", CustomLoginIdentifier.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CustomLoginIdentifier.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CustomLoginIdentifier` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CustomLoginIdentifier.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (!jsonObj.get("identifier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifier").toString())); + } + if ((jsonObj.get("additionalData") != null && !jsonObj.get("additionalData").isJsonNull()) && !jsonObj.get("additionalData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `additionalData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalData").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CustomLoginIdentifier.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CustomLoginIdentifier' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CustomLoginIdentifier.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CustomLoginIdentifier value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CustomLoginIdentifier read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CustomLoginIdentifier given an JSON string + * + * @param jsonString JSON string + * @return An instance of CustomLoginIdentifier + * @throws IOException if the JSON string is invalid with respect to CustomLoginIdentifier + */ + public static CustomLoginIdentifier fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CustomLoginIdentifier.class); + } + + /** + * Convert an instance of CustomLoginIdentifier to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/Email.java b/src/main/java/com/corbado/generated/model/Email.java new file mode 100644 index 0000000..a42f6a6 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/Email.java @@ -0,0 +1,363 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Status; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * Email + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class Email { + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + private String ID; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public static final String SERIALIZED_NAME_DELETED = "deleted"; + @SerializedName(SERIALIZED_NAME_DELETED) + private String deleted; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Status status; + + public Email() { + } + + public Email ID(String ID) { + this.ID = ID; + return this; + } + + /** + * ID of the email + * @return ID + **/ + @javax.annotation.Nonnull + public String getID() { + return ID; + } + + public void setID(String ID) { + this.ID = ID; + } + + + public Email email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public Email created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public Email updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + public Email deleted(String deleted) { + this.deleted = deleted; + return this; + } + + /** + * Timestamp of when the entity was deleted in yyyy-MM-dd'T'HH:mm:ss format + * @return deleted + **/ + @javax.annotation.Nullable + public String getDeleted() { + return deleted; + } + + public void setDeleted(String deleted) { + this.deleted = deleted; + } + + + public Email status(Status status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Status getStatus() { + return status; + } + + public void setStatus(Status status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Email email = (Email) o; + return Objects.equals(this.ID, email.ID) && + Objects.equals(this.email, email.email) && + Objects.equals(this.created, email.created) && + Objects.equals(this.updated, email.updated) && + Objects.equals(this.deleted, email.deleted) && + Objects.equals(this.status, email.status); + } + + @Override + public int hashCode() { + return Objects.hash(ID, email, created, updated, deleted, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Email {\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append(" deleted: ").append(toIndentedString(deleted)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ID"); + openapiFields.add("email"); + openapiFields.add("created"); + openapiFields.add("updated"); + openapiFields.add("deleted"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ID"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Email + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Email.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Email is not found in the empty JSON string", Email.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Email.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Email` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Email.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + if ((jsonObj.get("deleted") != null && !jsonObj.get("deleted").isJsonNull()) && !jsonObj.get("deleted").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deleted` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deleted").toString())); + } + // validate the required field `status` + Status.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Email.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Email' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Email.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Email value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Email read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Email given an JSON string + * + * @param jsonString JSON string + * @return An instance of Email + * @throws IOException if the JSON string is invalid with respect to Email + */ + public static Email fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Email.class); + } + + /** + * Convert an instance of Email to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailCode.java b/src/main/java/com/corbado/generated/model/EmailCode.java new file mode 100644 index 0000000..6d9532d --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailCode.java @@ -0,0 +1,477 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailCode + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailCode { + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + private String ID; + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; + @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) + private String userFullName; + + public static final String SERIALIZED_NAME_ADDITIONAL_PAYLOAD = "additionalPayload"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_PAYLOAD) + private String additionalPayload; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + /** + * status values of an email OTP + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACTIVE("active"), + + CONFIRMED("confirmed"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public EmailCode() { + } + + public EmailCode ID(String ID) { + this.ID = ID; + return this; + } + + /** + * ID of the email OTP + * @return ID + **/ + @javax.annotation.Nonnull + public String getID() { + return ID; + } + + public void setID(String ID) { + this.ID = ID; + } + + + public EmailCode userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + **/ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public EmailCode email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public EmailCode userFullName(String userFullName) { + this.userFullName = userFullName; + return this; + } + + /** + * Get userFullName + * @return userFullName + **/ + @javax.annotation.Nullable + public String getUserFullName() { + return userFullName; + } + + public void setUserFullName(String userFullName) { + this.userFullName = userFullName; + } + + + public EmailCode additionalPayload(String additionalPayload) { + this.additionalPayload = additionalPayload; + return this; + } + + /** + * Additional payload in JSON format + * @return additionalPayload + **/ + @javax.annotation.Nonnull + public String getAdditionalPayload() { + return additionalPayload; + } + + public void setAdditionalPayload(String additionalPayload) { + this.additionalPayload = additionalPayload; + } + + + public EmailCode created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public EmailCode updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + public EmailCode status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * status values of an email OTP + * @return status + **/ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailCode emailCode = (EmailCode) o; + return Objects.equals(this.ID, emailCode.ID) && + Objects.equals(this.userID, emailCode.userID) && + Objects.equals(this.email, emailCode.email) && + Objects.equals(this.userFullName, emailCode.userFullName) && + Objects.equals(this.additionalPayload, emailCode.additionalPayload) && + Objects.equals(this.created, emailCode.created) && + Objects.equals(this.updated, emailCode.updated) && + Objects.equals(this.status, emailCode.status); + } + + @Override + public int hashCode() { + return Objects.hash(ID, userID, email, userFullName, additionalPayload, created, updated, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailCode {\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); + sb.append(" additionalPayload: ").append(toIndentedString(additionalPayload)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ID"); + openapiFields.add("userID"); + openapiFields.add("email"); + openapiFields.add("userFullName"); + openapiFields.add("additionalPayload"); + openapiFields.add("created"); + openapiFields.add("updated"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ID"); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("additionalPayload"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailCode + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailCode.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCode is not found in the empty JSON string", EmailCode.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailCode.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCode` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailCode.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); + } + if (!jsonObj.get("additionalPayload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `additionalPayload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalPayload").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailCode.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailCode' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailCode.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailCode value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailCode read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailCode given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailCode + * @throws IOException if the JSON string is invalid with respect to EmailCode + */ + public static EmailCode fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailCode.class); + } + + /** + * Convert an instance of EmailCode to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailCodeGetRsp.java b/src/main/java/com/corbado/generated/model/EmailCodeGetRsp.java new file mode 100644 index 0000000..3591572 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailCodeGetRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.EmailCodeGetRspAllOfData; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailCodeGetRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailCodeGetRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private EmailCodeGetRspAllOfData data; + + public EmailCodeGetRsp() { + } + + public EmailCodeGetRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public EmailCodeGetRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public EmailCodeGetRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public EmailCodeGetRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public EmailCodeGetRsp data(EmailCodeGetRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public EmailCodeGetRspAllOfData getData() { + return data; + } + + public void setData(EmailCodeGetRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailCodeGetRsp emailCodeGetRsp = (EmailCodeGetRsp) o; + return Objects.equals(this.httpStatusCode, emailCodeGetRsp.httpStatusCode) && + Objects.equals(this.message, emailCodeGetRsp.message) && + Objects.equals(this.requestData, emailCodeGetRsp.requestData) && + Objects.equals(this.runtime, emailCodeGetRsp.runtime) && + Objects.equals(this.data, emailCodeGetRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailCodeGetRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailCodeGetRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailCodeGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCodeGetRsp is not found in the empty JSON string", EmailCodeGetRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailCodeGetRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCodeGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailCodeGetRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + EmailCodeGetRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailCodeGetRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailCodeGetRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailCodeGetRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailCodeGetRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailCodeGetRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailCodeGetRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailCodeGetRsp + * @throws IOException if the JSON string is invalid with respect to EmailCodeGetRsp + */ + public static EmailCodeGetRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailCodeGetRsp.class); + } + + /** + * Convert an instance of EmailCodeGetRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailCodeGetRspAllOfData.java b/src/main/java/com/corbado/generated/model/EmailCodeGetRspAllOfData.java new file mode 100644 index 0000000..479c43c --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailCodeGetRspAllOfData.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.EmailCode; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailCodeGetRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailCodeGetRspAllOfData { + public static final String SERIALIZED_NAME_EMAIL_CODE = "emailCode"; + @SerializedName(SERIALIZED_NAME_EMAIL_CODE) + private EmailCode emailCode; + + public EmailCodeGetRspAllOfData() { + } + + public EmailCodeGetRspAllOfData emailCode(EmailCode emailCode) { + this.emailCode = emailCode; + return this; + } + + /** + * Get emailCode + * @return emailCode + **/ + @javax.annotation.Nonnull + public EmailCode getEmailCode() { + return emailCode; + } + + public void setEmailCode(EmailCode emailCode) { + this.emailCode = emailCode; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailCodeGetRspAllOfData emailCodeGetRspAllOfData = (EmailCodeGetRspAllOfData) o; + return Objects.equals(this.emailCode, emailCodeGetRspAllOfData.emailCode); + } + + @Override + public int hashCode() { + return Objects.hash(emailCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailCodeGetRspAllOfData {\n"); + sb.append(" emailCode: ").append(toIndentedString(emailCode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("emailCode"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("emailCode"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailCodeGetRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailCodeGetRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCodeGetRspAllOfData is not found in the empty JSON string", EmailCodeGetRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailCodeGetRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCodeGetRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailCodeGetRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `emailCode` + EmailCode.validateJsonElement(jsonObj.get("emailCode")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailCodeGetRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailCodeGetRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailCodeGetRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailCodeGetRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailCodeGetRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailCodeGetRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailCodeGetRspAllOfData + * @throws IOException if the JSON string is invalid with respect to EmailCodeGetRspAllOfData + */ + public static EmailCodeGetRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailCodeGetRspAllOfData.class); + } + + /** + * Convert an instance of EmailCodeGetRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailCodeSendReq.java b/src/main/java/com/corbado/generated/model/EmailCodeSendReq.java new file mode 100644 index 0000000..9c7eb91 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailCodeSendReq.java @@ -0,0 +1,417 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailCodeSendReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailCodeSendReq { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_CREATE = "create"; + @SerializedName(SERIALIZED_NAME_CREATE) + private Boolean create; + + public static final String SERIALIZED_NAME_TOKEN_LIFETIME = "tokenLifetime"; + @SerializedName(SERIALIZED_NAME_TOKEN_LIFETIME) + private String tokenLifetime; + + public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; + @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) + private String userFullName; + + public static final String SERIALIZED_NAME_TEMPLATE_NAME = "templateName"; + @SerializedName(SERIALIZED_NAME_TEMPLATE_NAME) + private String templateName; + + public static final String SERIALIZED_NAME_ADDITIONAL_PAYLOAD = "additionalPayload"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_PAYLOAD) + private String additionalPayload; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public EmailCodeSendReq() { + } + + public EmailCodeSendReq email(String email) { + this.email = email; + return this; + } + + /** + * Recipient email address + * @return email + **/ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public EmailCodeSendReq create(Boolean create) { + this.create = create; + return this; + } + + /** + * Defines if user email should be created if not found + * @return create + **/ + @javax.annotation.Nonnull + public Boolean getCreate() { + return create; + } + + public void setCreate(Boolean create) { + this.create = create; + } + + + public EmailCodeSendReq tokenLifetime(String tokenLifetime) { + this.tokenLifetime = tokenLifetime; + return this; + } + + /** + * Defines the lifetime of the token that needs to be validated + * @return tokenLifetime + **/ + @javax.annotation.Nullable + public String getTokenLifetime() { + return tokenLifetime; + } + + public void setTokenLifetime(String tokenLifetime) { + this.tokenLifetime = tokenLifetime; + } + + + public EmailCodeSendReq userFullName(String userFullName) { + this.userFullName = userFullName; + return this; + } + + /** + * Optional user's full name to be used if the user wasn't found and needs to be created first + * @return userFullName + **/ + @javax.annotation.Nullable + public String getUserFullName() { + return userFullName; + } + + public void setUserFullName(String userFullName) { + this.userFullName = userFullName; + } + + + public EmailCodeSendReq templateName(String templateName) { + this.templateName = templateName; + return this; + } + + /** + * Template name of email to send + * @return templateName + **/ + @javax.annotation.Nullable + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + + public EmailCodeSendReq additionalPayload(String additionalPayload) { + this.additionalPayload = additionalPayload; + return this; + } + + /** + * Additional payload in JSON format + * @return additionalPayload + **/ + @javax.annotation.Nullable + public String getAdditionalPayload() { + return additionalPayload; + } + + public void setAdditionalPayload(String additionalPayload) { + this.additionalPayload = additionalPayload; + } + + + public EmailCodeSendReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public EmailCodeSendReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailCodeSendReq emailCodeSendReq = (EmailCodeSendReq) o; + return Objects.equals(this.email, emailCodeSendReq.email) && + Objects.equals(this.create, emailCodeSendReq.create) && + Objects.equals(this.tokenLifetime, emailCodeSendReq.tokenLifetime) && + Objects.equals(this.userFullName, emailCodeSendReq.userFullName) && + Objects.equals(this.templateName, emailCodeSendReq.templateName) && + Objects.equals(this.additionalPayload, emailCodeSendReq.additionalPayload) && + Objects.equals(this.requestID, emailCodeSendReq.requestID) && + Objects.equals(this.clientInfo, emailCodeSendReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(email, create, tokenLifetime, userFullName, templateName, additionalPayload, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailCodeSendReq {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" create: ").append(toIndentedString(create)).append("\n"); + sb.append(" tokenLifetime: ").append(toIndentedString(tokenLifetime)).append("\n"); + sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); + sb.append(" templateName: ").append(toIndentedString(templateName)).append("\n"); + sb.append(" additionalPayload: ").append(toIndentedString(additionalPayload)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("email"); + openapiFields.add("create"); + openapiFields.add("tokenLifetime"); + openapiFields.add("userFullName"); + openapiFields.add("templateName"); + openapiFields.add("additionalPayload"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("create"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailCodeSendReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailCodeSendReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCodeSendReq is not found in the empty JSON string", EmailCodeSendReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailCodeSendReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCodeSendReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailCodeSendReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("tokenLifetime") != null && !jsonObj.get("tokenLifetime").isJsonNull()) && !jsonObj.get("tokenLifetime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tokenLifetime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenLifetime").toString())); + } + if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); + } + if ((jsonObj.get("templateName") != null && !jsonObj.get("templateName").isJsonNull()) && !jsonObj.get("templateName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `templateName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("templateName").toString())); + } + if ((jsonObj.get("additionalPayload") != null && !jsonObj.get("additionalPayload").isJsonNull()) && !jsonObj.get("additionalPayload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `additionalPayload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalPayload").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailCodeSendReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailCodeSendReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailCodeSendReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailCodeSendReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailCodeSendReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailCodeSendReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailCodeSendReq + * @throws IOException if the JSON string is invalid with respect to EmailCodeSendReq + */ + public static EmailCodeSendReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailCodeSendReq.class); + } + + /** + * Convert an instance of EmailCodeSendReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailCodeSendRsp.java b/src/main/java/com/corbado/generated/model/EmailCodeSendRsp.java new file mode 100644 index 0000000..645a302 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailCodeSendRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.EmailCodeSendRspAllOfData; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailCodeSendRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailCodeSendRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private EmailCodeSendRspAllOfData data; + + public EmailCodeSendRsp() { + } + + public EmailCodeSendRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public EmailCodeSendRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public EmailCodeSendRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public EmailCodeSendRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public EmailCodeSendRsp data(EmailCodeSendRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public EmailCodeSendRspAllOfData getData() { + return data; + } + + public void setData(EmailCodeSendRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailCodeSendRsp emailCodeSendRsp = (EmailCodeSendRsp) o; + return Objects.equals(this.httpStatusCode, emailCodeSendRsp.httpStatusCode) && + Objects.equals(this.message, emailCodeSendRsp.message) && + Objects.equals(this.requestData, emailCodeSendRsp.requestData) && + Objects.equals(this.runtime, emailCodeSendRsp.runtime) && + Objects.equals(this.data, emailCodeSendRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailCodeSendRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailCodeSendRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailCodeSendRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCodeSendRsp is not found in the empty JSON string", EmailCodeSendRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailCodeSendRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCodeSendRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailCodeSendRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + EmailCodeSendRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailCodeSendRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailCodeSendRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailCodeSendRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailCodeSendRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailCodeSendRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailCodeSendRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailCodeSendRsp + * @throws IOException if the JSON string is invalid with respect to EmailCodeSendRsp + */ + public static EmailCodeSendRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailCodeSendRsp.class); + } + + /** + * Convert an instance of EmailCodeSendRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailCodeSendRspAllOfData.java b/src/main/java/com/corbado/generated/model/EmailCodeSendRspAllOfData.java new file mode 100644 index 0000000..8f31a45 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailCodeSendRspAllOfData.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailCodeSendRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailCodeSendRspAllOfData { + public static final String SERIALIZED_NAME_EMAIL_CODE_I_D = "emailCodeID"; + @SerializedName(SERIALIZED_NAME_EMAIL_CODE_I_D) + private String emailCodeID; + + public EmailCodeSendRspAllOfData() { + } + + public EmailCodeSendRspAllOfData emailCodeID(String emailCodeID) { + this.emailCodeID = emailCodeID; + return this; + } + + /** + * Get emailCodeID + * @return emailCodeID + **/ + @javax.annotation.Nonnull + public String getEmailCodeID() { + return emailCodeID; + } + + public void setEmailCodeID(String emailCodeID) { + this.emailCodeID = emailCodeID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailCodeSendRspAllOfData emailCodeSendRspAllOfData = (EmailCodeSendRspAllOfData) o; + return Objects.equals(this.emailCodeID, emailCodeSendRspAllOfData.emailCodeID); + } + + @Override + public int hashCode() { + return Objects.hash(emailCodeID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailCodeSendRspAllOfData {\n"); + sb.append(" emailCodeID: ").append(toIndentedString(emailCodeID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("emailCodeID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("emailCodeID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailCodeSendRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailCodeSendRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCodeSendRspAllOfData is not found in the empty JSON string", EmailCodeSendRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailCodeSendRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCodeSendRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailCodeSendRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("emailCodeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `emailCodeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailCodeID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailCodeSendRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailCodeSendRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailCodeSendRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailCodeSendRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailCodeSendRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailCodeSendRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailCodeSendRspAllOfData + * @throws IOException if the JSON string is invalid with respect to EmailCodeSendRspAllOfData + */ + public static EmailCodeSendRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailCodeSendRspAllOfData.class); + } + + /** + * Convert an instance of EmailCodeSendRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailCodeValidateReq.java b/src/main/java/com/corbado/generated/model/EmailCodeValidateReq.java new file mode 100644 index 0000000..5c1994c --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailCodeValidateReq.java @@ -0,0 +1,300 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailCodeValidateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailCodeValidateReq { + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + public static final String SERIALIZED_NAME_CREATE_LOGIN_TOKEN = "createLoginToken"; + @SerializedName(SERIALIZED_NAME_CREATE_LOGIN_TOKEN) + private Boolean createLoginToken; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public EmailCodeValidateReq() { + } + + public EmailCodeValidateReq code(String code) { + this.code = code; + return this; + } + + /** + * Email OTP to validate + * @return code + **/ + @javax.annotation.Nonnull + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + + public EmailCodeValidateReq createLoginToken(Boolean createLoginToken) { + this.createLoginToken = createLoginToken; + return this; + } + + /** + * Get createLoginToken + * @return createLoginToken + **/ + @javax.annotation.Nullable + public Boolean getCreateLoginToken() { + return createLoginToken; + } + + public void setCreateLoginToken(Boolean createLoginToken) { + this.createLoginToken = createLoginToken; + } + + + public EmailCodeValidateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public EmailCodeValidateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailCodeValidateReq emailCodeValidateReq = (EmailCodeValidateReq) o; + return Objects.equals(this.code, emailCodeValidateReq.code) && + Objects.equals(this.createLoginToken, emailCodeValidateReq.createLoginToken) && + Objects.equals(this.requestID, emailCodeValidateReq.requestID) && + Objects.equals(this.clientInfo, emailCodeValidateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(code, createLoginToken, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailCodeValidateReq {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" createLoginToken: ").append(toIndentedString(createLoginToken)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("createLoginToken"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("code"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailCodeValidateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailCodeValidateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCodeValidateReq is not found in the empty JSON string", EmailCodeValidateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailCodeValidateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCodeValidateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailCodeValidateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailCodeValidateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailCodeValidateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailCodeValidateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailCodeValidateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailCodeValidateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailCodeValidateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailCodeValidateReq + * @throws IOException if the JSON string is invalid with respect to EmailCodeValidateReq + */ + public static EmailCodeValidateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailCodeValidateReq.class); + } + + /** + * Convert an instance of EmailCodeValidateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailCodeValidateRsp.java b/src/main/java/com/corbado/generated/model/EmailCodeValidateRsp.java new file mode 100644 index 0000000..eae3256 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailCodeValidateRsp.java @@ -0,0 +1,448 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailCodeValidateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailCodeValidateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_ADDITIONAL_PAYLOAD = "additionalPayload"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_PAYLOAD) + private String additionalPayload; + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; + @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) + private String userFullName; + + public static final String SERIALIZED_NAME_USER_EMAIL = "userEmail"; + @SerializedName(SERIALIZED_NAME_USER_EMAIL) + private String userEmail; + + public static final String SERIALIZED_NAME_LOGIN_TOKEN = "loginToken"; + @SerializedName(SERIALIZED_NAME_LOGIN_TOKEN) + private String loginToken; + + public EmailCodeValidateRsp() { + } + + public EmailCodeValidateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public EmailCodeValidateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public EmailCodeValidateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public EmailCodeValidateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public EmailCodeValidateRsp additionalPayload(String additionalPayload) { + this.additionalPayload = additionalPayload; + return this; + } + + /** + * Additional payload in JSON format + * @return additionalPayload + **/ + @javax.annotation.Nullable + public String getAdditionalPayload() { + return additionalPayload; + } + + public void setAdditionalPayload(String additionalPayload) { + this.additionalPayload = additionalPayload; + } + + + public EmailCodeValidateRsp userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + **/ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public EmailCodeValidateRsp userFullName(String userFullName) { + this.userFullName = userFullName; + return this; + } + + /** + * Get userFullName + * @return userFullName + **/ + @javax.annotation.Nonnull + public String getUserFullName() { + return userFullName; + } + + public void setUserFullName(String userFullName) { + this.userFullName = userFullName; + } + + + public EmailCodeValidateRsp userEmail(String userEmail) { + this.userEmail = userEmail; + return this; + } + + /** + * Get userEmail + * @return userEmail + **/ + @javax.annotation.Nonnull + public String getUserEmail() { + return userEmail; + } + + public void setUserEmail(String userEmail) { + this.userEmail = userEmail; + } + + + public EmailCodeValidateRsp loginToken(String loginToken) { + this.loginToken = loginToken; + return this; + } + + /** + * Get loginToken + * @return loginToken + **/ + @javax.annotation.Nullable + public String getLoginToken() { + return loginToken; + } + + public void setLoginToken(String loginToken) { + this.loginToken = loginToken; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailCodeValidateRsp emailCodeValidateRsp = (EmailCodeValidateRsp) o; + return Objects.equals(this.httpStatusCode, emailCodeValidateRsp.httpStatusCode) && + Objects.equals(this.message, emailCodeValidateRsp.message) && + Objects.equals(this.requestData, emailCodeValidateRsp.requestData) && + Objects.equals(this.runtime, emailCodeValidateRsp.runtime) && + Objects.equals(this.additionalPayload, emailCodeValidateRsp.additionalPayload) && + Objects.equals(this.userID, emailCodeValidateRsp.userID) && + Objects.equals(this.userFullName, emailCodeValidateRsp.userFullName) && + Objects.equals(this.userEmail, emailCodeValidateRsp.userEmail) && + Objects.equals(this.loginToken, emailCodeValidateRsp.loginToken); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, additionalPayload, userID, userFullName, userEmail, loginToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailCodeValidateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" additionalPayload: ").append(toIndentedString(additionalPayload)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); + sb.append(" userEmail: ").append(toIndentedString(userEmail)).append("\n"); + sb.append(" loginToken: ").append(toIndentedString(loginToken)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("additionalPayload"); + openapiFields.add("userID"); + openapiFields.add("userFullName"); + openapiFields.add("userEmail"); + openapiFields.add("loginToken"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("userFullName"); + openapiRequiredFields.add("userEmail"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailCodeValidateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailCodeValidateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCodeValidateRsp is not found in the empty JSON string", EmailCodeValidateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailCodeValidateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCodeValidateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailCodeValidateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if ((jsonObj.get("additionalPayload") != null && !jsonObj.get("additionalPayload").isJsonNull()) && !jsonObj.get("additionalPayload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `additionalPayload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalPayload").toString())); + } + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("userFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); + } + if (!jsonObj.get("userEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userEmail").toString())); + } + if ((jsonObj.get("loginToken") != null && !jsonObj.get("loginToken").isJsonNull()) && !jsonObj.get("loginToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loginToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailCodeValidateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailCodeValidateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailCodeValidateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailCodeValidateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailCodeValidateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailCodeValidateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailCodeValidateRsp + * @throws IOException if the JSON string is invalid with respect to EmailCodeValidateRsp + */ + public static EmailCodeValidateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailCodeValidateRsp.class); + } + + /** + * Convert an instance of EmailCodeValidateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailLink.java b/src/main/java/com/corbado/generated/model/EmailLink.java new file mode 100644 index 0000000..8c68a48 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailLink.java @@ -0,0 +1,506 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailLink + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailLink { + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + private String ID; + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; + @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) + private String userFullName; + + public static final String SERIALIZED_NAME_PURPOSE = "purpose"; + @SerializedName(SERIALIZED_NAME_PURPOSE) + private String purpose; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + /** + * status values of an email link + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACTIVE("active"), + + CONFIRMED("confirmed"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_ADDITIONAL_PAYLOAD = "additionalPayload"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_PAYLOAD) + private String additionalPayload; + + public EmailLink() { + } + + public EmailLink ID(String ID) { + this.ID = ID; + return this; + } + + /** + * ID of the email magic link + * @return ID + **/ + @javax.annotation.Nonnull + public String getID() { + return ID; + } + + public void setID(String ID) { + this.ID = ID; + } + + + public EmailLink userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + **/ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public EmailLink email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public EmailLink userFullName(String userFullName) { + this.userFullName = userFullName; + return this; + } + + /** + * Get userFullName + * @return userFullName + **/ + @javax.annotation.Nullable + public String getUserFullName() { + return userFullName; + } + + public void setUserFullName(String userFullName) { + this.userFullName = userFullName; + } + + + public EmailLink purpose(String purpose) { + this.purpose = purpose; + return this; + } + + /** + * Get purpose + * @return purpose + **/ + @javax.annotation.Nullable + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + + public EmailLink created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public EmailLink updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + public EmailLink status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * status values of an email link + * @return status + **/ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public EmailLink additionalPayload(String additionalPayload) { + this.additionalPayload = additionalPayload; + return this; + } + + /** + * Additional payload in JSON format + * @return additionalPayload + **/ + @javax.annotation.Nonnull + public String getAdditionalPayload() { + return additionalPayload; + } + + public void setAdditionalPayload(String additionalPayload) { + this.additionalPayload = additionalPayload; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailLink emailLink = (EmailLink) o; + return Objects.equals(this.ID, emailLink.ID) && + Objects.equals(this.userID, emailLink.userID) && + Objects.equals(this.email, emailLink.email) && + Objects.equals(this.userFullName, emailLink.userFullName) && + Objects.equals(this.purpose, emailLink.purpose) && + Objects.equals(this.created, emailLink.created) && + Objects.equals(this.updated, emailLink.updated) && + Objects.equals(this.status, emailLink.status) && + Objects.equals(this.additionalPayload, emailLink.additionalPayload); + } + + @Override + public int hashCode() { + return Objects.hash(ID, userID, email, userFullName, purpose, created, updated, status, additionalPayload); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailLink {\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); + sb.append(" purpose: ").append(toIndentedString(purpose)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalPayload: ").append(toIndentedString(additionalPayload)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ID"); + openapiFields.add("userID"); + openapiFields.add("email"); + openapiFields.add("userFullName"); + openapiFields.add("purpose"); + openapiFields.add("created"); + openapiFields.add("updated"); + openapiFields.add("status"); + openapiFields.add("additionalPayload"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ID"); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("additionalPayload"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailLink + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailLink.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLink is not found in the empty JSON string", EmailLink.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailLink.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLink` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailLink.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); + } + if ((jsonObj.get("purpose") != null && !jsonObj.get("purpose").isJsonNull()) && !jsonObj.get("purpose").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `purpose` to be a primitive type in the JSON string but got `%s`", jsonObj.get("purpose").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + if (!jsonObj.get("additionalPayload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `additionalPayload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalPayload").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailLink.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailLink' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailLink.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailLink value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailLink read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailLink given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailLink + * @throws IOException if the JSON string is invalid with respect to EmailLink + */ + public static EmailLink fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailLink.class); + } + + /** + * Convert an instance of EmailLink to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailLinkGetRsp.java b/src/main/java/com/corbado/generated/model/EmailLinkGetRsp.java new file mode 100644 index 0000000..ff29812 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailLinkGetRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.EmailLinkGetRspAllOfData; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailLinkGetRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailLinkGetRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private EmailLinkGetRspAllOfData data; + + public EmailLinkGetRsp() { + } + + public EmailLinkGetRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public EmailLinkGetRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public EmailLinkGetRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public EmailLinkGetRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public EmailLinkGetRsp data(EmailLinkGetRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public EmailLinkGetRspAllOfData getData() { + return data; + } + + public void setData(EmailLinkGetRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailLinkGetRsp emailLinkGetRsp = (EmailLinkGetRsp) o; + return Objects.equals(this.httpStatusCode, emailLinkGetRsp.httpStatusCode) && + Objects.equals(this.message, emailLinkGetRsp.message) && + Objects.equals(this.requestData, emailLinkGetRsp.requestData) && + Objects.equals(this.runtime, emailLinkGetRsp.runtime) && + Objects.equals(this.data, emailLinkGetRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailLinkGetRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailLinkGetRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailLinkGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinkGetRsp is not found in the empty JSON string", EmailLinkGetRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailLinkGetRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinkGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailLinkGetRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + EmailLinkGetRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailLinkGetRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailLinkGetRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailLinkGetRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailLinkGetRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailLinkGetRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailLinkGetRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailLinkGetRsp + * @throws IOException if the JSON string is invalid with respect to EmailLinkGetRsp + */ + public static EmailLinkGetRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailLinkGetRsp.class); + } + + /** + * Convert an instance of EmailLinkGetRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailLinkGetRspAllOfData.java b/src/main/java/com/corbado/generated/model/EmailLinkGetRspAllOfData.java new file mode 100644 index 0000000..ba8cfc4 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailLinkGetRspAllOfData.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.EmailLink; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailLinkGetRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailLinkGetRspAllOfData { + public static final String SERIALIZED_NAME_EMAIL_LINK = "emailLink"; + @SerializedName(SERIALIZED_NAME_EMAIL_LINK) + private EmailLink emailLink; + + public EmailLinkGetRspAllOfData() { + } + + public EmailLinkGetRspAllOfData emailLink(EmailLink emailLink) { + this.emailLink = emailLink; + return this; + } + + /** + * Get emailLink + * @return emailLink + **/ + @javax.annotation.Nonnull + public EmailLink getEmailLink() { + return emailLink; + } + + public void setEmailLink(EmailLink emailLink) { + this.emailLink = emailLink; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailLinkGetRspAllOfData emailLinkGetRspAllOfData = (EmailLinkGetRspAllOfData) o; + return Objects.equals(this.emailLink, emailLinkGetRspAllOfData.emailLink); + } + + @Override + public int hashCode() { + return Objects.hash(emailLink); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailLinkGetRspAllOfData {\n"); + sb.append(" emailLink: ").append(toIndentedString(emailLink)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("emailLink"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("emailLink"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailLinkGetRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailLinkGetRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinkGetRspAllOfData is not found in the empty JSON string", EmailLinkGetRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailLinkGetRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinkGetRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailLinkGetRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `emailLink` + EmailLink.validateJsonElement(jsonObj.get("emailLink")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailLinkGetRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailLinkGetRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailLinkGetRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailLinkGetRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailLinkGetRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailLinkGetRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailLinkGetRspAllOfData + * @throws IOException if the JSON string is invalid with respect to EmailLinkGetRspAllOfData + */ + public static EmailLinkGetRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailLinkGetRspAllOfData.class); + } + + /** + * Convert an instance of EmailLinkGetRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailLinkSendReq.java b/src/main/java/com/corbado/generated/model/EmailLinkSendReq.java new file mode 100644 index 0000000..e54cdc3 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailLinkSendReq.java @@ -0,0 +1,535 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailLinkSendReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailLinkSendReq { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_CREATE = "create"; + @SerializedName(SERIALIZED_NAME_CREATE) + private Boolean create; + + public static final String SERIALIZED_NAME_TOKEN_LIFETIME = "tokenLifetime"; + @SerializedName(SERIALIZED_NAME_TOKEN_LIFETIME) + private String tokenLifetime; + + public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; + @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) + private String userFullName; + + public static final String SERIALIZED_NAME_TEMPLATE_NAME = "templateName"; + @SerializedName(SERIALIZED_NAME_TEMPLATE_NAME) + private String templateName; + + /** + * Purpose of the email link + */ + @JsonAdapter(PurposeEnum.Adapter.class) + public enum PurposeEnum { + AUTHENTICATION("authentication"), + + CONFIRMATION("confirmation"), + + INVITATION("invitation"); + + private String value; + + PurposeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PurposeEnum fromValue(String value) { + for (PurposeEnum b : PurposeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PurposeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PurposeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PurposeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PurposeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PURPOSE = "purpose"; + @SerializedName(SERIALIZED_NAME_PURPOSE) + private PurposeEnum purpose = PurposeEnum.AUTHENTICATION; + + public static final String SERIALIZED_NAME_REDIRECT = "redirect"; + @SerializedName(SERIALIZED_NAME_REDIRECT) + private URI redirect; + + public static final String SERIALIZED_NAME_ADDITIONAL_PAYLOAD = "additionalPayload"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_PAYLOAD) + private String additionalPayload; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public EmailLinkSendReq() { + } + + public EmailLinkSendReq email(String email) { + this.email = email; + return this; + } + + /** + * Recipient email address + * @return email + **/ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public EmailLinkSendReq create(Boolean create) { + this.create = create; + return this; + } + + /** + * Defines if user email should be created if not found + * @return create + **/ + @javax.annotation.Nonnull + public Boolean getCreate() { + return create; + } + + public void setCreate(Boolean create) { + this.create = create; + } + + + public EmailLinkSendReq tokenLifetime(String tokenLifetime) { + this.tokenLifetime = tokenLifetime; + return this; + } + + /** + * Defines the lifetime of the token that needs to be validated + * @return tokenLifetime + **/ + @javax.annotation.Nullable + public String getTokenLifetime() { + return tokenLifetime; + } + + public void setTokenLifetime(String tokenLifetime) { + this.tokenLifetime = tokenLifetime; + } + + + public EmailLinkSendReq userFullName(String userFullName) { + this.userFullName = userFullName; + return this; + } + + /** + * Optional user's full name to be used if the user wasn't found and needs to be created first + * @return userFullName + **/ + @javax.annotation.Nullable + public String getUserFullName() { + return userFullName; + } + + public void setUserFullName(String userFullName) { + this.userFullName = userFullName; + } + + + public EmailLinkSendReq templateName(String templateName) { + this.templateName = templateName; + return this; + } + + /** + * Template name of email to send + * @return templateName + **/ + @javax.annotation.Nullable + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + + public EmailLinkSendReq purpose(PurposeEnum purpose) { + this.purpose = purpose; + return this; + } + + /** + * Purpose of the email link + * @return purpose + **/ + @javax.annotation.Nullable + public PurposeEnum getPurpose() { + return purpose; + } + + public void setPurpose(PurposeEnum purpose) { + this.purpose = purpose; + } + + + public EmailLinkSendReq redirect(URI redirect) { + this.redirect = redirect; + return this; + } + + /** + * Redirect target after user clicks on email magic link + * @return redirect + **/ + @javax.annotation.Nonnull + public URI getRedirect() { + return redirect; + } + + public void setRedirect(URI redirect) { + this.redirect = redirect; + } + + + public EmailLinkSendReq additionalPayload(String additionalPayload) { + this.additionalPayload = additionalPayload; + return this; + } + + /** + * Additional payload in JSON format + * @return additionalPayload + **/ + @javax.annotation.Nullable + public String getAdditionalPayload() { + return additionalPayload; + } + + public void setAdditionalPayload(String additionalPayload) { + this.additionalPayload = additionalPayload; + } + + + public EmailLinkSendReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public EmailLinkSendReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailLinkSendReq emailLinkSendReq = (EmailLinkSendReq) o; + return Objects.equals(this.email, emailLinkSendReq.email) && + Objects.equals(this.create, emailLinkSendReq.create) && + Objects.equals(this.tokenLifetime, emailLinkSendReq.tokenLifetime) && + Objects.equals(this.userFullName, emailLinkSendReq.userFullName) && + Objects.equals(this.templateName, emailLinkSendReq.templateName) && + Objects.equals(this.purpose, emailLinkSendReq.purpose) && + Objects.equals(this.redirect, emailLinkSendReq.redirect) && + Objects.equals(this.additionalPayload, emailLinkSendReq.additionalPayload) && + Objects.equals(this.requestID, emailLinkSendReq.requestID) && + Objects.equals(this.clientInfo, emailLinkSendReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(email, create, tokenLifetime, userFullName, templateName, purpose, redirect, additionalPayload, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailLinkSendReq {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" create: ").append(toIndentedString(create)).append("\n"); + sb.append(" tokenLifetime: ").append(toIndentedString(tokenLifetime)).append("\n"); + sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); + sb.append(" templateName: ").append(toIndentedString(templateName)).append("\n"); + sb.append(" purpose: ").append(toIndentedString(purpose)).append("\n"); + sb.append(" redirect: ").append(toIndentedString(redirect)).append("\n"); + sb.append(" additionalPayload: ").append(toIndentedString(additionalPayload)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("email"); + openapiFields.add("create"); + openapiFields.add("tokenLifetime"); + openapiFields.add("userFullName"); + openapiFields.add("templateName"); + openapiFields.add("purpose"); + openapiFields.add("redirect"); + openapiFields.add("additionalPayload"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("create"); + openapiRequiredFields.add("redirect"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailLinkSendReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailLinkSendReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinkSendReq is not found in the empty JSON string", EmailLinkSendReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailLinkSendReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinkSendReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailLinkSendReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("tokenLifetime") != null && !jsonObj.get("tokenLifetime").isJsonNull()) && !jsonObj.get("tokenLifetime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tokenLifetime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenLifetime").toString())); + } + if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); + } + if ((jsonObj.get("templateName") != null && !jsonObj.get("templateName").isJsonNull()) && !jsonObj.get("templateName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `templateName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("templateName").toString())); + } + if ((jsonObj.get("purpose") != null && !jsonObj.get("purpose").isJsonNull()) && !jsonObj.get("purpose").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `purpose` to be a primitive type in the JSON string but got `%s`", jsonObj.get("purpose").toString())); + } + // validate the optional field `purpose` + if (jsonObj.get("purpose") != null && !jsonObj.get("purpose").isJsonNull()) { + PurposeEnum.validateJsonElement(jsonObj.get("purpose")); + } + if (!jsonObj.get("redirect").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `redirect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirect").toString())); + } + if ((jsonObj.get("additionalPayload") != null && !jsonObj.get("additionalPayload").isJsonNull()) && !jsonObj.get("additionalPayload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `additionalPayload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalPayload").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailLinkSendReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailLinkSendReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailLinkSendReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailLinkSendReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailLinkSendReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailLinkSendReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailLinkSendReq + * @throws IOException if the JSON string is invalid with respect to EmailLinkSendReq + */ + public static EmailLinkSendReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailLinkSendReq.class); + } + + /** + * Convert an instance of EmailLinkSendReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailLinkSendRsp.java b/src/main/java/com/corbado/generated/model/EmailLinkSendRsp.java new file mode 100644 index 0000000..883f04e --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailLinkSendRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.EmailLinkSendRspAllOfData; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailLinkSendRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailLinkSendRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private EmailLinkSendRspAllOfData data; + + public EmailLinkSendRsp() { + } + + public EmailLinkSendRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public EmailLinkSendRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public EmailLinkSendRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public EmailLinkSendRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public EmailLinkSendRsp data(EmailLinkSendRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public EmailLinkSendRspAllOfData getData() { + return data; + } + + public void setData(EmailLinkSendRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailLinkSendRsp emailLinkSendRsp = (EmailLinkSendRsp) o; + return Objects.equals(this.httpStatusCode, emailLinkSendRsp.httpStatusCode) && + Objects.equals(this.message, emailLinkSendRsp.message) && + Objects.equals(this.requestData, emailLinkSendRsp.requestData) && + Objects.equals(this.runtime, emailLinkSendRsp.runtime) && + Objects.equals(this.data, emailLinkSendRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailLinkSendRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailLinkSendRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailLinkSendRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinkSendRsp is not found in the empty JSON string", EmailLinkSendRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailLinkSendRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinkSendRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailLinkSendRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + EmailLinkSendRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailLinkSendRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailLinkSendRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailLinkSendRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailLinkSendRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailLinkSendRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailLinkSendRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailLinkSendRsp + * @throws IOException if the JSON string is invalid with respect to EmailLinkSendRsp + */ + public static EmailLinkSendRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailLinkSendRsp.class); + } + + /** + * Convert an instance of EmailLinkSendRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailLinkSendRspAllOfData.java b/src/main/java/com/corbado/generated/model/EmailLinkSendRspAllOfData.java new file mode 100644 index 0000000..4f3bc2f --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailLinkSendRspAllOfData.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailLinkSendRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailLinkSendRspAllOfData { + public static final String SERIALIZED_NAME_EMAIL_LINK_I_D = "emailLinkID"; + @SerializedName(SERIALIZED_NAME_EMAIL_LINK_I_D) + private String emailLinkID; + + public EmailLinkSendRspAllOfData() { + } + + public EmailLinkSendRspAllOfData emailLinkID(String emailLinkID) { + this.emailLinkID = emailLinkID; + return this; + } + + /** + * Get emailLinkID + * @return emailLinkID + **/ + @javax.annotation.Nonnull + public String getEmailLinkID() { + return emailLinkID; + } + + public void setEmailLinkID(String emailLinkID) { + this.emailLinkID = emailLinkID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailLinkSendRspAllOfData emailLinkSendRspAllOfData = (EmailLinkSendRspAllOfData) o; + return Objects.equals(this.emailLinkID, emailLinkSendRspAllOfData.emailLinkID); + } + + @Override + public int hashCode() { + return Objects.hash(emailLinkID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailLinkSendRspAllOfData {\n"); + sb.append(" emailLinkID: ").append(toIndentedString(emailLinkID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("emailLinkID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("emailLinkID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailLinkSendRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailLinkSendRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinkSendRspAllOfData is not found in the empty JSON string", EmailLinkSendRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailLinkSendRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinkSendRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailLinkSendRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("emailLinkID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `emailLinkID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailLinkID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailLinkSendRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailLinkSendRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailLinkSendRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailLinkSendRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailLinkSendRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailLinkSendRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailLinkSendRspAllOfData + * @throws IOException if the JSON string is invalid with respect to EmailLinkSendRspAllOfData + */ + public static EmailLinkSendRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailLinkSendRspAllOfData.class); + } + + /** + * Convert an instance of EmailLinkSendRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailLinkValidateRsp.java b/src/main/java/com/corbado/generated/model/EmailLinkValidateRsp.java new file mode 100644 index 0000000..1c98df1 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailLinkValidateRsp.java @@ -0,0 +1,448 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailLinkValidateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailLinkValidateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_ADDITIONAL_PAYLOAD = "additionalPayload"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_PAYLOAD) + private String additionalPayload; + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; + @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) + private String userFullName; + + public static final String SERIALIZED_NAME_USER_EMAIL = "userEmail"; + @SerializedName(SERIALIZED_NAME_USER_EMAIL) + private String userEmail; + + public static final String SERIALIZED_NAME_LOGIN_TOKEN = "loginToken"; + @SerializedName(SERIALIZED_NAME_LOGIN_TOKEN) + private String loginToken; + + public EmailLinkValidateRsp() { + } + + public EmailLinkValidateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public EmailLinkValidateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public EmailLinkValidateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public EmailLinkValidateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public EmailLinkValidateRsp additionalPayload(String additionalPayload) { + this.additionalPayload = additionalPayload; + return this; + } + + /** + * Additional payload in JSON format + * @return additionalPayload + **/ + @javax.annotation.Nullable + public String getAdditionalPayload() { + return additionalPayload; + } + + public void setAdditionalPayload(String additionalPayload) { + this.additionalPayload = additionalPayload; + } + + + public EmailLinkValidateRsp userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + **/ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public EmailLinkValidateRsp userFullName(String userFullName) { + this.userFullName = userFullName; + return this; + } + + /** + * Get userFullName + * @return userFullName + **/ + @javax.annotation.Nonnull + public String getUserFullName() { + return userFullName; + } + + public void setUserFullName(String userFullName) { + this.userFullName = userFullName; + } + + + public EmailLinkValidateRsp userEmail(String userEmail) { + this.userEmail = userEmail; + return this; + } + + /** + * Get userEmail + * @return userEmail + **/ + @javax.annotation.Nonnull + public String getUserEmail() { + return userEmail; + } + + public void setUserEmail(String userEmail) { + this.userEmail = userEmail; + } + + + public EmailLinkValidateRsp loginToken(String loginToken) { + this.loginToken = loginToken; + return this; + } + + /** + * Get loginToken + * @return loginToken + **/ + @javax.annotation.Nullable + public String getLoginToken() { + return loginToken; + } + + public void setLoginToken(String loginToken) { + this.loginToken = loginToken; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailLinkValidateRsp emailLinkValidateRsp = (EmailLinkValidateRsp) o; + return Objects.equals(this.httpStatusCode, emailLinkValidateRsp.httpStatusCode) && + Objects.equals(this.message, emailLinkValidateRsp.message) && + Objects.equals(this.requestData, emailLinkValidateRsp.requestData) && + Objects.equals(this.runtime, emailLinkValidateRsp.runtime) && + Objects.equals(this.additionalPayload, emailLinkValidateRsp.additionalPayload) && + Objects.equals(this.userID, emailLinkValidateRsp.userID) && + Objects.equals(this.userFullName, emailLinkValidateRsp.userFullName) && + Objects.equals(this.userEmail, emailLinkValidateRsp.userEmail) && + Objects.equals(this.loginToken, emailLinkValidateRsp.loginToken); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, additionalPayload, userID, userFullName, userEmail, loginToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailLinkValidateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" additionalPayload: ").append(toIndentedString(additionalPayload)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); + sb.append(" userEmail: ").append(toIndentedString(userEmail)).append("\n"); + sb.append(" loginToken: ").append(toIndentedString(loginToken)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("additionalPayload"); + openapiFields.add("userID"); + openapiFields.add("userFullName"); + openapiFields.add("userEmail"); + openapiFields.add("loginToken"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("userFullName"); + openapiRequiredFields.add("userEmail"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailLinkValidateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailLinkValidateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinkValidateRsp is not found in the empty JSON string", EmailLinkValidateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailLinkValidateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinkValidateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailLinkValidateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if ((jsonObj.get("additionalPayload") != null && !jsonObj.get("additionalPayload").isJsonNull()) && !jsonObj.get("additionalPayload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `additionalPayload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalPayload").toString())); + } + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("userFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); + } + if (!jsonObj.get("userEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userEmail").toString())); + } + if ((jsonObj.get("loginToken") != null && !jsonObj.get("loginToken").isJsonNull()) && !jsonObj.get("loginToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loginToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailLinkValidateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailLinkValidateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailLinkValidateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailLinkValidateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailLinkValidateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailLinkValidateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailLinkValidateRsp + * @throws IOException if the JSON string is invalid with respect to EmailLinkValidateRsp + */ + public static EmailLinkValidateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailLinkValidateRsp.class); + } + + /** + * Convert an instance of EmailLinkValidateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailLinksDeleteReq.java b/src/main/java/com/corbado/generated/model/EmailLinksDeleteReq.java new file mode 100644 index 0000000..4334e93 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailLinksDeleteReq.java @@ -0,0 +1,245 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailLinksDeleteReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailLinksDeleteReq { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public EmailLinksDeleteReq() { + } + + public EmailLinksDeleteReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nonnull + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public EmailLinksDeleteReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailLinksDeleteReq emailLinksDeleteReq = (EmailLinksDeleteReq) o; + return Objects.equals(this.requestID, emailLinksDeleteReq.requestID) && + Objects.equals(this.clientInfo, emailLinksDeleteReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailLinksDeleteReq {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("requestID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailLinksDeleteReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailLinksDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinksDeleteReq is not found in the empty JSON string", EmailLinksDeleteReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailLinksDeleteReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinksDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailLinksDeleteReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailLinksDeleteReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailLinksDeleteReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailLinksDeleteReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailLinksDeleteReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailLinksDeleteReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailLinksDeleteReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailLinksDeleteReq + * @throws IOException if the JSON string is invalid with respect to EmailLinksDeleteReq + */ + public static EmailLinksDeleteReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailLinksDeleteReq.class); + } + + /** + * Convert an instance of EmailLinksDeleteReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailLinksValidateReq.java b/src/main/java/com/corbado/generated/model/EmailLinksValidateReq.java new file mode 100644 index 0000000..c76d8cb --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailLinksValidateReq.java @@ -0,0 +1,300 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailLinksValidateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailLinksValidateReq { + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + private String token; + + public static final String SERIALIZED_NAME_CREATE_LOGIN_TOKEN = "createLoginToken"; + @SerializedName(SERIALIZED_NAME_CREATE_LOGIN_TOKEN) + private Boolean createLoginToken; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public EmailLinksValidateReq() { + } + + public EmailLinksValidateReq token(String token) { + this.token = token; + return this; + } + + /** + * Token to validate + * @return token + **/ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + + public EmailLinksValidateReq createLoginToken(Boolean createLoginToken) { + this.createLoginToken = createLoginToken; + return this; + } + + /** + * Get createLoginToken + * @return createLoginToken + **/ + @javax.annotation.Nullable + public Boolean getCreateLoginToken() { + return createLoginToken; + } + + public void setCreateLoginToken(Boolean createLoginToken) { + this.createLoginToken = createLoginToken; + } + + + public EmailLinksValidateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public EmailLinksValidateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailLinksValidateReq emailLinksValidateReq = (EmailLinksValidateReq) o; + return Objects.equals(this.token, emailLinksValidateReq.token) && + Objects.equals(this.createLoginToken, emailLinksValidateReq.createLoginToken) && + Objects.equals(this.requestID, emailLinksValidateReq.requestID) && + Objects.equals(this.clientInfo, emailLinksValidateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(token, createLoginToken, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailLinksValidateReq {\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" createLoginToken: ").append(toIndentedString(createLoginToken)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("token"); + openapiFields.add("createLoginToken"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("token"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailLinksValidateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailLinksValidateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinksValidateReq is not found in the empty JSON string", EmailLinksValidateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailLinksValidateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinksValidateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailLinksValidateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailLinksValidateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailLinksValidateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailLinksValidateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailLinksValidateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailLinksValidateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailLinksValidateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailLinksValidateReq + * @throws IOException if the JSON string is invalid with respect to EmailLinksValidateReq + */ + public static EmailLinksValidateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailLinksValidateReq.class); + } + + /** + * Convert an instance of EmailLinksValidateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailTemplateCreateReq.java b/src/main/java/com/corbado/generated/model/EmailTemplateCreateReq.java new file mode 100644 index 0000000..c617ca3 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailTemplateCreateReq.java @@ -0,0 +1,806 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailTemplateCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailTemplateCreateReq { + /** + * Gets or Sets lang + */ + @JsonAdapter(LangEnum.Adapter.class) + public enum LangEnum { + EN("en"), + + DE("de"), + + FR("fr"); + + private String value; + + LangEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LangEnum fromValue(String value) { + for (LangEnum b : LangEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LangEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LangEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LangEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + LangEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_LANG = "lang"; + @SerializedName(SERIALIZED_NAME_LANG) + private LangEnum lang; + + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + EMAIL_LINK("email_link"), + + EMAIL_LINK_LOGIN("email_link_login"), + + LOGIN_NOTIFICATION("login_notification"), + + PASSKEY_NOTIFICATION("passkey_notification"), + + EMAIL_CODE("email_code"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SUBJECT = "subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + private String subject; + + public static final String SERIALIZED_NAME_ACTION = "action"; + @SerializedName(SERIALIZED_NAME_ACTION) + private String action; + + public static final String SERIALIZED_NAME_PLAIN_TEXT_BODY = "plainTextBody"; + @SerializedName(SERIALIZED_NAME_PLAIN_TEXT_BODY) + private String plainTextBody; + + public static final String SERIALIZED_NAME_HTML_TEXT_TITLE = "htmlTextTitle"; + @SerializedName(SERIALIZED_NAME_HTML_TEXT_TITLE) + private String htmlTextTitle; + + public static final String SERIALIZED_NAME_HTML_TEXT_BODY = "htmlTextBody"; + @SerializedName(SERIALIZED_NAME_HTML_TEXT_BODY) + private String htmlTextBody; + + public static final String SERIALIZED_NAME_HTML_TEXT_BUTTON = "htmlTextButton"; + @SerializedName(SERIALIZED_NAME_HTML_TEXT_BUTTON) + private String htmlTextButton; + + public static final String SERIALIZED_NAME_HTML_COLOR_FONT = "htmlColorFont"; + @SerializedName(SERIALIZED_NAME_HTML_COLOR_FONT) + private String htmlColorFont; + + public static final String SERIALIZED_NAME_HTML_COLOR_BACKGROUND_OUTER = "htmlColorBackgroundOuter"; + @SerializedName(SERIALIZED_NAME_HTML_COLOR_BACKGROUND_OUTER) + private String htmlColorBackgroundOuter; + + public static final String SERIALIZED_NAME_HTML_COLOR_BACKGROUND_INNER = "htmlColorBackgroundInner"; + @SerializedName(SERIALIZED_NAME_HTML_COLOR_BACKGROUND_INNER) + private String htmlColorBackgroundInner; + + public static final String SERIALIZED_NAME_HTML_COLOR_BUTTON = "htmlColorButton"; + @SerializedName(SERIALIZED_NAME_HTML_COLOR_BUTTON) + private String htmlColorButton; + + public static final String SERIALIZED_NAME_HTML_COLOR_BUTTON_FONT = "htmlColorButtonFont"; + @SerializedName(SERIALIZED_NAME_HTML_COLOR_BUTTON_FONT) + private String htmlColorButtonFont; + + public static final String SERIALIZED_NAME_IS_DEFAULT = "isDefault"; + @SerializedName(SERIALIZED_NAME_IS_DEFAULT) + private Boolean isDefault; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public EmailTemplateCreateReq() { + } + + public EmailTemplateCreateReq lang(LangEnum lang) { + this.lang = lang; + return this; + } + + /** + * Get lang + * @return lang + **/ + @javax.annotation.Nonnull + public LangEnum getLang() { + return lang; + } + + public void setLang(LangEnum lang) { + this.lang = lang; + } + + + public EmailTemplateCreateReq type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + + public EmailTemplateCreateReq name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public EmailTemplateCreateReq subject(String subject) { + this.subject = subject; + return this; + } + + /** + * Get subject + * @return subject + **/ + @javax.annotation.Nonnull + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + + public EmailTemplateCreateReq action(String action) { + this.action = action; + return this; + } + + /** + * Get action + * @return action + **/ + @javax.annotation.Nullable + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + + public EmailTemplateCreateReq plainTextBody(String plainTextBody) { + this.plainTextBody = plainTextBody; + return this; + } + + /** + * Get plainTextBody + * @return plainTextBody + **/ + @javax.annotation.Nonnull + public String getPlainTextBody() { + return plainTextBody; + } + + public void setPlainTextBody(String plainTextBody) { + this.plainTextBody = plainTextBody; + } + + + public EmailTemplateCreateReq htmlTextTitle(String htmlTextTitle) { + this.htmlTextTitle = htmlTextTitle; + return this; + } + + /** + * Get htmlTextTitle + * @return htmlTextTitle + **/ + @javax.annotation.Nonnull + public String getHtmlTextTitle() { + return htmlTextTitle; + } + + public void setHtmlTextTitle(String htmlTextTitle) { + this.htmlTextTitle = htmlTextTitle; + } + + + public EmailTemplateCreateReq htmlTextBody(String htmlTextBody) { + this.htmlTextBody = htmlTextBody; + return this; + } + + /** + * Get htmlTextBody + * @return htmlTextBody + **/ + @javax.annotation.Nonnull + public String getHtmlTextBody() { + return htmlTextBody; + } + + public void setHtmlTextBody(String htmlTextBody) { + this.htmlTextBody = htmlTextBody; + } + + + public EmailTemplateCreateReq htmlTextButton(String htmlTextButton) { + this.htmlTextButton = htmlTextButton; + return this; + } + + /** + * Get htmlTextButton + * @return htmlTextButton + **/ + @javax.annotation.Nonnull + public String getHtmlTextButton() { + return htmlTextButton; + } + + public void setHtmlTextButton(String htmlTextButton) { + this.htmlTextButton = htmlTextButton; + } + + + public EmailTemplateCreateReq htmlColorFont(String htmlColorFont) { + this.htmlColorFont = htmlColorFont; + return this; + } + + /** + * Get htmlColorFont + * @return htmlColorFont + **/ + @javax.annotation.Nonnull + public String getHtmlColorFont() { + return htmlColorFont; + } + + public void setHtmlColorFont(String htmlColorFont) { + this.htmlColorFont = htmlColorFont; + } + + + public EmailTemplateCreateReq htmlColorBackgroundOuter(String htmlColorBackgroundOuter) { + this.htmlColorBackgroundOuter = htmlColorBackgroundOuter; + return this; + } + + /** + * Get htmlColorBackgroundOuter + * @return htmlColorBackgroundOuter + **/ + @javax.annotation.Nonnull + public String getHtmlColorBackgroundOuter() { + return htmlColorBackgroundOuter; + } + + public void setHtmlColorBackgroundOuter(String htmlColorBackgroundOuter) { + this.htmlColorBackgroundOuter = htmlColorBackgroundOuter; + } + + + public EmailTemplateCreateReq htmlColorBackgroundInner(String htmlColorBackgroundInner) { + this.htmlColorBackgroundInner = htmlColorBackgroundInner; + return this; + } + + /** + * Get htmlColorBackgroundInner + * @return htmlColorBackgroundInner + **/ + @javax.annotation.Nonnull + public String getHtmlColorBackgroundInner() { + return htmlColorBackgroundInner; + } + + public void setHtmlColorBackgroundInner(String htmlColorBackgroundInner) { + this.htmlColorBackgroundInner = htmlColorBackgroundInner; + } + + + public EmailTemplateCreateReq htmlColorButton(String htmlColorButton) { + this.htmlColorButton = htmlColorButton; + return this; + } + + /** + * Get htmlColorButton + * @return htmlColorButton + **/ + @javax.annotation.Nonnull + public String getHtmlColorButton() { + return htmlColorButton; + } + + public void setHtmlColorButton(String htmlColorButton) { + this.htmlColorButton = htmlColorButton; + } + + + public EmailTemplateCreateReq htmlColorButtonFont(String htmlColorButtonFont) { + this.htmlColorButtonFont = htmlColorButtonFont; + return this; + } + + /** + * Get htmlColorButtonFont + * @return htmlColorButtonFont + **/ + @javax.annotation.Nonnull + public String getHtmlColorButtonFont() { + return htmlColorButtonFont; + } + + public void setHtmlColorButtonFont(String htmlColorButtonFont) { + this.htmlColorButtonFont = htmlColorButtonFont; + } + + + public EmailTemplateCreateReq isDefault(Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Get isDefault + * @return isDefault + **/ + @javax.annotation.Nonnull + public Boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + } + + + public EmailTemplateCreateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public EmailTemplateCreateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailTemplateCreateReq emailTemplateCreateReq = (EmailTemplateCreateReq) o; + return Objects.equals(this.lang, emailTemplateCreateReq.lang) && + Objects.equals(this.type, emailTemplateCreateReq.type) && + Objects.equals(this.name, emailTemplateCreateReq.name) && + Objects.equals(this.subject, emailTemplateCreateReq.subject) && + Objects.equals(this.action, emailTemplateCreateReq.action) && + Objects.equals(this.plainTextBody, emailTemplateCreateReq.plainTextBody) && + Objects.equals(this.htmlTextTitle, emailTemplateCreateReq.htmlTextTitle) && + Objects.equals(this.htmlTextBody, emailTemplateCreateReq.htmlTextBody) && + Objects.equals(this.htmlTextButton, emailTemplateCreateReq.htmlTextButton) && + Objects.equals(this.htmlColorFont, emailTemplateCreateReq.htmlColorFont) && + Objects.equals(this.htmlColorBackgroundOuter, emailTemplateCreateReq.htmlColorBackgroundOuter) && + Objects.equals(this.htmlColorBackgroundInner, emailTemplateCreateReq.htmlColorBackgroundInner) && + Objects.equals(this.htmlColorButton, emailTemplateCreateReq.htmlColorButton) && + Objects.equals(this.htmlColorButtonFont, emailTemplateCreateReq.htmlColorButtonFont) && + Objects.equals(this.isDefault, emailTemplateCreateReq.isDefault) && + Objects.equals(this.requestID, emailTemplateCreateReq.requestID) && + Objects.equals(this.clientInfo, emailTemplateCreateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(lang, type, name, subject, action, plainTextBody, htmlTextTitle, htmlTextBody, htmlTextButton, htmlColorFont, htmlColorBackgroundOuter, htmlColorBackgroundInner, htmlColorButton, htmlColorButtonFont, isDefault, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailTemplateCreateReq {\n"); + sb.append(" lang: ").append(toIndentedString(lang)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" plainTextBody: ").append(toIndentedString(plainTextBody)).append("\n"); + sb.append(" htmlTextTitle: ").append(toIndentedString(htmlTextTitle)).append("\n"); + sb.append(" htmlTextBody: ").append(toIndentedString(htmlTextBody)).append("\n"); + sb.append(" htmlTextButton: ").append(toIndentedString(htmlTextButton)).append("\n"); + sb.append(" htmlColorFont: ").append(toIndentedString(htmlColorFont)).append("\n"); + sb.append(" htmlColorBackgroundOuter: ").append(toIndentedString(htmlColorBackgroundOuter)).append("\n"); + sb.append(" htmlColorBackgroundInner: ").append(toIndentedString(htmlColorBackgroundInner)).append("\n"); + sb.append(" htmlColorButton: ").append(toIndentedString(htmlColorButton)).append("\n"); + sb.append(" htmlColorButtonFont: ").append(toIndentedString(htmlColorButtonFont)).append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("lang"); + openapiFields.add("type"); + openapiFields.add("name"); + openapiFields.add("subject"); + openapiFields.add("action"); + openapiFields.add("plainTextBody"); + openapiFields.add("htmlTextTitle"); + openapiFields.add("htmlTextBody"); + openapiFields.add("htmlTextButton"); + openapiFields.add("htmlColorFont"); + openapiFields.add("htmlColorBackgroundOuter"); + openapiFields.add("htmlColorBackgroundInner"); + openapiFields.add("htmlColorButton"); + openapiFields.add("htmlColorButtonFont"); + openapiFields.add("isDefault"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("lang"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("subject"); + openapiRequiredFields.add("plainTextBody"); + openapiRequiredFields.add("htmlTextTitle"); + openapiRequiredFields.add("htmlTextBody"); + openapiRequiredFields.add("htmlTextButton"); + openapiRequiredFields.add("htmlColorFont"); + openapiRequiredFields.add("htmlColorBackgroundOuter"); + openapiRequiredFields.add("htmlColorBackgroundInner"); + openapiRequiredFields.add("htmlColorButton"); + openapiRequiredFields.add("htmlColorButtonFont"); + openapiRequiredFields.add("isDefault"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailTemplateCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailTemplateCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailTemplateCreateReq is not found in the empty JSON string", EmailTemplateCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailTemplateCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailTemplateCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailTemplateCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("lang").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lang` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lang").toString())); + } + // validate the required field `lang` + LangEnum.validateJsonElement(jsonObj.get("lang")); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("subject").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString())); + } + if ((jsonObj.get("action") != null && !jsonObj.get("action").isJsonNull()) && !jsonObj.get("action").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString())); + } + if (!jsonObj.get("plainTextBody").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plainTextBody` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plainTextBody").toString())); + } + if (!jsonObj.get("htmlTextTitle").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `htmlTextTitle` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlTextTitle").toString())); + } + if (!jsonObj.get("htmlTextBody").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `htmlTextBody` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlTextBody").toString())); + } + if (!jsonObj.get("htmlTextButton").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `htmlTextButton` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlTextButton").toString())); + } + if (!jsonObj.get("htmlColorFont").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `htmlColorFont` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlColorFont").toString())); + } + if (!jsonObj.get("htmlColorBackgroundOuter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `htmlColorBackgroundOuter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlColorBackgroundOuter").toString())); + } + if (!jsonObj.get("htmlColorBackgroundInner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `htmlColorBackgroundInner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlColorBackgroundInner").toString())); + } + if (!jsonObj.get("htmlColorButton").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `htmlColorButton` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlColorButton").toString())); + } + if (!jsonObj.get("htmlColorButtonFont").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `htmlColorButtonFont` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlColorButtonFont").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailTemplateCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailTemplateCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailTemplateCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailTemplateCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailTemplateCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailTemplateCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailTemplateCreateReq + * @throws IOException if the JSON string is invalid with respect to EmailTemplateCreateReq + */ + public static EmailTemplateCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailTemplateCreateReq.class); + } + + /** + * Convert an instance of EmailTemplateCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailTemplateCreateRsp.java b/src/main/java/com/corbado/generated/model/EmailTemplateCreateRsp.java new file mode 100644 index 0000000..2405c66 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailTemplateCreateRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.EmailTemplateCreateRspAllOfData; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailTemplateCreateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailTemplateCreateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private EmailTemplateCreateRspAllOfData data; + + public EmailTemplateCreateRsp() { + } + + public EmailTemplateCreateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public EmailTemplateCreateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public EmailTemplateCreateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public EmailTemplateCreateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public EmailTemplateCreateRsp data(EmailTemplateCreateRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public EmailTemplateCreateRspAllOfData getData() { + return data; + } + + public void setData(EmailTemplateCreateRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailTemplateCreateRsp emailTemplateCreateRsp = (EmailTemplateCreateRsp) o; + return Objects.equals(this.httpStatusCode, emailTemplateCreateRsp.httpStatusCode) && + Objects.equals(this.message, emailTemplateCreateRsp.message) && + Objects.equals(this.requestData, emailTemplateCreateRsp.requestData) && + Objects.equals(this.runtime, emailTemplateCreateRsp.runtime) && + Objects.equals(this.data, emailTemplateCreateRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailTemplateCreateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailTemplateCreateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailTemplateCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailTemplateCreateRsp is not found in the empty JSON string", EmailTemplateCreateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailTemplateCreateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailTemplateCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailTemplateCreateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + EmailTemplateCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailTemplateCreateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailTemplateCreateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailTemplateCreateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailTemplateCreateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailTemplateCreateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailTemplateCreateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailTemplateCreateRsp + * @throws IOException if the JSON string is invalid with respect to EmailTemplateCreateRsp + */ + public static EmailTemplateCreateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailTemplateCreateRsp.class); + } + + /** + * Convert an instance of EmailTemplateCreateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailTemplateCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/EmailTemplateCreateRspAllOfData.java new file mode 100644 index 0000000..8d12900 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailTemplateCreateRspAllOfData.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailTemplateCreateRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailTemplateCreateRspAllOfData { + public static final String SERIALIZED_NAME_EMAIL_TEMPLATE_I_D = "emailTemplateID"; + @SerializedName(SERIALIZED_NAME_EMAIL_TEMPLATE_I_D) + private String emailTemplateID; + + public EmailTemplateCreateRspAllOfData() { + } + + public EmailTemplateCreateRspAllOfData emailTemplateID(String emailTemplateID) { + this.emailTemplateID = emailTemplateID; + return this; + } + + /** + * Get emailTemplateID + * @return emailTemplateID + **/ + @javax.annotation.Nonnull + public String getEmailTemplateID() { + return emailTemplateID; + } + + public void setEmailTemplateID(String emailTemplateID) { + this.emailTemplateID = emailTemplateID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailTemplateCreateRspAllOfData emailTemplateCreateRspAllOfData = (EmailTemplateCreateRspAllOfData) o; + return Objects.equals(this.emailTemplateID, emailTemplateCreateRspAllOfData.emailTemplateID); + } + + @Override + public int hashCode() { + return Objects.hash(emailTemplateID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailTemplateCreateRspAllOfData {\n"); + sb.append(" emailTemplateID: ").append(toIndentedString(emailTemplateID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("emailTemplateID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("emailTemplateID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailTemplateCreateRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailTemplateCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailTemplateCreateRspAllOfData is not found in the empty JSON string", EmailTemplateCreateRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailTemplateCreateRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailTemplateCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailTemplateCreateRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("emailTemplateID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `emailTemplateID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailTemplateID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailTemplateCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailTemplateCreateRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailTemplateCreateRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailTemplateCreateRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailTemplateCreateRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailTemplateCreateRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailTemplateCreateRspAllOfData + * @throws IOException if the JSON string is invalid with respect to EmailTemplateCreateRspAllOfData + */ + public static EmailTemplateCreateRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailTemplateCreateRspAllOfData.class); + } + + /** + * Convert an instance of EmailTemplateCreateRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailTemplateDeleteReq.java b/src/main/java/com/corbado/generated/model/EmailTemplateDeleteReq.java new file mode 100644 index 0000000..a6dbdbc --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailTemplateDeleteReq.java @@ -0,0 +1,237 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailTemplateDeleteReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailTemplateDeleteReq { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public EmailTemplateDeleteReq() { + } + + public EmailTemplateDeleteReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public EmailTemplateDeleteReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailTemplateDeleteReq emailTemplateDeleteReq = (EmailTemplateDeleteReq) o; + return Objects.equals(this.requestID, emailTemplateDeleteReq.requestID) && + Objects.equals(this.clientInfo, emailTemplateDeleteReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailTemplateDeleteReq {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailTemplateDeleteReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailTemplateDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailTemplateDeleteReq is not found in the empty JSON string", EmailTemplateDeleteReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailTemplateDeleteReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailTemplateDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailTemplateDeleteReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailTemplateDeleteReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailTemplateDeleteReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailTemplateDeleteReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailTemplateDeleteReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailTemplateDeleteReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailTemplateDeleteReq + * @throws IOException if the JSON string is invalid with respect to EmailTemplateDeleteReq + */ + public static EmailTemplateDeleteReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailTemplateDeleteReq.class); + } + + /** + * Convert an instance of EmailTemplateDeleteReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmailValidationResult.java b/src/main/java/com/corbado/generated/model/EmailValidationResult.java new file mode 100644 index 0000000..ca736d9 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmailValidationResult.java @@ -0,0 +1,361 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ValidationEmail; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmailValidationResult + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmailValidationResult { + public static final String SERIALIZED_NAME_IS_VALID = "isValid"; + @SerializedName(SERIALIZED_NAME_IS_VALID) + private Boolean isValid; + + /** + * Gets or Sets validationCode + */ + @JsonAdapter(ValidationCodeEnum.Adapter.class) + public enum ValidationCodeEnum { + VALID("valid"), + + INVALID_SYNTAX("invalid_syntax"), + + NO_SUCH_HOST("no_such_host"), + + NOT_ALLOWED("not_allowed"), + + UNKNOWN("unknown"); + + private String value; + + ValidationCodeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ValidationCodeEnum fromValue(String value) { + for (ValidationCodeEnum b : ValidationCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ValidationCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ValidationCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ValidationCodeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ValidationCodeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_VALIDATION_CODE = "validationCode"; + @SerializedName(SERIALIZED_NAME_VALIDATION_CODE) + private ValidationCodeEnum validationCode; + + public static final String SERIALIZED_NAME_SUGGESTION = "suggestion"; + @SerializedName(SERIALIZED_NAME_SUGGESTION) + private String suggestion; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private ValidationEmail email; + + public EmailValidationResult() { + } + + public EmailValidationResult isValid(Boolean isValid) { + this.isValid = isValid; + return this; + } + + /** + * Get isValid + * @return isValid + **/ + @javax.annotation.Nonnull + public Boolean getIsValid() { + return isValid; + } + + public void setIsValid(Boolean isValid) { + this.isValid = isValid; + } + + + public EmailValidationResult validationCode(ValidationCodeEnum validationCode) { + this.validationCode = validationCode; + return this; + } + + /** + * Get validationCode + * @return validationCode + **/ + @javax.annotation.Nonnull + public ValidationCodeEnum getValidationCode() { + return validationCode; + } + + public void setValidationCode(ValidationCodeEnum validationCode) { + this.validationCode = validationCode; + } + + + public EmailValidationResult suggestion(String suggestion) { + this.suggestion = suggestion; + return this; + } + + /** + * Get suggestion + * @return suggestion + **/ + @javax.annotation.Nullable + public String getSuggestion() { + return suggestion; + } + + public void setSuggestion(String suggestion) { + this.suggestion = suggestion; + } + + + public EmailValidationResult email(ValidationEmail email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @javax.annotation.Nullable + public ValidationEmail getEmail() { + return email; + } + + public void setEmail(ValidationEmail email) { + this.email = email; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailValidationResult emailValidationResult = (EmailValidationResult) o; + return Objects.equals(this.isValid, emailValidationResult.isValid) && + Objects.equals(this.validationCode, emailValidationResult.validationCode) && + Objects.equals(this.suggestion, emailValidationResult.suggestion) && + Objects.equals(this.email, emailValidationResult.email); + } + + @Override + public int hashCode() { + return Objects.hash(isValid, validationCode, suggestion, email); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailValidationResult {\n"); + sb.append(" isValid: ").append(toIndentedString(isValid)).append("\n"); + sb.append(" validationCode: ").append(toIndentedString(validationCode)).append("\n"); + sb.append(" suggestion: ").append(toIndentedString(suggestion)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("isValid"); + openapiFields.add("validationCode"); + openapiFields.add("suggestion"); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("isValid"); + openapiRequiredFields.add("validationCode"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmailValidationResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailValidationResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailValidationResult is not found in the empty JSON string", EmailValidationResult.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmailValidationResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailValidationResult` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailValidationResult.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("validationCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `validationCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("validationCode").toString())); + } + // validate the required field `validationCode` + ValidationCodeEnum.validateJsonElement(jsonObj.get("validationCode")); + if ((jsonObj.get("suggestion") != null && !jsonObj.get("suggestion").isJsonNull()) && !jsonObj.get("suggestion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `suggestion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("suggestion").toString())); + } + // validate the optional field `email` + if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) { + ValidationEmail.validateJsonElement(jsonObj.get("email")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmailValidationResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailValidationResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailValidationResult.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmailValidationResult value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmailValidationResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailValidationResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailValidationResult + * @throws IOException if the JSON string is invalid with respect to EmailValidationResult + */ + public static EmailValidationResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailValidationResult.class); + } + + /** + * Convert an instance of EmailValidationResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/EmptyReq.java b/src/main/java/com/corbado/generated/model/EmptyReq.java new file mode 100644 index 0000000..5dcb975 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/EmptyReq.java @@ -0,0 +1,237 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * EmptyReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class EmptyReq { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public EmptyReq() { + } + + public EmptyReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public EmptyReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmptyReq emptyReq = (EmptyReq) o; + return Objects.equals(this.requestID, emptyReq.requestID) && + Objects.equals(this.clientInfo, emptyReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmptyReq {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EmptyReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmptyReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmptyReq is not found in the empty JSON string", EmptyReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EmptyReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmptyReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EmptyReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmptyReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmptyReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EmptyReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EmptyReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmptyReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmptyReq + * @throws IOException if the JSON string is invalid with respect to EmptyReq + */ + public static EmptyReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmptyReq.class); + } + + /** + * Convert an instance of EmptyReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ErrorRsp.java b/src/main/java/com/corbado/generated/model/ErrorRsp.java new file mode 100644 index 0000000..a9fdc57 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ErrorRsp.java @@ -0,0 +1,356 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ErrorRspAllOfError; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ErrorRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ErrorRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private Object data; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private ErrorRspAllOfError error; + + public ErrorRsp() { + } + + public ErrorRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public ErrorRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public ErrorRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public ErrorRsp data(Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(Object data) { + this.data = data; + } + + + public ErrorRsp error(ErrorRspAllOfError error) { + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nonnull + public ErrorRspAllOfError getError() { + return error; + } + + public void setError(ErrorRspAllOfError error) { + this.error = error; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorRsp errorRsp = (ErrorRsp) o; + return Objects.equals(this.httpStatusCode, errorRsp.httpStatusCode) && + Objects.equals(this.message, errorRsp.message) && + Objects.equals(this.requestData, errorRsp.requestData) && + Objects.equals(this.runtime, errorRsp.runtime) && + Objects.equals(this.data, errorRsp.data) && + Objects.equals(this.error, errorRsp.error); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + openapiFields.add("error"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("error"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ErrorRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ErrorRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorRsp is not found in the empty JSON string", ErrorRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ErrorRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `error` + ErrorRspAllOfError.validateJsonElement(jsonObj.get("error")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorRsp + * @throws IOException if the JSON string is invalid with respect to ErrorRsp + */ + public static ErrorRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorRsp.class); + } + + /** + * Convert an instance of ErrorRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java b/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java new file mode 100644 index 0000000..cbd83a3 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java @@ -0,0 +1,335 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ErrorRspAllOfErrorValidation; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ErrorRspAllOfError + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ErrorRspAllOfError { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_DETAILS = "details"; + @SerializedName(SERIALIZED_NAME_DETAILS) + private String details; + + public static final String SERIALIZED_NAME_VALIDATION = "validation"; + @SerializedName(SERIALIZED_NAME_VALIDATION) + private List validation = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LINKS = "links"; + @SerializedName(SERIALIZED_NAME_LINKS) + private List links = new ArrayList<>(); + + public ErrorRspAllOfError() { + } + + public ErrorRspAllOfError type(String type) { + this.type = type; + return this; + } + + /** + * Type of error + * @return type + **/ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + + public ErrorRspAllOfError details(String details) { + this.details = details; + return this; + } + + /** + * Details of error + * @return details + **/ + @javax.annotation.Nullable + public String getDetails() { + return details; + } + + public void setDetails(String details) { + this.details = details; + } + + + public ErrorRspAllOfError validation(List validation) { + this.validation = validation; + return this; + } + + public ErrorRspAllOfError addValidationItem(ErrorRspAllOfErrorValidation validationItem) { + if (this.validation == null) { + this.validation = new ArrayList<>(); + } + this.validation.add(validationItem); + return this; + } + + /** + * Validation errors per field + * @return validation + **/ + @javax.annotation.Nullable + public List getValidation() { + return validation; + } + + public void setValidation(List validation) { + this.validation = validation; + } + + + public ErrorRspAllOfError links(List links) { + this.links = links; + return this; + } + + public ErrorRspAllOfError addLinksItem(String linksItem) { + if (this.links == null) { + this.links = new ArrayList<>(); + } + this.links.add(linksItem); + return this; + } + + /** + * Additional links to help understand the error + * @return links + **/ + @javax.annotation.Nonnull + public List getLinks() { + return links; + } + + public void setLinks(List links) { + this.links = links; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorRspAllOfError errorRspAllOfError = (ErrorRspAllOfError) o; + return Objects.equals(this.type, errorRspAllOfError.type) && + Objects.equals(this.details, errorRspAllOfError.details) && + Objects.equals(this.validation, errorRspAllOfError.validation) && + Objects.equals(this.links, errorRspAllOfError.links); + } + + @Override + public int hashCode() { + return Objects.hash(type, details, validation, links); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorRspAllOfError {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + sb.append(" validation: ").append(toIndentedString(validation)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("details"); + openapiFields.add("validation"); + openapiFields.add("links"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("links"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ErrorRspAllOfError + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ErrorRspAllOfError.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorRspAllOfError is not found in the empty JSON string", ErrorRspAllOfError.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ErrorRspAllOfError.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorRspAllOfError` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorRspAllOfError.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("details") != null && !jsonObj.get("details").isJsonNull()) && !jsonObj.get("details").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `details` to be a primitive type in the JSON string but got `%s`", jsonObj.get("details").toString())); + } + if (jsonObj.get("validation") != null && !jsonObj.get("validation").isJsonNull()) { + JsonArray jsonArrayvalidation = jsonObj.getAsJsonArray("validation"); + if (jsonArrayvalidation != null) { + // ensure the json data is an array + if (!jsonObj.get("validation").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `validation` to be an array in the JSON string but got `%s`", jsonObj.get("validation").toString())); + } + + // validate the optional field `validation` (array) + for (int i = 0; i < jsonArrayvalidation.size(); i++) { + ErrorRspAllOfErrorValidation.validateJsonElement(jsonArrayvalidation.get(i)); + }; + } + } + // ensure the required json array is present + if (jsonObj.get("links") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("links").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `links` to be an array in the JSON string but got `%s`", jsonObj.get("links").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorRspAllOfError.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorRspAllOfError' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorRspAllOfError.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorRspAllOfError value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorRspAllOfError read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorRspAllOfError given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorRspAllOfError + * @throws IOException if the JSON string is invalid with respect to ErrorRspAllOfError + */ + public static ErrorRspAllOfError fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorRspAllOfError.class); + } + + /** + * Convert an instance of ErrorRspAllOfError to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java b/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java new file mode 100644 index 0000000..e78aa53 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java @@ -0,0 +1,244 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ErrorRspAllOfErrorValidation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ErrorRspAllOfErrorValidation { + public static final String SERIALIZED_NAME_FIELD = "field"; + @SerializedName(SERIALIZED_NAME_FIELD) + private String field; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public ErrorRspAllOfErrorValidation() { + } + + public ErrorRspAllOfErrorValidation field(String field) { + this.field = field; + return this; + } + + /** + * Get field + * @return field + **/ + @javax.annotation.Nonnull + public String getField() { + return field; + } + + public void setField(String field) { + this.field = field; + } + + + public ErrorRspAllOfErrorValidation message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorRspAllOfErrorValidation errorRspAllOfErrorValidation = (ErrorRspAllOfErrorValidation) o; + return Objects.equals(this.field, errorRspAllOfErrorValidation.field) && + Objects.equals(this.message, errorRspAllOfErrorValidation.message); + } + + @Override + public int hashCode() { + return Objects.hash(field, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorRspAllOfErrorValidation {\n"); + sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("field"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("field"); + openapiRequiredFields.add("message"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ErrorRspAllOfErrorValidation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ErrorRspAllOfErrorValidation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorRspAllOfErrorValidation is not found in the empty JSON string", ErrorRspAllOfErrorValidation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ErrorRspAllOfErrorValidation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorRspAllOfErrorValidation` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorRspAllOfErrorValidation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("field").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field").toString())); + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorRspAllOfErrorValidation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorRspAllOfErrorValidation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorRspAllOfErrorValidation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorRspAllOfErrorValidation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorRspAllOfErrorValidation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorRspAllOfErrorValidation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorRspAllOfErrorValidation + * @throws IOException if the JSON string is invalid with respect to ErrorRspAllOfErrorValidation + */ + public static ErrorRspAllOfErrorValidation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorRspAllOfErrorValidation.class); + } + + /** + * Convert an instance of ErrorRspAllOfErrorValidation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ExampleGetRsp.java b/src/main/java/com/corbado/generated/model/ExampleGetRsp.java new file mode 100644 index 0000000..ffb6c66 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ExampleGetRsp.java @@ -0,0 +1,414 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ExampleGetRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ExampleGetRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private String data; + + /** + * The extension of the compressed example file + */ + @JsonAdapter(ExtensionEnum.Adapter.class) + public enum ExtensionEnum { + ZIP("zip"), + + TAR_GZ("tar.gz"); + + private String value; + + ExtensionEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ExtensionEnum fromValue(String value) { + for (ExtensionEnum b : ExtensionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ExtensionEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ExtensionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ExtensionEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ExtensionEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EXTENSION = "extension"; + @SerializedName(SERIALIZED_NAME_EXTENSION) + private ExtensionEnum extension; + + public ExampleGetRsp() { + } + + public ExampleGetRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public ExampleGetRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public ExampleGetRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public ExampleGetRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public ExampleGetRsp data(String data) { + this.data = data; + return this; + } + + /** + * Base64 encoded data containing the compressed example file + * @return data + **/ + @javax.annotation.Nonnull + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } + + + public ExampleGetRsp extension(ExtensionEnum extension) { + this.extension = extension; + return this; + } + + /** + * The extension of the compressed example file + * @return extension + **/ + @javax.annotation.Nonnull + public ExtensionEnum getExtension() { + return extension; + } + + public void setExtension(ExtensionEnum extension) { + this.extension = extension; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExampleGetRsp exampleGetRsp = (ExampleGetRsp) o; + return Objects.equals(this.httpStatusCode, exampleGetRsp.httpStatusCode) && + Objects.equals(this.message, exampleGetRsp.message) && + Objects.equals(this.requestData, exampleGetRsp.requestData) && + Objects.equals(this.runtime, exampleGetRsp.runtime) && + Objects.equals(this.data, exampleGetRsp.data) && + Objects.equals(this.extension, exampleGetRsp.extension); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data, extension); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExampleGetRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" extension: ").append(toIndentedString(extension)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + openapiFields.add("extension"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("extension"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ExampleGetRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExampleGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ExampleGetRsp is not found in the empty JSON string", ExampleGetRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ExampleGetRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ExampleGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ExampleGetRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("data").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + if (!jsonObj.get("extension").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extension` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extension").toString())); + } + // validate the required field `extension` + ExtensionEnum.validateJsonElement(jsonObj.get("extension")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ExampleGetRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExampleGetRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ExampleGetRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ExampleGetRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ExampleGetRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ExampleGetRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExampleGetRsp + * @throws IOException if the JSON string is invalid with respect to ExampleGetRsp + */ + public static ExampleGetRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExampleGetRsp.class); + } + + /** + * Convert an instance of ExampleGetRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/FullUser.java b/src/main/java/com/corbado/generated/model/FullUser.java new file mode 100644 index 0000000..2cbf1ce --- /dev/null +++ b/src/main/java/com/corbado/generated/model/FullUser.java @@ -0,0 +1,550 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Status; +import com.corbado.generated.model.UserEmail; +import com.corbado.generated.model.UserPhoneNumber; +import com.corbado.generated.model.UserSocialAccount; +import com.corbado.generated.model.UserUsername; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * User entry with emails and phone numbers + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class FullUser { + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + private String ID; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; + @SerializedName(SERIALIZED_NAME_FULL_NAME) + private String fullName; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Status status; + + public static final String SERIALIZED_NAME_EMAILS = "emails"; + @SerializedName(SERIALIZED_NAME_EMAILS) + private List emails = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PHONE_NUMBERS = "phoneNumbers"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS) + private List phoneNumbers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_USERNAMES = "usernames"; + @SerializedName(SERIALIZED_NAME_USERNAMES) + private List usernames = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SOCIAL_ACCOUNTS = "socialAccounts"; + @SerializedName(SERIALIZED_NAME_SOCIAL_ACCOUNTS) + private List socialAccounts = new ArrayList<>(); + + public FullUser() { + } + + public FullUser ID(String ID) { + this.ID = ID; + return this; + } + + /** + * ID of the user + * @return ID + **/ + @javax.annotation.Nonnull + public String getID() { + return ID; + } + + public void setID(String ID) { + this.ID = ID; + } + + + public FullUser name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public FullUser fullName(String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + **/ + @javax.annotation.Nonnull + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + public FullUser created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public FullUser updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + public FullUser status(Status status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Status getStatus() { + return status; + } + + public void setStatus(Status status) { + this.status = status; + } + + + public FullUser emails(List emails) { + this.emails = emails; + return this; + } + + public FullUser addEmailsItem(UserEmail emailsItem) { + if (this.emails == null) { + this.emails = new ArrayList<>(); + } + this.emails.add(emailsItem); + return this; + } + + /** + * Get emails + * @return emails + **/ + @javax.annotation.Nonnull + public List getEmails() { + return emails; + } + + public void setEmails(List emails) { + this.emails = emails; + } + + + public FullUser phoneNumbers(List phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public FullUser addPhoneNumbersItem(UserPhoneNumber phoneNumbersItem) { + if (this.phoneNumbers == null) { + this.phoneNumbers = new ArrayList<>(); + } + this.phoneNumbers.add(phoneNumbersItem); + return this; + } + + /** + * Get phoneNumbers + * @return phoneNumbers + **/ + @javax.annotation.Nonnull + public List getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(List phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + + + public FullUser usernames(List usernames) { + this.usernames = usernames; + return this; + } + + public FullUser addUsernamesItem(UserUsername usernamesItem) { + if (this.usernames == null) { + this.usernames = new ArrayList<>(); + } + this.usernames.add(usernamesItem); + return this; + } + + /** + * Get usernames + * @return usernames + **/ + @javax.annotation.Nonnull + public List getUsernames() { + return usernames; + } + + public void setUsernames(List usernames) { + this.usernames = usernames; + } + + + public FullUser socialAccounts(List socialAccounts) { + this.socialAccounts = socialAccounts; + return this; + } + + public FullUser addSocialAccountsItem(UserSocialAccount socialAccountsItem) { + if (this.socialAccounts == null) { + this.socialAccounts = new ArrayList<>(); + } + this.socialAccounts.add(socialAccountsItem); + return this; + } + + /** + * Get socialAccounts + * @return socialAccounts + **/ + @javax.annotation.Nonnull + public List getSocialAccounts() { + return socialAccounts; + } + + public void setSocialAccounts(List socialAccounts) { + this.socialAccounts = socialAccounts; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FullUser fullUser = (FullUser) o; + return Objects.equals(this.ID, fullUser.ID) && + Objects.equals(this.name, fullUser.name) && + Objects.equals(this.fullName, fullUser.fullName) && + Objects.equals(this.created, fullUser.created) && + Objects.equals(this.updated, fullUser.updated) && + Objects.equals(this.status, fullUser.status) && + Objects.equals(this.emails, fullUser.emails) && + Objects.equals(this.phoneNumbers, fullUser.phoneNumbers) && + Objects.equals(this.usernames, fullUser.usernames) && + Objects.equals(this.socialAccounts, fullUser.socialAccounts); + } + + @Override + public int hashCode() { + return Objects.hash(ID, name, fullName, created, updated, status, emails, phoneNumbers, usernames, socialAccounts); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FullUser {\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" emails: ").append(toIndentedString(emails)).append("\n"); + sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); + sb.append(" usernames: ").append(toIndentedString(usernames)).append("\n"); + sb.append(" socialAccounts: ").append(toIndentedString(socialAccounts)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ID"); + openapiFields.add("name"); + openapiFields.add("fullName"); + openapiFields.add("created"); + openapiFields.add("updated"); + openapiFields.add("status"); + openapiFields.add("emails"); + openapiFields.add("phoneNumbers"); + openapiFields.add("usernames"); + openapiFields.add("socialAccounts"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ID"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("fullName"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("emails"); + openapiRequiredFields.add("phoneNumbers"); + openapiRequiredFields.add("usernames"); + openapiRequiredFields.add("socialAccounts"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FullUser + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FullUser.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FullUser is not found in the empty JSON string", FullUser.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FullUser.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FullUser` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FullUser.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("fullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + // validate the required field `status` + Status.validateJsonElement(jsonObj.get("status")); + // ensure the json data is an array + if (!jsonObj.get("emails").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `emails` to be an array in the JSON string but got `%s`", jsonObj.get("emails").toString())); + } + + JsonArray jsonArrayemails = jsonObj.getAsJsonArray("emails"); + // validate the required field `emails` (array) + for (int i = 0; i < jsonArrayemails.size(); i++) { + UserEmail.validateJsonElement(jsonArrayemails.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("phoneNumbers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `phoneNumbers` to be an array in the JSON string but got `%s`", jsonObj.get("phoneNumbers").toString())); + } + + JsonArray jsonArrayphoneNumbers = jsonObj.getAsJsonArray("phoneNumbers"); + // validate the required field `phoneNumbers` (array) + for (int i = 0; i < jsonArrayphoneNumbers.size(); i++) { + UserPhoneNumber.validateJsonElement(jsonArrayphoneNumbers.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("usernames").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `usernames` to be an array in the JSON string but got `%s`", jsonObj.get("usernames").toString())); + } + + JsonArray jsonArrayusernames = jsonObj.getAsJsonArray("usernames"); + // validate the required field `usernames` (array) + for (int i = 0; i < jsonArrayusernames.size(); i++) { + UserUsername.validateJsonElement(jsonArrayusernames.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("socialAccounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `socialAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("socialAccounts").toString())); + } + + JsonArray jsonArraysocialAccounts = jsonObj.getAsJsonArray("socialAccounts"); + // validate the required field `socialAccounts` (array) + for (int i = 0; i < jsonArraysocialAccounts.size(); i++) { + UserSocialAccount.validateJsonElement(jsonArraysocialAccounts.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FullUser.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FullUser' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FullUser.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FullUser value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FullUser read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FullUser given an JSON string + * + * @param jsonString JSON string + * @return An instance of FullUser + * @throws IOException if the JSON string is invalid with respect to FullUser + */ + public static FullUser fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FullUser.class); + } + + /** + * Convert an instance of FullUser to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/GenericRsp.java b/src/main/java/com/corbado/generated/model/GenericRsp.java new file mode 100644 index 0000000..f475fe0 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/GenericRsp.java @@ -0,0 +1,300 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * GenericRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class GenericRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public GenericRsp() { + } + + public GenericRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public GenericRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public GenericRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public GenericRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenericRsp genericRsp = (GenericRsp) o; + return Objects.equals(this.httpStatusCode, genericRsp.httpStatusCode) && + Objects.equals(this.message, genericRsp.message) && + Objects.equals(this.requestData, genericRsp.requestData) && + Objects.equals(this.runtime, genericRsp.runtime); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenericRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GenericRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GenericRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GenericRsp is not found in the empty JSON string", GenericRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!GenericRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GenericRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GenericRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GenericRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GenericRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GenericRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GenericRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GenericRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GenericRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of GenericRsp + * @throws IOException if the JSON string is invalid with respect to GenericRsp + */ + public static GenericRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GenericRsp.class); + } + + /** + * Convert an instance of GenericRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/IOSAppConfigDeleteReq.java b/src/main/java/com/corbado/generated/model/IOSAppConfigDeleteReq.java new file mode 100644 index 0000000..bc08fec --- /dev/null +++ b/src/main/java/com/corbado/generated/model/IOSAppConfigDeleteReq.java @@ -0,0 +1,237 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * IOSAppConfigDeleteReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class IOSAppConfigDeleteReq { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public IOSAppConfigDeleteReq() { + } + + public IOSAppConfigDeleteReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public IOSAppConfigDeleteReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IOSAppConfigDeleteReq iOSAppConfigDeleteReq = (IOSAppConfigDeleteReq) o; + return Objects.equals(this.requestID, iOSAppConfigDeleteReq.requestID) && + Objects.equals(this.clientInfo, iOSAppConfigDeleteReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IOSAppConfigDeleteReq {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IOSAppConfigDeleteReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IOSAppConfigDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IOSAppConfigDeleteReq is not found in the empty JSON string", IOSAppConfigDeleteReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IOSAppConfigDeleteReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IOSAppConfigDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IOSAppConfigDeleteReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IOSAppConfigDeleteReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IOSAppConfigDeleteReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IOSAppConfigDeleteReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IOSAppConfigDeleteReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IOSAppConfigDeleteReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of IOSAppConfigDeleteReq + * @throws IOException if the JSON string is invalid with respect to IOSAppConfigDeleteReq + */ + public static IOSAppConfigDeleteReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IOSAppConfigDeleteReq.class); + } + + /** + * Convert an instance of IOSAppConfigDeleteReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/IOSAppConfigItem.java b/src/main/java/com/corbado/generated/model/IOSAppConfigItem.java new file mode 100644 index 0000000..33371a8 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/IOSAppConfigItem.java @@ -0,0 +1,364 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * IOSAppConfigItem + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class IOSAppConfigItem { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; + @SerializedName(SERIALIZED_NAME_PROJECT_I_D) + private String projectID; + + public static final String SERIALIZED_NAME_APP_I_D_PREFIX = "appIDPrefix"; + @SerializedName(SERIALIZED_NAME_APP_I_D_PREFIX) + private String appIDPrefix; + + public static final String SERIALIZED_NAME_BUNDLE_I_D = "bundleID"; + @SerializedName(SERIALIZED_NAME_BUNDLE_I_D) + private String bundleID; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public IOSAppConfigItem() { + } + + public IOSAppConfigItem id(String id) { + this.id = id; + return this; + } + + /** + * ID of iOS app + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public IOSAppConfigItem projectID(String projectID) { + this.projectID = projectID; + return this; + } + + /** + * ID of project + * @return projectID + **/ + @javax.annotation.Nonnull + public String getProjectID() { + return projectID; + } + + public void setProjectID(String projectID) { + this.projectID = projectID; + } + + + public IOSAppConfigItem appIDPrefix(String appIDPrefix) { + this.appIDPrefix = appIDPrefix; + return this; + } + + /** + * Get appIDPrefix + * @return appIDPrefix + **/ + @javax.annotation.Nonnull + public String getAppIDPrefix() { + return appIDPrefix; + } + + public void setAppIDPrefix(String appIDPrefix) { + this.appIDPrefix = appIDPrefix; + } + + + public IOSAppConfigItem bundleID(String bundleID) { + this.bundleID = bundleID; + return this; + } + + /** + * Get bundleID + * @return bundleID + **/ + @javax.annotation.Nonnull + public String getBundleID() { + return bundleID; + } + + public void setBundleID(String bundleID) { + this.bundleID = bundleID; + } + + + public IOSAppConfigItem created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public IOSAppConfigItem updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IOSAppConfigItem iOSAppConfigItem = (IOSAppConfigItem) o; + return Objects.equals(this.id, iOSAppConfigItem.id) && + Objects.equals(this.projectID, iOSAppConfigItem.projectID) && + Objects.equals(this.appIDPrefix, iOSAppConfigItem.appIDPrefix) && + Objects.equals(this.bundleID, iOSAppConfigItem.bundleID) && + Objects.equals(this.created, iOSAppConfigItem.created) && + Objects.equals(this.updated, iOSAppConfigItem.updated); + } + + @Override + public int hashCode() { + return Objects.hash(id, projectID, appIDPrefix, bundleID, created, updated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IOSAppConfigItem {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); + sb.append(" appIDPrefix: ").append(toIndentedString(appIDPrefix)).append("\n"); + sb.append(" bundleID: ").append(toIndentedString(bundleID)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("projectID"); + openapiFields.add("appIDPrefix"); + openapiFields.add("bundleID"); + openapiFields.add("created"); + openapiFields.add("updated"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("projectID"); + openapiRequiredFields.add("appIDPrefix"); + openapiRequiredFields.add("bundleID"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IOSAppConfigItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IOSAppConfigItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IOSAppConfigItem is not found in the empty JSON string", IOSAppConfigItem.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IOSAppConfigItem.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IOSAppConfigItem` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IOSAppConfigItem.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("projectID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); + } + if (!jsonObj.get("appIDPrefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `appIDPrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appIDPrefix").toString())); + } + if (!jsonObj.get("bundleID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bundleID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bundleID").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IOSAppConfigItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IOSAppConfigItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IOSAppConfigItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IOSAppConfigItem value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IOSAppConfigItem read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IOSAppConfigItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of IOSAppConfigItem + * @throws IOException if the JSON string is invalid with respect to IOSAppConfigItem + */ + public static IOSAppConfigItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IOSAppConfigItem.class); + } + + /** + * Convert an instance of IOSAppConfigItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/IOSAppConfigListRsp.java b/src/main/java/com/corbado/generated/model/IOSAppConfigListRsp.java new file mode 100644 index 0000000..7aeea68 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/IOSAppConfigListRsp.java @@ -0,0 +1,378 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.IOSAppConfigItem; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * IOSAppConfigListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class IOSAppConfigListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_ROWS = "rows"; + @SerializedName(SERIALIZED_NAME_ROWS) + private List rows = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public IOSAppConfigListRsp() { + } + + public IOSAppConfigListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public IOSAppConfigListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public IOSAppConfigListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public IOSAppConfigListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public IOSAppConfigListRsp rows(List rows) { + this.rows = rows; + return this; + } + + public IOSAppConfigListRsp addRowsItem(IOSAppConfigItem rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * @return rows + **/ + @javax.annotation.Nonnull + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + + public IOSAppConfigListRsp paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IOSAppConfigListRsp iOSAppConfigListRsp = (IOSAppConfigListRsp) o; + return Objects.equals(this.httpStatusCode, iOSAppConfigListRsp.httpStatusCode) && + Objects.equals(this.message, iOSAppConfigListRsp.message) && + Objects.equals(this.requestData, iOSAppConfigListRsp.requestData) && + Objects.equals(this.runtime, iOSAppConfigListRsp.runtime) && + Objects.equals(this.rows, iOSAppConfigListRsp.rows) && + Objects.equals(this.paging, iOSAppConfigListRsp.paging); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, rows, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IOSAppConfigListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("rows"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("rows"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IOSAppConfigListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IOSAppConfigListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IOSAppConfigListRsp is not found in the empty JSON string", IOSAppConfigListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IOSAppConfigListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IOSAppConfigListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IOSAppConfigListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rows` to be an array in the JSON string but got `%s`", jsonObj.get("rows").toString())); + } + + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + // validate the required field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + IOSAppConfigItem.validateJsonElement(jsonArrayrows.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IOSAppConfigListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IOSAppConfigListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IOSAppConfigListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IOSAppConfigListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IOSAppConfigListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IOSAppConfigListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of IOSAppConfigListRsp + * @throws IOException if the JSON string is invalid with respect to IOSAppConfigListRsp + */ + public static IOSAppConfigListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IOSAppConfigListRsp.class); + } + + /** + * Convert an instance of IOSAppConfigListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/IOSAppConfigSaveReq.java b/src/main/java/com/corbado/generated/model/IOSAppConfigSaveReq.java new file mode 100644 index 0000000..7c7a3ee --- /dev/null +++ b/src/main/java/com/corbado/generated/model/IOSAppConfigSaveReq.java @@ -0,0 +1,304 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * IOSAppConfigSaveReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class IOSAppConfigSaveReq { + public static final String SERIALIZED_NAME_APP_I_D_PREFIX = "appIDPrefix"; + @SerializedName(SERIALIZED_NAME_APP_I_D_PREFIX) + private String appIDPrefix; + + public static final String SERIALIZED_NAME_BUNDLE_I_D = "bundleID"; + @SerializedName(SERIALIZED_NAME_BUNDLE_I_D) + private String bundleID; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public IOSAppConfigSaveReq() { + } + + public IOSAppConfigSaveReq appIDPrefix(String appIDPrefix) { + this.appIDPrefix = appIDPrefix; + return this; + } + + /** + * Get appIDPrefix + * @return appIDPrefix + **/ + @javax.annotation.Nonnull + public String getAppIDPrefix() { + return appIDPrefix; + } + + public void setAppIDPrefix(String appIDPrefix) { + this.appIDPrefix = appIDPrefix; + } + + + public IOSAppConfigSaveReq bundleID(String bundleID) { + this.bundleID = bundleID; + return this; + } + + /** + * Get bundleID + * @return bundleID + **/ + @javax.annotation.Nonnull + public String getBundleID() { + return bundleID; + } + + public void setBundleID(String bundleID) { + this.bundleID = bundleID; + } + + + public IOSAppConfigSaveReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public IOSAppConfigSaveReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IOSAppConfigSaveReq iOSAppConfigSaveReq = (IOSAppConfigSaveReq) o; + return Objects.equals(this.appIDPrefix, iOSAppConfigSaveReq.appIDPrefix) && + Objects.equals(this.bundleID, iOSAppConfigSaveReq.bundleID) && + Objects.equals(this.requestID, iOSAppConfigSaveReq.requestID) && + Objects.equals(this.clientInfo, iOSAppConfigSaveReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(appIDPrefix, bundleID, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IOSAppConfigSaveReq {\n"); + sb.append(" appIDPrefix: ").append(toIndentedString(appIDPrefix)).append("\n"); + sb.append(" bundleID: ").append(toIndentedString(bundleID)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("appIDPrefix"); + openapiFields.add("bundleID"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("appIDPrefix"); + openapiRequiredFields.add("bundleID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IOSAppConfigSaveReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IOSAppConfigSaveReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IOSAppConfigSaveReq is not found in the empty JSON string", IOSAppConfigSaveReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IOSAppConfigSaveReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IOSAppConfigSaveReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IOSAppConfigSaveReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("appIDPrefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `appIDPrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appIDPrefix").toString())); + } + if (!jsonObj.get("bundleID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bundleID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bundleID").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IOSAppConfigSaveReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IOSAppConfigSaveReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IOSAppConfigSaveReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IOSAppConfigSaveReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IOSAppConfigSaveReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IOSAppConfigSaveReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of IOSAppConfigSaveReq + * @throws IOException if the JSON string is invalid with respect to IOSAppConfigSaveReq + */ + public static IOSAppConfigSaveReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IOSAppConfigSaveReq.class); + } + + /** + * Convert an instance of IOSAppConfigSaveReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/IOSAppConfigSaveRsp.java b/src/main/java/com/corbado/generated/model/IOSAppConfigSaveRsp.java new file mode 100644 index 0000000..7cb1fde --- /dev/null +++ b/src/main/java/com/corbado/generated/model/IOSAppConfigSaveRsp.java @@ -0,0 +1,480 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * IOSAppConfigSaveRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class IOSAppConfigSaveRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; + @SerializedName(SERIALIZED_NAME_PROJECT_I_D) + private String projectID; + + public static final String SERIALIZED_NAME_APP_I_D_PREFIX = "appIDPrefix"; + @SerializedName(SERIALIZED_NAME_APP_I_D_PREFIX) + private String appIDPrefix; + + public static final String SERIALIZED_NAME_BUNDLE_I_D = "bundleID"; + @SerializedName(SERIALIZED_NAME_BUNDLE_I_D) + private String bundleID; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public IOSAppConfigSaveRsp() { + } + + public IOSAppConfigSaveRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public IOSAppConfigSaveRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public IOSAppConfigSaveRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public IOSAppConfigSaveRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public IOSAppConfigSaveRsp id(String id) { + this.id = id; + return this; + } + + /** + * ID of iOS app + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public IOSAppConfigSaveRsp projectID(String projectID) { + this.projectID = projectID; + return this; + } + + /** + * ID of project + * @return projectID + **/ + @javax.annotation.Nonnull + public String getProjectID() { + return projectID; + } + + public void setProjectID(String projectID) { + this.projectID = projectID; + } + + + public IOSAppConfigSaveRsp appIDPrefix(String appIDPrefix) { + this.appIDPrefix = appIDPrefix; + return this; + } + + /** + * Get appIDPrefix + * @return appIDPrefix + **/ + @javax.annotation.Nonnull + public String getAppIDPrefix() { + return appIDPrefix; + } + + public void setAppIDPrefix(String appIDPrefix) { + this.appIDPrefix = appIDPrefix; + } + + + public IOSAppConfigSaveRsp bundleID(String bundleID) { + this.bundleID = bundleID; + return this; + } + + /** + * Get bundleID + * @return bundleID + **/ + @javax.annotation.Nonnull + public String getBundleID() { + return bundleID; + } + + public void setBundleID(String bundleID) { + this.bundleID = bundleID; + } + + + public IOSAppConfigSaveRsp created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public IOSAppConfigSaveRsp updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IOSAppConfigSaveRsp iOSAppConfigSaveRsp = (IOSAppConfigSaveRsp) o; + return Objects.equals(this.httpStatusCode, iOSAppConfigSaveRsp.httpStatusCode) && + Objects.equals(this.message, iOSAppConfigSaveRsp.message) && + Objects.equals(this.requestData, iOSAppConfigSaveRsp.requestData) && + Objects.equals(this.runtime, iOSAppConfigSaveRsp.runtime) && + Objects.equals(this.id, iOSAppConfigSaveRsp.id) && + Objects.equals(this.projectID, iOSAppConfigSaveRsp.projectID) && + Objects.equals(this.appIDPrefix, iOSAppConfigSaveRsp.appIDPrefix) && + Objects.equals(this.bundleID, iOSAppConfigSaveRsp.bundleID) && + Objects.equals(this.created, iOSAppConfigSaveRsp.created) && + Objects.equals(this.updated, iOSAppConfigSaveRsp.updated); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, id, projectID, appIDPrefix, bundleID, created, updated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IOSAppConfigSaveRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); + sb.append(" appIDPrefix: ").append(toIndentedString(appIDPrefix)).append("\n"); + sb.append(" bundleID: ").append(toIndentedString(bundleID)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("id"); + openapiFields.add("projectID"); + openapiFields.add("appIDPrefix"); + openapiFields.add("bundleID"); + openapiFields.add("created"); + openapiFields.add("updated"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("projectID"); + openapiRequiredFields.add("appIDPrefix"); + openapiRequiredFields.add("bundleID"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IOSAppConfigSaveRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IOSAppConfigSaveRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IOSAppConfigSaveRsp is not found in the empty JSON string", IOSAppConfigSaveRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IOSAppConfigSaveRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IOSAppConfigSaveRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IOSAppConfigSaveRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("projectID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); + } + if (!jsonObj.get("appIDPrefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `appIDPrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appIDPrefix").toString())); + } + if (!jsonObj.get("bundleID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bundleID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bundleID").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IOSAppConfigSaveRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IOSAppConfigSaveRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IOSAppConfigSaveRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IOSAppConfigSaveRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IOSAppConfigSaveRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IOSAppConfigSaveRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of IOSAppConfigSaveRsp + * @throws IOException if the JSON string is invalid with respect to IOSAppConfigSaveRsp + */ + public static IOSAppConfigSaveRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IOSAppConfigSaveRsp.class); + } + + /** + * Convert an instance of IOSAppConfigSaveRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/IOSAppConfigUpdateReq.java b/src/main/java/com/corbado/generated/model/IOSAppConfigUpdateReq.java new file mode 100644 index 0000000..2c62d83 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/IOSAppConfigUpdateReq.java @@ -0,0 +1,304 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * IOSAppConfigUpdateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class IOSAppConfigUpdateReq { + public static final String SERIALIZED_NAME_APP_I_D_PREFIX = "appIDPrefix"; + @SerializedName(SERIALIZED_NAME_APP_I_D_PREFIX) + private String appIDPrefix; + + public static final String SERIALIZED_NAME_BUNDLE_I_D = "bundleID"; + @SerializedName(SERIALIZED_NAME_BUNDLE_I_D) + private String bundleID; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public IOSAppConfigUpdateReq() { + } + + public IOSAppConfigUpdateReq appIDPrefix(String appIDPrefix) { + this.appIDPrefix = appIDPrefix; + return this; + } + + /** + * Get appIDPrefix + * @return appIDPrefix + **/ + @javax.annotation.Nonnull + public String getAppIDPrefix() { + return appIDPrefix; + } + + public void setAppIDPrefix(String appIDPrefix) { + this.appIDPrefix = appIDPrefix; + } + + + public IOSAppConfigUpdateReq bundleID(String bundleID) { + this.bundleID = bundleID; + return this; + } + + /** + * Get bundleID + * @return bundleID + **/ + @javax.annotation.Nonnull + public String getBundleID() { + return bundleID; + } + + public void setBundleID(String bundleID) { + this.bundleID = bundleID; + } + + + public IOSAppConfigUpdateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public IOSAppConfigUpdateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IOSAppConfigUpdateReq iOSAppConfigUpdateReq = (IOSAppConfigUpdateReq) o; + return Objects.equals(this.appIDPrefix, iOSAppConfigUpdateReq.appIDPrefix) && + Objects.equals(this.bundleID, iOSAppConfigUpdateReq.bundleID) && + Objects.equals(this.requestID, iOSAppConfigUpdateReq.requestID) && + Objects.equals(this.clientInfo, iOSAppConfigUpdateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(appIDPrefix, bundleID, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IOSAppConfigUpdateReq {\n"); + sb.append(" appIDPrefix: ").append(toIndentedString(appIDPrefix)).append("\n"); + sb.append(" bundleID: ").append(toIndentedString(bundleID)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("appIDPrefix"); + openapiFields.add("bundleID"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("appIDPrefix"); + openapiRequiredFields.add("bundleID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IOSAppConfigUpdateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IOSAppConfigUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IOSAppConfigUpdateReq is not found in the empty JSON string", IOSAppConfigUpdateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IOSAppConfigUpdateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IOSAppConfigUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IOSAppConfigUpdateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("appIDPrefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `appIDPrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appIDPrefix").toString())); + } + if (!jsonObj.get("bundleID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bundleID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bundleID").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IOSAppConfigUpdateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IOSAppConfigUpdateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IOSAppConfigUpdateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IOSAppConfigUpdateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IOSAppConfigUpdateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IOSAppConfigUpdateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of IOSAppConfigUpdateReq + * @throws IOException if the JSON string is invalid with respect to IOSAppConfigUpdateReq + */ + public static IOSAppConfigUpdateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IOSAppConfigUpdateReq.class); + } + + /** + * Convert an instance of IOSAppConfigUpdateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/IOSAppConfigUpdateRsp.java b/src/main/java/com/corbado/generated/model/IOSAppConfigUpdateRsp.java new file mode 100644 index 0000000..03e404b --- /dev/null +++ b/src/main/java/com/corbado/generated/model/IOSAppConfigUpdateRsp.java @@ -0,0 +1,480 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * IOSAppConfigUpdateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class IOSAppConfigUpdateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; + @SerializedName(SERIALIZED_NAME_PROJECT_I_D) + private String projectID; + + public static final String SERIALIZED_NAME_APP_I_D_PREFIX = "appIDPrefix"; + @SerializedName(SERIALIZED_NAME_APP_I_D_PREFIX) + private String appIDPrefix; + + public static final String SERIALIZED_NAME_BUNDLE_I_D = "bundleID"; + @SerializedName(SERIALIZED_NAME_BUNDLE_I_D) + private String bundleID; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public IOSAppConfigUpdateRsp() { + } + + public IOSAppConfigUpdateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public IOSAppConfigUpdateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public IOSAppConfigUpdateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public IOSAppConfigUpdateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public IOSAppConfigUpdateRsp id(String id) { + this.id = id; + return this; + } + + /** + * ID of iOS app + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public IOSAppConfigUpdateRsp projectID(String projectID) { + this.projectID = projectID; + return this; + } + + /** + * ID of project + * @return projectID + **/ + @javax.annotation.Nonnull + public String getProjectID() { + return projectID; + } + + public void setProjectID(String projectID) { + this.projectID = projectID; + } + + + public IOSAppConfigUpdateRsp appIDPrefix(String appIDPrefix) { + this.appIDPrefix = appIDPrefix; + return this; + } + + /** + * Get appIDPrefix + * @return appIDPrefix + **/ + @javax.annotation.Nonnull + public String getAppIDPrefix() { + return appIDPrefix; + } + + public void setAppIDPrefix(String appIDPrefix) { + this.appIDPrefix = appIDPrefix; + } + + + public IOSAppConfigUpdateRsp bundleID(String bundleID) { + this.bundleID = bundleID; + return this; + } + + /** + * Get bundleID + * @return bundleID + **/ + @javax.annotation.Nonnull + public String getBundleID() { + return bundleID; + } + + public void setBundleID(String bundleID) { + this.bundleID = bundleID; + } + + + public IOSAppConfigUpdateRsp created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public IOSAppConfigUpdateRsp updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IOSAppConfigUpdateRsp iOSAppConfigUpdateRsp = (IOSAppConfigUpdateRsp) o; + return Objects.equals(this.httpStatusCode, iOSAppConfigUpdateRsp.httpStatusCode) && + Objects.equals(this.message, iOSAppConfigUpdateRsp.message) && + Objects.equals(this.requestData, iOSAppConfigUpdateRsp.requestData) && + Objects.equals(this.runtime, iOSAppConfigUpdateRsp.runtime) && + Objects.equals(this.id, iOSAppConfigUpdateRsp.id) && + Objects.equals(this.projectID, iOSAppConfigUpdateRsp.projectID) && + Objects.equals(this.appIDPrefix, iOSAppConfigUpdateRsp.appIDPrefix) && + Objects.equals(this.bundleID, iOSAppConfigUpdateRsp.bundleID) && + Objects.equals(this.created, iOSAppConfigUpdateRsp.created) && + Objects.equals(this.updated, iOSAppConfigUpdateRsp.updated); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, id, projectID, appIDPrefix, bundleID, created, updated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IOSAppConfigUpdateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); + sb.append(" appIDPrefix: ").append(toIndentedString(appIDPrefix)).append("\n"); + sb.append(" bundleID: ").append(toIndentedString(bundleID)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("id"); + openapiFields.add("projectID"); + openapiFields.add("appIDPrefix"); + openapiFields.add("bundleID"); + openapiFields.add("created"); + openapiFields.add("updated"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("projectID"); + openapiRequiredFields.add("appIDPrefix"); + openapiRequiredFields.add("bundleID"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IOSAppConfigUpdateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IOSAppConfigUpdateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IOSAppConfigUpdateRsp is not found in the empty JSON string", IOSAppConfigUpdateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IOSAppConfigUpdateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IOSAppConfigUpdateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IOSAppConfigUpdateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("projectID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); + } + if (!jsonObj.get("appIDPrefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `appIDPrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appIDPrefix").toString())); + } + if (!jsonObj.get("bundleID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bundleID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bundleID").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IOSAppConfigUpdateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IOSAppConfigUpdateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IOSAppConfigUpdateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IOSAppConfigUpdateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IOSAppConfigUpdateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IOSAppConfigUpdateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of IOSAppConfigUpdateRsp + * @throws IOException if the JSON string is invalid with respect to IOSAppConfigUpdateRsp + */ + public static IOSAppConfigUpdateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IOSAppConfigUpdateRsp.class); + } + + /** + * Convert an instance of IOSAppConfigUpdateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/LoginIdentifierType.java b/src/main/java/com/corbado/generated/model/LoginIdentifierType.java new file mode 100644 index 0000000..fb2bdf3 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/LoginIdentifierType.java @@ -0,0 +1,80 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Login Identifier type + */ +@JsonAdapter(LoginIdentifierType.Adapter.class) +public enum LoginIdentifierType { + + EMAIL("email"), + + PHONE_NUMBER("phone_number"), + + CUSTOM("custom"); + + private String value; + + LoginIdentifierType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LoginIdentifierType fromValue(String value) { + for (LoginIdentifierType b : LoginIdentifierType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LoginIdentifierType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LoginIdentifierType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LoginIdentifierType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + LoginIdentifierType.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/LongSession.java b/src/main/java/com/corbado/generated/model/LongSession.java new file mode 100644 index 0000000..8c404cc --- /dev/null +++ b/src/main/java/com/corbado/generated/model/LongSession.java @@ -0,0 +1,514 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * LongSession + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class LongSession { + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + private String ID; + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_USER_IDENTIFIER = "userIdentifier"; + @SerializedName(SERIALIZED_NAME_USER_IDENTIFIER) + private String userIdentifier; + + public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; + @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) + private String userFullName; + + public static final String SERIALIZED_NAME_EXPIRES = "expires"; + @SerializedName(SERIALIZED_NAME_EXPIRES) + private String expires; + + public static final String SERIALIZED_NAME_LAST_ACTION = "lastAction"; + @SerializedName(SERIALIZED_NAME_LAST_ACTION) + private String lastAction; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + /** + * status values of a long session + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACTIVE("active"), + + LOGGED_OUT("logged_out"), + + EXPIRED("expired"), + + INACTIVITY_REACHED("inactivity_reached"), + + REVOKED("revoked"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public LongSession() { + } + + public LongSession ID(String ID) { + this.ID = ID; + return this; + } + + /** + * Get ID + * @return ID + **/ + @javax.annotation.Nonnull + public String getID() { + return ID; + } + + public void setID(String ID) { + this.ID = ID; + } + + + public LongSession userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + **/ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public LongSession userIdentifier(String userIdentifier) { + this.userIdentifier = userIdentifier; + return this; + } + + /** + * Get userIdentifier + * @return userIdentifier + **/ + @javax.annotation.Nonnull + public String getUserIdentifier() { + return userIdentifier; + } + + public void setUserIdentifier(String userIdentifier) { + this.userIdentifier = userIdentifier; + } + + + public LongSession userFullName(String userFullName) { + this.userFullName = userFullName; + return this; + } + + /** + * Get userFullName + * @return userFullName + **/ + @javax.annotation.Nonnull + public String getUserFullName() { + return userFullName; + } + + public void setUserFullName(String userFullName) { + this.userFullName = userFullName; + } + + + public LongSession expires(String expires) { + this.expires = expires; + return this; + } + + /** + * Timestamp of when long session expires in yyyy-MM-dd'T'HH:mm:ss format + * @return expires + **/ + @javax.annotation.Nonnull + public String getExpires() { + return expires; + } + + public void setExpires(String expires) { + this.expires = expires; + } + + + public LongSession lastAction(String lastAction) { + this.lastAction = lastAction; + return this; + } + + /** + * Timestamp of when last action was done on long session in yyyy-MM-dd'T'HH:mm:ss format + * @return lastAction + **/ + @javax.annotation.Nonnull + public String getLastAction() { + return lastAction; + } + + public void setLastAction(String lastAction) { + this.lastAction = lastAction; + } + + + public LongSession created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public LongSession updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + public LongSession status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * status values of a long session + * @return status + **/ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LongSession longSession = (LongSession) o; + return Objects.equals(this.ID, longSession.ID) && + Objects.equals(this.userID, longSession.userID) && + Objects.equals(this.userIdentifier, longSession.userIdentifier) && + Objects.equals(this.userFullName, longSession.userFullName) && + Objects.equals(this.expires, longSession.expires) && + Objects.equals(this.lastAction, longSession.lastAction) && + Objects.equals(this.created, longSession.created) && + Objects.equals(this.updated, longSession.updated) && + Objects.equals(this.status, longSession.status); + } + + @Override + public int hashCode() { + return Objects.hash(ID, userID, userIdentifier, userFullName, expires, lastAction, created, updated, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LongSession {\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" userIdentifier: ").append(toIndentedString(userIdentifier)).append("\n"); + sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); + sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); + sb.append(" lastAction: ").append(toIndentedString(lastAction)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ID"); + openapiFields.add("userID"); + openapiFields.add("userIdentifier"); + openapiFields.add("userFullName"); + openapiFields.add("expires"); + openapiFields.add("lastAction"); + openapiFields.add("created"); + openapiFields.add("updated"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ID"); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("userIdentifier"); + openapiRequiredFields.add("userFullName"); + openapiRequiredFields.add("expires"); + openapiRequiredFields.add("lastAction"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to LongSession + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LongSession.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LongSession is not found in the empty JSON string", LongSession.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!LongSession.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSession` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LongSession.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("userIdentifier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userIdentifier").toString())); + } + if (!jsonObj.get("userFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); + } + if (!jsonObj.get("expires").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expires` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expires").toString())); + } + if (!jsonObj.get("lastAction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastAction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastAction").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LongSession.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LongSession' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LongSession.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LongSession value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LongSession read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LongSession given an JSON string + * + * @param jsonString JSON string + * @return An instance of LongSession + * @throws IOException if the JSON string is invalid with respect to LongSession + */ + public static LongSession fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LongSession.class); + } + + /** + * Convert an instance of LongSession to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/LongSessionGetRsp.java b/src/main/java/com/corbado/generated/model/LongSessionGetRsp.java new file mode 100644 index 0000000..b88377d --- /dev/null +++ b/src/main/java/com/corbado/generated/model/LongSessionGetRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.LongSessionGetRspAllOfData; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * LongSessionGetRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class LongSessionGetRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private LongSessionGetRspAllOfData data; + + public LongSessionGetRsp() { + } + + public LongSessionGetRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public LongSessionGetRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public LongSessionGetRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public LongSessionGetRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public LongSessionGetRsp data(LongSessionGetRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public LongSessionGetRspAllOfData getData() { + return data; + } + + public void setData(LongSessionGetRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LongSessionGetRsp longSessionGetRsp = (LongSessionGetRsp) o; + return Objects.equals(this.httpStatusCode, longSessionGetRsp.httpStatusCode) && + Objects.equals(this.message, longSessionGetRsp.message) && + Objects.equals(this.requestData, longSessionGetRsp.requestData) && + Objects.equals(this.runtime, longSessionGetRsp.runtime) && + Objects.equals(this.data, longSessionGetRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LongSessionGetRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to LongSessionGetRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LongSessionGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LongSessionGetRsp is not found in the empty JSON string", LongSessionGetRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!LongSessionGetRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSessionGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LongSessionGetRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + LongSessionGetRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LongSessionGetRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LongSessionGetRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LongSessionGetRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LongSessionGetRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LongSessionGetRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LongSessionGetRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of LongSessionGetRsp + * @throws IOException if the JSON string is invalid with respect to LongSessionGetRsp + */ + public static LongSessionGetRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LongSessionGetRsp.class); + } + + /** + * Convert an instance of LongSessionGetRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/LongSessionGetRspAllOfData.java b/src/main/java/com/corbado/generated/model/LongSessionGetRspAllOfData.java new file mode 100644 index 0000000..5b3bcef --- /dev/null +++ b/src/main/java/com/corbado/generated/model/LongSessionGetRspAllOfData.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.LongSession; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * LongSessionGetRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class LongSessionGetRspAllOfData { + public static final String SERIALIZED_NAME_LONG_SESSION = "longSession"; + @SerializedName(SERIALIZED_NAME_LONG_SESSION) + private LongSession longSession; + + public LongSessionGetRspAllOfData() { + } + + public LongSessionGetRspAllOfData longSession(LongSession longSession) { + this.longSession = longSession; + return this; + } + + /** + * Get longSession + * @return longSession + **/ + @javax.annotation.Nonnull + public LongSession getLongSession() { + return longSession; + } + + public void setLongSession(LongSession longSession) { + this.longSession = longSession; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LongSessionGetRspAllOfData longSessionGetRspAllOfData = (LongSessionGetRspAllOfData) o; + return Objects.equals(this.longSession, longSessionGetRspAllOfData.longSession); + } + + @Override + public int hashCode() { + return Objects.hash(longSession); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LongSessionGetRspAllOfData {\n"); + sb.append(" longSession: ").append(toIndentedString(longSession)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("longSession"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("longSession"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to LongSessionGetRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LongSessionGetRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LongSessionGetRspAllOfData is not found in the empty JSON string", LongSessionGetRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!LongSessionGetRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSessionGetRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LongSessionGetRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `longSession` + LongSession.validateJsonElement(jsonObj.get("longSession")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LongSessionGetRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LongSessionGetRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LongSessionGetRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LongSessionGetRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LongSessionGetRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LongSessionGetRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of LongSessionGetRspAllOfData + * @throws IOException if the JSON string is invalid with respect to LongSessionGetRspAllOfData + */ + public static LongSessionGetRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LongSessionGetRspAllOfData.class); + } + + /** + * Convert an instance of LongSessionGetRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/LongSessionListRsp.java b/src/main/java/com/corbado/generated/model/LongSessionListRsp.java new file mode 100644 index 0000000..0d97a17 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/LongSessionListRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.LongSessionListRspAllOfData; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * LongSessionListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class LongSessionListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private LongSessionListRspAllOfData data; + + public LongSessionListRsp() { + } + + public LongSessionListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public LongSessionListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public LongSessionListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public LongSessionListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public LongSessionListRsp data(LongSessionListRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public LongSessionListRspAllOfData getData() { + return data; + } + + public void setData(LongSessionListRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LongSessionListRsp longSessionListRsp = (LongSessionListRsp) o; + return Objects.equals(this.httpStatusCode, longSessionListRsp.httpStatusCode) && + Objects.equals(this.message, longSessionListRsp.message) && + Objects.equals(this.requestData, longSessionListRsp.requestData) && + Objects.equals(this.runtime, longSessionListRsp.runtime) && + Objects.equals(this.data, longSessionListRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LongSessionListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to LongSessionListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LongSessionListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LongSessionListRsp is not found in the empty JSON string", LongSessionListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!LongSessionListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSessionListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LongSessionListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + LongSessionListRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LongSessionListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LongSessionListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LongSessionListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LongSessionListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LongSessionListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LongSessionListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of LongSessionListRsp + * @throws IOException if the JSON string is invalid with respect to LongSessionListRsp + */ + public static LongSessionListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LongSessionListRsp.class); + } + + /** + * Convert an instance of LongSessionListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/LongSessionListRspAllOfData.java b/src/main/java/com/corbado/generated/model/LongSessionListRspAllOfData.java new file mode 100644 index 0000000..71b98fa --- /dev/null +++ b/src/main/java/com/corbado/generated/model/LongSessionListRspAllOfData.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.LongSession; +import com.corbado.generated.model.Paging; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * LongSessionListRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class LongSessionListRspAllOfData { + public static final String SERIALIZED_NAME_LONG_SESSIONS = "longSessions"; + @SerializedName(SERIALIZED_NAME_LONG_SESSIONS) + private List longSessions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public LongSessionListRspAllOfData() { + } + + public LongSessionListRspAllOfData longSessions(List longSessions) { + this.longSessions = longSessions; + return this; + } + + public LongSessionListRspAllOfData addLongSessionsItem(LongSession longSessionsItem) { + if (this.longSessions == null) { + this.longSessions = new ArrayList<>(); + } + this.longSessions.add(longSessionsItem); + return this; + } + + /** + * Get longSessions + * @return longSessions + **/ + @javax.annotation.Nonnull + public List getLongSessions() { + return longSessions; + } + + public void setLongSessions(List longSessions) { + this.longSessions = longSessions; + } + + + public LongSessionListRspAllOfData paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LongSessionListRspAllOfData longSessionListRspAllOfData = (LongSessionListRspAllOfData) o; + return Objects.equals(this.longSessions, longSessionListRspAllOfData.longSessions) && + Objects.equals(this.paging, longSessionListRspAllOfData.paging); + } + + @Override + public int hashCode() { + return Objects.hash(longSessions, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LongSessionListRspAllOfData {\n"); + sb.append(" longSessions: ").append(toIndentedString(longSessions)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("longSessions"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("longSessions"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to LongSessionListRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LongSessionListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LongSessionListRspAllOfData is not found in the empty JSON string", LongSessionListRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!LongSessionListRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSessionListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LongSessionListRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("longSessions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `longSessions` to be an array in the JSON string but got `%s`", jsonObj.get("longSessions").toString())); + } + + JsonArray jsonArraylongSessions = jsonObj.getAsJsonArray("longSessions"); + // validate the required field `longSessions` (array) + for (int i = 0; i < jsonArraylongSessions.size(); i++) { + LongSession.validateJsonElement(jsonArraylongSessions.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LongSessionListRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LongSessionListRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LongSessionListRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LongSessionListRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LongSessionListRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LongSessionListRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of LongSessionListRspAllOfData + * @throws IOException if the JSON string is invalid with respect to LongSessionListRspAllOfData + */ + public static LongSessionListRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LongSessionListRspAllOfData.class); + } + + /** + * Convert an instance of LongSessionListRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/LongSessionRevokeReq.java b/src/main/java/com/corbado/generated/model/LongSessionRevokeReq.java new file mode 100644 index 0000000..0642413 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/LongSessionRevokeReq.java @@ -0,0 +1,237 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * LongSessionRevokeReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class LongSessionRevokeReq { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public LongSessionRevokeReq() { + } + + public LongSessionRevokeReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public LongSessionRevokeReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LongSessionRevokeReq longSessionRevokeReq = (LongSessionRevokeReq) o; + return Objects.equals(this.requestID, longSessionRevokeReq.requestID) && + Objects.equals(this.clientInfo, longSessionRevokeReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LongSessionRevokeReq {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to LongSessionRevokeReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LongSessionRevokeReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LongSessionRevokeReq is not found in the empty JSON string", LongSessionRevokeReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!LongSessionRevokeReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSessionRevokeReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LongSessionRevokeReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LongSessionRevokeReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LongSessionRevokeReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LongSessionRevokeReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LongSessionRevokeReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LongSessionRevokeReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of LongSessionRevokeReq + * @throws IOException if the JSON string is invalid with respect to LongSessionRevokeReq + */ + public static LongSessionRevokeReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LongSessionRevokeReq.class); + } + + /** + * Convert an instance of LongSessionRevokeReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/Paging.java b/src/main/java/com/corbado/generated/model/Paging.java new file mode 100644 index 0000000..5b74878 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/Paging.java @@ -0,0 +1,265 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * Paging + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class Paging { + public static final String SERIALIZED_NAME_PAGE = "page"; + @SerializedName(SERIALIZED_NAME_PAGE) + private Integer page = 1; + + public static final String SERIALIZED_NAME_TOTAL_PAGES = "totalPages"; + @SerializedName(SERIALIZED_NAME_TOTAL_PAGES) + private Integer totalPages; + + public static final String SERIALIZED_NAME_TOTAL_ITEMS = "totalItems"; + @SerializedName(SERIALIZED_NAME_TOTAL_ITEMS) + private Integer totalItems; + + public Paging() { + } + + public Paging page(Integer page) { + this.page = page; + return this; + } + + /** + * current page returned in response + * @return page + **/ + @javax.annotation.Nonnull + public Integer getPage() { + return page; + } + + public void setPage(Integer page) { + this.page = page; + } + + + public Paging totalPages(Integer totalPages) { + this.totalPages = totalPages; + return this; + } + + /** + * total number of pages available + * @return totalPages + **/ + @javax.annotation.Nonnull + public Integer getTotalPages() { + return totalPages; + } + + public void setTotalPages(Integer totalPages) { + this.totalPages = totalPages; + } + + + public Paging totalItems(Integer totalItems) { + this.totalItems = totalItems; + return this; + } + + /** + * total number of items available + * @return totalItems + **/ + @javax.annotation.Nonnull + public Integer getTotalItems() { + return totalItems; + } + + public void setTotalItems(Integer totalItems) { + this.totalItems = totalItems; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Paging paging = (Paging) o; + return Objects.equals(this.page, paging.page) && + Objects.equals(this.totalPages, paging.totalPages) && + Objects.equals(this.totalItems, paging.totalItems); + } + + @Override + public int hashCode() { + return Objects.hash(page, totalPages, totalItems); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Paging {\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" totalPages: ").append(toIndentedString(totalPages)).append("\n"); + sb.append(" totalItems: ").append(toIndentedString(totalItems)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("page"); + openapiFields.add("totalPages"); + openapiFields.add("totalItems"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("page"); + openapiRequiredFields.add("totalPages"); + openapiRequiredFields.add("totalItems"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Paging + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Paging.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Paging is not found in the empty JSON string", Paging.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Paging.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Paging` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Paging.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Paging.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Paging' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Paging.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Paging value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Paging read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Paging given an JSON string + * + * @param jsonString JSON string + * @return An instance of Paging + * @throws IOException if the JSON string is invalid with respect to Paging + */ + public static Paging fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Paging.class); + } + + /** + * Convert an instance of Paging to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PhoneNumber.java b/src/main/java/com/corbado/generated/model/PhoneNumber.java new file mode 100644 index 0000000..88310e4 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PhoneNumber.java @@ -0,0 +1,334 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Status; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PhoneNumber + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class PhoneNumber { + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + private String ID; + + public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) + private String phoneNumber; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Status status; + + public PhoneNumber() { + } + + public PhoneNumber ID(String ID) { + this.ID = ID; + return this; + } + + /** + * ID of the phone number + * @return ID + **/ + @javax.annotation.Nonnull + public String getID() { + return ID; + } + + public void setID(String ID) { + this.ID = ID; + } + + + public PhoneNumber phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get phoneNumber + * @return phoneNumber + **/ + @javax.annotation.Nonnull + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + + public PhoneNumber created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public PhoneNumber updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + public PhoneNumber status(Status status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Status getStatus() { + return status; + } + + public void setStatus(Status status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhoneNumber phoneNumber = (PhoneNumber) o; + return Objects.equals(this.ID, phoneNumber.ID) && + Objects.equals(this.phoneNumber, phoneNumber.phoneNumber) && + Objects.equals(this.created, phoneNumber.created) && + Objects.equals(this.updated, phoneNumber.updated) && + Objects.equals(this.status, phoneNumber.status); + } + + @Override + public int hashCode() { + return Objects.hash(ID, phoneNumber, created, updated, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PhoneNumber {\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ID"); + openapiFields.add("phoneNumber"); + openapiFields.add("created"); + openapiFields.add("updated"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ID"); + openapiRequiredFields.add("phoneNumber"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PhoneNumber + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PhoneNumber.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PhoneNumber is not found in the empty JSON string", PhoneNumber.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PhoneNumber.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PhoneNumber` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PhoneNumber.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (!jsonObj.get("phoneNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + // validate the required field `status` + Status.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PhoneNumber.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PhoneNumber' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PhoneNumber.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PhoneNumber value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PhoneNumber read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PhoneNumber given an JSON string + * + * @param jsonString JSON string + * @return An instance of PhoneNumber + * @throws IOException if the JSON string is invalid with respect to PhoneNumber + */ + public static PhoneNumber fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PhoneNumber.class); + } + + /** + * Convert an instance of PhoneNumber to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PhoneNumberValidationResult.java b/src/main/java/com/corbado/generated/model/PhoneNumberValidationResult.java new file mode 100644 index 0000000..5e65653 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PhoneNumberValidationResult.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ValidationPhoneNumber; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PhoneNumberValidationResult + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class PhoneNumberValidationResult { + public static final String SERIALIZED_NAME_IS_VALID = "isValid"; + @SerializedName(SERIALIZED_NAME_IS_VALID) + private Boolean isValid; + + /** + * Gets or Sets validationCode + */ + @JsonAdapter(ValidationCodeEnum.Adapter.class) + public enum ValidationCodeEnum { + VALID("valid"), + + INVALID_COUNTRY_CODE("invalid_country_code"), + + INVALID_NUMBER("invalid_number"), + + TOO_LONG("too_long"); + + private String value; + + ValidationCodeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ValidationCodeEnum fromValue(String value) { + for (ValidationCodeEnum b : ValidationCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ValidationCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ValidationCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ValidationCodeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ValidationCodeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_VALIDATION_CODE = "validationCode"; + @SerializedName(SERIALIZED_NAME_VALIDATION_CODE) + private ValidationCodeEnum validationCode; + + public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) + private ValidationPhoneNumber phoneNumber; + + public PhoneNumberValidationResult() { + } + + public PhoneNumberValidationResult isValid(Boolean isValid) { + this.isValid = isValid; + return this; + } + + /** + * Get isValid + * @return isValid + **/ + @javax.annotation.Nonnull + public Boolean getIsValid() { + return isValid; + } + + public void setIsValid(Boolean isValid) { + this.isValid = isValid; + } + + + public PhoneNumberValidationResult validationCode(ValidationCodeEnum validationCode) { + this.validationCode = validationCode; + return this; + } + + /** + * Get validationCode + * @return validationCode + **/ + @javax.annotation.Nonnull + public ValidationCodeEnum getValidationCode() { + return validationCode; + } + + public void setValidationCode(ValidationCodeEnum validationCode) { + this.validationCode = validationCode; + } + + + public PhoneNumberValidationResult phoneNumber(ValidationPhoneNumber phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get phoneNumber + * @return phoneNumber + **/ + @javax.annotation.Nullable + public ValidationPhoneNumber getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(ValidationPhoneNumber phoneNumber) { + this.phoneNumber = phoneNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhoneNumberValidationResult phoneNumberValidationResult = (PhoneNumberValidationResult) o; + return Objects.equals(this.isValid, phoneNumberValidationResult.isValid) && + Objects.equals(this.validationCode, phoneNumberValidationResult.validationCode) && + Objects.equals(this.phoneNumber, phoneNumberValidationResult.phoneNumber); + } + + @Override + public int hashCode() { + return Objects.hash(isValid, validationCode, phoneNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PhoneNumberValidationResult {\n"); + sb.append(" isValid: ").append(toIndentedString(isValid)).append("\n"); + sb.append(" validationCode: ").append(toIndentedString(validationCode)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("isValid"); + openapiFields.add("validationCode"); + openapiFields.add("phoneNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("isValid"); + openapiRequiredFields.add("validationCode"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PhoneNumberValidationResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PhoneNumberValidationResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PhoneNumberValidationResult is not found in the empty JSON string", PhoneNumberValidationResult.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PhoneNumberValidationResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PhoneNumberValidationResult` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PhoneNumberValidationResult.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("validationCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `validationCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("validationCode").toString())); + } + // validate the required field `validationCode` + ValidationCodeEnum.validateJsonElement(jsonObj.get("validationCode")); + // validate the optional field `phoneNumber` + if (jsonObj.get("phoneNumber") != null && !jsonObj.get("phoneNumber").isJsonNull()) { + ValidationPhoneNumber.validateJsonElement(jsonObj.get("phoneNumber")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PhoneNumberValidationResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PhoneNumberValidationResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PhoneNumberValidationResult.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PhoneNumberValidationResult value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PhoneNumberValidationResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PhoneNumberValidationResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of PhoneNumberValidationResult + * @throws IOException if the JSON string is invalid with respect to PhoneNumberValidationResult + */ + public static PhoneNumberValidationResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PhoneNumberValidationResult.class); + } + + /** + * Convert an instance of PhoneNumberValidationResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ProjectConfig.java b/src/main/java/com/corbado/generated/model/ProjectConfig.java new file mode 100644 index 0000000..2b072d1 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ProjectConfig.java @@ -0,0 +1,2294 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.AppType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ProjectConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ProjectConfig { + public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; + @SerializedName(SERIALIZED_NAME_PROJECT_I_D) + private String projectID; + + public static final String SERIALIZED_NAME_EXTERNAL_NAME = "externalName"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_NAME) + private String externalName; + + public static final String SERIALIZED_NAME_APP_TYPE = "appType"; + @SerializedName(SERIALIZED_NAME_APP_TYPE) + private AppType appType; + + public static final String SERIALIZED_NAME_PRODUCT_KEY = "productKey"; + @SerializedName(SERIALIZED_NAME_PRODUCT_KEY) + private String productKey; + + public static final String SERIALIZED_NAME_PROJECT_SUBSCRIPTION_I_D = "projectSubscriptionID"; + @SerializedName(SERIALIZED_NAME_PROJECT_SUBSCRIPTION_I_D) + private String projectSubscriptionID; + + public static final String SERIALIZED_NAME_EMAIL_FROM = "emailFrom"; + @SerializedName(SERIALIZED_NAME_EMAIL_FROM) + private String emailFrom; + + public static final String SERIALIZED_NAME_SMS_FROM = "smsFrom"; + @SerializedName(SERIALIZED_NAME_SMS_FROM) + private String smsFrom; + + public static final String SERIALIZED_NAME_EXTERNAL_APPLICATION_PROTOCOL_VERSION = "externalApplicationProtocolVersion"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_APPLICATION_PROTOCOL_VERSION) + private String externalApplicationProtocolVersion; + + public static final String SERIALIZED_NAME_WEBHOOK_U_R_L = "webhookURL"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_U_R_L) + private String webhookURL; + + public static final String SERIALIZED_NAME_WEBHOOK_USERNAME = "webhookUsername"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_USERNAME) + private String webhookUsername; + + public static final String SERIALIZED_NAME_WEBHOOK_PASSWORD = "webhookPassword"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_PASSWORD) + private String webhookPassword; + + public static final String SERIALIZED_NAME_WEBHOOK_TEST_INVALID_USERNAME = "webhookTestInvalidUsername"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_TEST_INVALID_USERNAME) + private String webhookTestInvalidUsername; + + public static final String SERIALIZED_NAME_WEBHOOK_TEST_VALID_USERNAME = "webhookTestValidUsername"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_TEST_VALID_USERNAME) + private String webhookTestValidUsername; + + public static final String SERIALIZED_NAME_WEBHOOK_TEST_VALID_PASSWORD = "webhookTestValidPassword"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_TEST_VALID_PASSWORD) + private String webhookTestValidPassword; + + public static final String SERIALIZED_NAME_EXTERNAL_APPLICATION_USERNAME = "externalApplicationUsername"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_APPLICATION_USERNAME) + private String externalApplicationUsername; + + public static final String SERIALIZED_NAME_EXTERNAL_APPLICATION_PASSWORD = "externalApplicationPassword"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_APPLICATION_PASSWORD) + private String externalApplicationPassword; + + public static final String SERIALIZED_NAME_LEGACY_AUTH_METHODS_URL = "legacyAuthMethodsUrl"; + @SerializedName(SERIALIZED_NAME_LEGACY_AUTH_METHODS_URL) + private String legacyAuthMethodsUrl; + + public static final String SERIALIZED_NAME_PASSWORD_VERIFY_URL = "passwordVerifyUrl"; + @SerializedName(SERIALIZED_NAME_PASSWORD_VERIFY_URL) + private String passwordVerifyUrl; + + public static final String SERIALIZED_NAME_AUTH_SUCCESS_REDIRECT_URL = "authSuccessRedirectUrl"; + @SerializedName(SERIALIZED_NAME_AUTH_SUCCESS_REDIRECT_URL) + private String authSuccessRedirectUrl; + + public static final String SERIALIZED_NAME_PASSWORD_RESET_URL = "passwordResetUrl"; + @SerializedName(SERIALIZED_NAME_PASSWORD_RESET_URL) + private String passwordResetUrl; + + public static final String SERIALIZED_NAME_ALLOW_USER_REGISTRATION = "allowUserRegistration"; + @SerializedName(SERIALIZED_NAME_ALLOW_USER_REGISTRATION) + private Boolean allowUserRegistration; + + public static final String SERIALIZED_NAME_ALLOW_I_P_STICKINESS = "allowIPStickiness"; + @SerializedName(SERIALIZED_NAME_ALLOW_I_P_STICKINESS) + private Boolean allowIPStickiness; + + /** + * Gets or Sets passkeyAppendInterval + */ + @JsonAdapter(PasskeyAppendIntervalEnum.Adapter.class) + public enum PasskeyAppendIntervalEnum { + NOT_SPECIFIED("not_specified"), + + _0D("0d"), + + _1D("1d"), + + _3D("3d"), + + _1W("1w"), + + _3W("3w"), + + _1M("1m"), + + _3M("3m"); + + private String value; + + PasskeyAppendIntervalEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PasskeyAppendIntervalEnum fromValue(String value) { + for (PasskeyAppendIntervalEnum b : PasskeyAppendIntervalEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PasskeyAppendIntervalEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PasskeyAppendIntervalEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PasskeyAppendIntervalEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PasskeyAppendIntervalEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PASSKEY_APPEND_INTERVAL = "passkeyAppendInterval"; + @SerializedName(SERIALIZED_NAME_PASSKEY_APPEND_INTERVAL) + private PasskeyAppendIntervalEnum passkeyAppendInterval; + + public static final String SERIALIZED_NAME_CLI_SECRET = "cliSecret"; + @SerializedName(SERIALIZED_NAME_CLI_SECRET) + private String cliSecret; + + public static final String SERIALIZED_NAME_FALLBACK_LANGUAGE = "fallbackLanguage"; + @SerializedName(SERIALIZED_NAME_FALLBACK_LANGUAGE) + private String fallbackLanguage; + + public static final String SERIALIZED_NAME_AUTO_DETECT_LANGUAGE = "autoDetectLanguage"; + @SerializedName(SERIALIZED_NAME_AUTO_DETECT_LANGUAGE) + private Boolean autoDetectLanguage; + + public static final String SERIALIZED_NAME_HAS_EXISTING_USERS = "hasExistingUsers"; + @SerializedName(SERIALIZED_NAME_HAS_EXISTING_USERS) + private Boolean hasExistingUsers; + + public static final String SERIALIZED_NAME_HAS_VERIFIED_SESSION = "hasVerifiedSession"; + @SerializedName(SERIALIZED_NAME_HAS_VERIFIED_SESSION) + private Boolean hasVerifiedSession; + + public static final String SERIALIZED_NAME_HAS_GENERATED_SESSION = "hasGeneratedSession"; + @SerializedName(SERIALIZED_NAME_HAS_GENERATED_SESSION) + private Boolean hasGeneratedSession; + + public static final String SERIALIZED_NAME_HAS_STARTED_USING_PASSKEYS = "hasStartedUsingPasskeys"; + @SerializedName(SERIALIZED_NAME_HAS_STARTED_USING_PASSKEYS) + private Boolean hasStartedUsingPasskeys; + + public static final String SERIALIZED_NAME_HAS_STARTED_USING_SESSIONS = "hasStartedUsingSessions"; + @SerializedName(SERIALIZED_NAME_HAS_STARTED_USING_SESSIONS) + private Boolean hasStartedUsingSessions; + + /** + * Gets or Sets environment + */ + @JsonAdapter(EnvironmentEnum.Adapter.class) + public enum EnvironmentEnum { + DEV("dev"), + + PROD("prod"); + + private String value; + + EnvironmentEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnvironmentEnum fromValue(String value) { + for (EnvironmentEnum b : EnvironmentEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnvironmentEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnvironmentEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnvironmentEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EnvironmentEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private EnvironmentEnum environment; + + /** + * Gets or Sets frontendFramework + */ + @JsonAdapter(FrontendFrameworkEnum.Adapter.class) + public enum FrontendFrameworkEnum { + NOT_SPECIFIED("not_specified"), + + REACT("react"), + + VUEJS("vuejs"), + + VANILLAJS("vanillajs"), + + ANGULAR("angular"), + + SVELTE("svelte"), + + NEXTJS("nextjs"), + + NUXTJS("nuxtjs"), + + FLUTTER("flutter"); + + private String value; + + FrontendFrameworkEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FrontendFrameworkEnum fromValue(String value) { + for (FrontendFrameworkEnum b : FrontendFrameworkEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FrontendFrameworkEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FrontendFrameworkEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FrontendFrameworkEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + FrontendFrameworkEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_FRONTEND_FRAMEWORK = "frontendFramework"; + @SerializedName(SERIALIZED_NAME_FRONTEND_FRAMEWORK) + private FrontendFrameworkEnum frontendFramework; + + /** + * Gets or Sets backendLanguage + */ + @JsonAdapter(BackendLanguageEnum.Adapter.class) + public enum BackendLanguageEnum { + NOT_SPECIFIED("not_specified"), + + JAVASCRIPT("javascript"), + + PHP("php"), + + GO("go"), + + OTHER("other"); + + private String value; + + BackendLanguageEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static BackendLanguageEnum fromValue(String value) { + for (BackendLanguageEnum b : BackendLanguageEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final BackendLanguageEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public BackendLanguageEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return BackendLanguageEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + BackendLanguageEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_BACKEND_LANGUAGE = "backendLanguage"; + @SerializedName(SERIALIZED_NAME_BACKEND_LANGUAGE) + private BackendLanguageEnum backendLanguage; + + public static final String SERIALIZED_NAME_BACKEND_A_P_I_URL = "backendAPIUrl"; + @SerializedName(SERIALIZED_NAME_BACKEND_A_P_I_URL) + private String backendAPIUrl; + + public static final String SERIALIZED_NAME_FRONTEND_A_P_I_URL = "frontendAPIUrl"; + @SerializedName(SERIALIZED_NAME_FRONTEND_A_P_I_URL) + private String frontendAPIUrl; + + public static final String SERIALIZED_NAME_APPLICATION_URL = "applicationUrl"; + @SerializedName(SERIALIZED_NAME_APPLICATION_URL) + private String applicationUrl; + + public static final String SERIALIZED_NAME_USE_CLI = "useCli"; + @SerializedName(SERIALIZED_NAME_USE_CLI) + private Boolean useCli; + + public static final String SERIALIZED_NAME_DOUBLE_OPT_IN = "doubleOptIn"; + @SerializedName(SERIALIZED_NAME_DOUBLE_OPT_IN) + private Boolean doubleOptIn; + + public static final String SERIALIZED_NAME_USER_FULL_NAME_REQUIRED = "userFullNameRequired"; + @SerializedName(SERIALIZED_NAME_USER_FULL_NAME_REQUIRED) + private Boolean userFullNameRequired; + + public static final String SERIALIZED_NAME_WEBAUTHN_R_P_I_D = "webauthnRPID"; + @SerializedName(SERIALIZED_NAME_WEBAUTHN_R_P_I_D) + private String webauthnRPID; + + public static final String SERIALIZED_NAME_CNAME = "cname"; + @SerializedName(SERIALIZED_NAME_CNAME) + private String cname; + + public static final String SERIALIZED_NAME_WEB_COMPONENT_DEBUG = "webComponentDebug"; + @SerializedName(SERIALIZED_NAME_WEB_COMPONENT_DEBUG) + private Boolean webComponentDebug; + + public static final String SERIALIZED_NAME_SMTP_USE_CUSTOM = "smtpUseCustom"; + @SerializedName(SERIALIZED_NAME_SMTP_USE_CUSTOM) + private Boolean smtpUseCustom; + + public static final String SERIALIZED_NAME_SMTP_HOST = "smtpHost"; + @SerializedName(SERIALIZED_NAME_SMTP_HOST) + private String smtpHost; + + public static final String SERIALIZED_NAME_SMTP_PORT = "smtpPort"; + @SerializedName(SERIALIZED_NAME_SMTP_PORT) + private Integer smtpPort; + + public static final String SERIALIZED_NAME_SMTP_USERNAME = "smtpUsername"; + @SerializedName(SERIALIZED_NAME_SMTP_USERNAME) + private String smtpUsername; + + public static final String SERIALIZED_NAME_SMTP_PASSWORD = "smtpPassword"; + @SerializedName(SERIALIZED_NAME_SMTP_PASSWORD) + private String smtpPassword; + + public static final String SERIALIZED_NAME_SUPPORT_EMAIL = "supportEmail"; + @SerializedName(SERIALIZED_NAME_SUPPORT_EMAIL) + private String supportEmail; + + public static final String SERIALIZED_NAME_WEBHOOK_ACTIONS = "webhookActions"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_ACTIONS) + private List webhookActions = new ArrayList<>(); + + /** + * Gets or Sets signupFlow + */ + @JsonAdapter(SignupFlowEnum.Adapter.class) + public enum SignupFlowEnum { + PASSKEY_WITH_EMAIL_OTP_FALLBACK("PasskeyWithEmailOTPFallback"), + + EMAIL_OTP_SIGNUP("EmailOTPSignup"); + + private String value; + + SignupFlowEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SignupFlowEnum fromValue(String value) { + for (SignupFlowEnum b : SignupFlowEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SignupFlowEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SignupFlowEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SignupFlowEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SignupFlowEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SIGNUP_FLOW = "signupFlow"; + @SerializedName(SERIALIZED_NAME_SIGNUP_FLOW) + private SignupFlowEnum signupFlow; + + public static final String SERIALIZED_NAME_SIGNUP_FLOW_OPTIONS = "signupFlowOptions"; + @SerializedName(SERIALIZED_NAME_SIGNUP_FLOW_OPTIONS) + private Object signupFlowOptions; + + /** + * Gets or Sets loginFlow + */ + @JsonAdapter(LoginFlowEnum.Adapter.class) + public enum LoginFlowEnum { + PASSKEY_WITH_EMAIL_OTP_FALLBACK("PasskeyWithEmailOTPFallback"); + + private String value; + + LoginFlowEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LoginFlowEnum fromValue(String value) { + for (LoginFlowEnum b : LoginFlowEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LoginFlowEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LoginFlowEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LoginFlowEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + LoginFlowEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_LOGIN_FLOW = "loginFlow"; + @SerializedName(SERIALIZED_NAME_LOGIN_FLOW) + private LoginFlowEnum loginFlow; + + public static final String SERIALIZED_NAME_LOGIN_FLOW_OPTIONS = "loginFlowOptions"; + @SerializedName(SERIALIZED_NAME_LOGIN_FLOW_OPTIONS) + private Object loginFlowOptions; + + public static final String SERIALIZED_NAME_ALLOW_STATIC_CHALLENGES = "allowStaticChallenges"; + @SerializedName(SERIALIZED_NAME_ALLOW_STATIC_CHALLENGES) + private Boolean allowStaticChallenges; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + /** + * Gets or Sets status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACTIVE("active"), + + CONFIGURING("configuring"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public ProjectConfig() { + } + + public ProjectConfig projectID(String projectID) { + this.projectID = projectID; + return this; + } + + /** + * ID of project + * @return projectID + **/ + @javax.annotation.Nonnull + public String getProjectID() { + return projectID; + } + + public void setProjectID(String projectID) { + this.projectID = projectID; + } + + + public ProjectConfig externalName(String externalName) { + this.externalName = externalName; + return this; + } + + /** + * Get externalName + * @return externalName + **/ + @javax.annotation.Nonnull + public String getExternalName() { + return externalName; + } + + public void setExternalName(String externalName) { + this.externalName = externalName; + } + + + public ProjectConfig appType(AppType appType) { + this.appType = appType; + return this; + } + + /** + * Get appType + * @return appType + **/ + @javax.annotation.Nonnull + public AppType getAppType() { + return appType; + } + + public void setAppType(AppType appType) { + this.appType = appType; + } + + + public ProjectConfig productKey(String productKey) { + this.productKey = productKey; + return this; + } + + /** + * Get productKey + * @return productKey + **/ + @javax.annotation.Nonnull + public String getProductKey() { + return productKey; + } + + public void setProductKey(String productKey) { + this.productKey = productKey; + } + + + public ProjectConfig projectSubscriptionID(String projectSubscriptionID) { + this.projectSubscriptionID = projectSubscriptionID; + return this; + } + + /** + * Get projectSubscriptionID + * @return projectSubscriptionID + **/ + @javax.annotation.Nonnull + public String getProjectSubscriptionID() { + return projectSubscriptionID; + } + + public void setProjectSubscriptionID(String projectSubscriptionID) { + this.projectSubscriptionID = projectSubscriptionID; + } + + + public ProjectConfig emailFrom(String emailFrom) { + this.emailFrom = emailFrom; + return this; + } + + /** + * Get emailFrom + * @return emailFrom + **/ + @javax.annotation.Nonnull + public String getEmailFrom() { + return emailFrom; + } + + public void setEmailFrom(String emailFrom) { + this.emailFrom = emailFrom; + } + + + public ProjectConfig smsFrom(String smsFrom) { + this.smsFrom = smsFrom; + return this; + } + + /** + * Get smsFrom + * @return smsFrom + **/ + @javax.annotation.Nonnull + public String getSmsFrom() { + return smsFrom; + } + + public void setSmsFrom(String smsFrom) { + this.smsFrom = smsFrom; + } + + + public ProjectConfig externalApplicationProtocolVersion(String externalApplicationProtocolVersion) { + this.externalApplicationProtocolVersion = externalApplicationProtocolVersion; + return this; + } + + /** + * Get externalApplicationProtocolVersion + * @return externalApplicationProtocolVersion + **/ + @javax.annotation.Nonnull + public String getExternalApplicationProtocolVersion() { + return externalApplicationProtocolVersion; + } + + public void setExternalApplicationProtocolVersion(String externalApplicationProtocolVersion) { + this.externalApplicationProtocolVersion = externalApplicationProtocolVersion; + } + + + public ProjectConfig webhookURL(String webhookURL) { + this.webhookURL = webhookURL; + return this; + } + + /** + * Get webhookURL + * @return webhookURL + **/ + @javax.annotation.Nonnull + public String getWebhookURL() { + return webhookURL; + } + + public void setWebhookURL(String webhookURL) { + this.webhookURL = webhookURL; + } + + + public ProjectConfig webhookUsername(String webhookUsername) { + this.webhookUsername = webhookUsername; + return this; + } + + /** + * Get webhookUsername + * @return webhookUsername + **/ + @javax.annotation.Nonnull + public String getWebhookUsername() { + return webhookUsername; + } + + public void setWebhookUsername(String webhookUsername) { + this.webhookUsername = webhookUsername; + } + + + public ProjectConfig webhookPassword(String webhookPassword) { + this.webhookPassword = webhookPassword; + return this; + } + + /** + * Get webhookPassword + * @return webhookPassword + **/ + @javax.annotation.Nonnull + public String getWebhookPassword() { + return webhookPassword; + } + + public void setWebhookPassword(String webhookPassword) { + this.webhookPassword = webhookPassword; + } + + + public ProjectConfig webhookTestInvalidUsername(String webhookTestInvalidUsername) { + this.webhookTestInvalidUsername = webhookTestInvalidUsername; + return this; + } + + /** + * Get webhookTestInvalidUsername + * @return webhookTestInvalidUsername + **/ + @javax.annotation.Nonnull + public String getWebhookTestInvalidUsername() { + return webhookTestInvalidUsername; + } + + public void setWebhookTestInvalidUsername(String webhookTestInvalidUsername) { + this.webhookTestInvalidUsername = webhookTestInvalidUsername; + } + + + public ProjectConfig webhookTestValidUsername(String webhookTestValidUsername) { + this.webhookTestValidUsername = webhookTestValidUsername; + return this; + } + + /** + * Get webhookTestValidUsername + * @return webhookTestValidUsername + **/ + @javax.annotation.Nonnull + public String getWebhookTestValidUsername() { + return webhookTestValidUsername; + } + + public void setWebhookTestValidUsername(String webhookTestValidUsername) { + this.webhookTestValidUsername = webhookTestValidUsername; + } + + + public ProjectConfig webhookTestValidPassword(String webhookTestValidPassword) { + this.webhookTestValidPassword = webhookTestValidPassword; + return this; + } + + /** + * Get webhookTestValidPassword + * @return webhookTestValidPassword + **/ + @javax.annotation.Nonnull + public String getWebhookTestValidPassword() { + return webhookTestValidPassword; + } + + public void setWebhookTestValidPassword(String webhookTestValidPassword) { + this.webhookTestValidPassword = webhookTestValidPassword; + } + + + public ProjectConfig externalApplicationUsername(String externalApplicationUsername) { + this.externalApplicationUsername = externalApplicationUsername; + return this; + } + + /** + * Get externalApplicationUsername + * @return externalApplicationUsername + **/ + @javax.annotation.Nonnull + public String getExternalApplicationUsername() { + return externalApplicationUsername; + } + + public void setExternalApplicationUsername(String externalApplicationUsername) { + this.externalApplicationUsername = externalApplicationUsername; + } + + + public ProjectConfig externalApplicationPassword(String externalApplicationPassword) { + this.externalApplicationPassword = externalApplicationPassword; + return this; + } + + /** + * Get externalApplicationPassword + * @return externalApplicationPassword + **/ + @javax.annotation.Nonnull + public String getExternalApplicationPassword() { + return externalApplicationPassword; + } + + public void setExternalApplicationPassword(String externalApplicationPassword) { + this.externalApplicationPassword = externalApplicationPassword; + } + + + public ProjectConfig legacyAuthMethodsUrl(String legacyAuthMethodsUrl) { + this.legacyAuthMethodsUrl = legacyAuthMethodsUrl; + return this; + } + + /** + * Get legacyAuthMethodsUrl + * @return legacyAuthMethodsUrl + **/ + @javax.annotation.Nonnull + public String getLegacyAuthMethodsUrl() { + return legacyAuthMethodsUrl; + } + + public void setLegacyAuthMethodsUrl(String legacyAuthMethodsUrl) { + this.legacyAuthMethodsUrl = legacyAuthMethodsUrl; + } + + + public ProjectConfig passwordVerifyUrl(String passwordVerifyUrl) { + this.passwordVerifyUrl = passwordVerifyUrl; + return this; + } + + /** + * Get passwordVerifyUrl + * @return passwordVerifyUrl + **/ + @javax.annotation.Nonnull + public String getPasswordVerifyUrl() { + return passwordVerifyUrl; + } + + public void setPasswordVerifyUrl(String passwordVerifyUrl) { + this.passwordVerifyUrl = passwordVerifyUrl; + } + + + public ProjectConfig authSuccessRedirectUrl(String authSuccessRedirectUrl) { + this.authSuccessRedirectUrl = authSuccessRedirectUrl; + return this; + } + + /** + * Get authSuccessRedirectUrl + * @return authSuccessRedirectUrl + **/ + @javax.annotation.Nonnull + public String getAuthSuccessRedirectUrl() { + return authSuccessRedirectUrl; + } + + public void setAuthSuccessRedirectUrl(String authSuccessRedirectUrl) { + this.authSuccessRedirectUrl = authSuccessRedirectUrl; + } + + + public ProjectConfig passwordResetUrl(String passwordResetUrl) { + this.passwordResetUrl = passwordResetUrl; + return this; + } + + /** + * Get passwordResetUrl + * @return passwordResetUrl + **/ + @javax.annotation.Nonnull + public String getPasswordResetUrl() { + return passwordResetUrl; + } + + public void setPasswordResetUrl(String passwordResetUrl) { + this.passwordResetUrl = passwordResetUrl; + } + + + public ProjectConfig allowUserRegistration(Boolean allowUserRegistration) { + this.allowUserRegistration = allowUserRegistration; + return this; + } + + /** + * Get allowUserRegistration + * @return allowUserRegistration + **/ + @javax.annotation.Nonnull + public Boolean getAllowUserRegistration() { + return allowUserRegistration; + } + + public void setAllowUserRegistration(Boolean allowUserRegistration) { + this.allowUserRegistration = allowUserRegistration; + } + + + public ProjectConfig allowIPStickiness(Boolean allowIPStickiness) { + this.allowIPStickiness = allowIPStickiness; + return this; + } + + /** + * Get allowIPStickiness + * @return allowIPStickiness + **/ + @javax.annotation.Nonnull + public Boolean getAllowIPStickiness() { + return allowIPStickiness; + } + + public void setAllowIPStickiness(Boolean allowIPStickiness) { + this.allowIPStickiness = allowIPStickiness; + } + + + public ProjectConfig passkeyAppendInterval(PasskeyAppendIntervalEnum passkeyAppendInterval) { + this.passkeyAppendInterval = passkeyAppendInterval; + return this; + } + + /** + * Get passkeyAppendInterval + * @return passkeyAppendInterval + **/ + @javax.annotation.Nonnull + public PasskeyAppendIntervalEnum getPasskeyAppendInterval() { + return passkeyAppendInterval; + } + + public void setPasskeyAppendInterval(PasskeyAppendIntervalEnum passkeyAppendInterval) { + this.passkeyAppendInterval = passkeyAppendInterval; + } + + + public ProjectConfig cliSecret(String cliSecret) { + this.cliSecret = cliSecret; + return this; + } + + /** + * Get cliSecret + * @return cliSecret + **/ + @javax.annotation.Nonnull + public String getCliSecret() { + return cliSecret; + } + + public void setCliSecret(String cliSecret) { + this.cliSecret = cliSecret; + } + + + public ProjectConfig fallbackLanguage(String fallbackLanguage) { + this.fallbackLanguage = fallbackLanguage; + return this; + } + + /** + * Get fallbackLanguage + * @return fallbackLanguage + **/ + @javax.annotation.Nonnull + public String getFallbackLanguage() { + return fallbackLanguage; + } + + public void setFallbackLanguage(String fallbackLanguage) { + this.fallbackLanguage = fallbackLanguage; + } + + + public ProjectConfig autoDetectLanguage(Boolean autoDetectLanguage) { + this.autoDetectLanguage = autoDetectLanguage; + return this; + } + + /** + * Get autoDetectLanguage + * @return autoDetectLanguage + **/ + @javax.annotation.Nonnull + public Boolean getAutoDetectLanguage() { + return autoDetectLanguage; + } + + public void setAutoDetectLanguage(Boolean autoDetectLanguage) { + this.autoDetectLanguage = autoDetectLanguage; + } + + + public ProjectConfig hasExistingUsers(Boolean hasExistingUsers) { + this.hasExistingUsers = hasExistingUsers; + return this; + } + + /** + * Get hasExistingUsers + * @return hasExistingUsers + **/ + @javax.annotation.Nonnull + public Boolean getHasExistingUsers() { + return hasExistingUsers; + } + + public void setHasExistingUsers(Boolean hasExistingUsers) { + this.hasExistingUsers = hasExistingUsers; + } + + + public ProjectConfig hasVerifiedSession(Boolean hasVerifiedSession) { + this.hasVerifiedSession = hasVerifiedSession; + return this; + } + + /** + * Get hasVerifiedSession + * @return hasVerifiedSession + **/ + @javax.annotation.Nonnull + public Boolean getHasVerifiedSession() { + return hasVerifiedSession; + } + + public void setHasVerifiedSession(Boolean hasVerifiedSession) { + this.hasVerifiedSession = hasVerifiedSession; + } + + + public ProjectConfig hasGeneratedSession(Boolean hasGeneratedSession) { + this.hasGeneratedSession = hasGeneratedSession; + return this; + } + + /** + * Get hasGeneratedSession + * @return hasGeneratedSession + **/ + @javax.annotation.Nonnull + public Boolean getHasGeneratedSession() { + return hasGeneratedSession; + } + + public void setHasGeneratedSession(Boolean hasGeneratedSession) { + this.hasGeneratedSession = hasGeneratedSession; + } + + + public ProjectConfig hasStartedUsingPasskeys(Boolean hasStartedUsingPasskeys) { + this.hasStartedUsingPasskeys = hasStartedUsingPasskeys; + return this; + } + + /** + * Get hasStartedUsingPasskeys + * @return hasStartedUsingPasskeys + **/ + @javax.annotation.Nonnull + public Boolean getHasStartedUsingPasskeys() { + return hasStartedUsingPasskeys; + } + + public void setHasStartedUsingPasskeys(Boolean hasStartedUsingPasskeys) { + this.hasStartedUsingPasskeys = hasStartedUsingPasskeys; + } + + + public ProjectConfig hasStartedUsingSessions(Boolean hasStartedUsingSessions) { + this.hasStartedUsingSessions = hasStartedUsingSessions; + return this; + } + + /** + * Get hasStartedUsingSessions + * @return hasStartedUsingSessions + **/ + @javax.annotation.Nonnull + public Boolean getHasStartedUsingSessions() { + return hasStartedUsingSessions; + } + + public void setHasStartedUsingSessions(Boolean hasStartedUsingSessions) { + this.hasStartedUsingSessions = hasStartedUsingSessions; + } + + + public ProjectConfig environment(EnvironmentEnum environment) { + this.environment = environment; + return this; + } + + /** + * Get environment + * @return environment + **/ + @javax.annotation.Nonnull + public EnvironmentEnum getEnvironment() { + return environment; + } + + public void setEnvironment(EnvironmentEnum environment) { + this.environment = environment; + } + + + public ProjectConfig frontendFramework(FrontendFrameworkEnum frontendFramework) { + this.frontendFramework = frontendFramework; + return this; + } + + /** + * Get frontendFramework + * @return frontendFramework + **/ + @javax.annotation.Nonnull + public FrontendFrameworkEnum getFrontendFramework() { + return frontendFramework; + } + + public void setFrontendFramework(FrontendFrameworkEnum frontendFramework) { + this.frontendFramework = frontendFramework; + } + + + public ProjectConfig backendLanguage(BackendLanguageEnum backendLanguage) { + this.backendLanguage = backendLanguage; + return this; + } + + /** + * Get backendLanguage + * @return backendLanguage + **/ + @javax.annotation.Nonnull + public BackendLanguageEnum getBackendLanguage() { + return backendLanguage; + } + + public void setBackendLanguage(BackendLanguageEnum backendLanguage) { + this.backendLanguage = backendLanguage; + } + + + public ProjectConfig backendAPIUrl(String backendAPIUrl) { + this.backendAPIUrl = backendAPIUrl; + return this; + } + + /** + * Get backendAPIUrl + * @return backendAPIUrl + **/ + @javax.annotation.Nonnull + public String getBackendAPIUrl() { + return backendAPIUrl; + } + + public void setBackendAPIUrl(String backendAPIUrl) { + this.backendAPIUrl = backendAPIUrl; + } + + + public ProjectConfig frontendAPIUrl(String frontendAPIUrl) { + this.frontendAPIUrl = frontendAPIUrl; + return this; + } + + /** + * Get frontendAPIUrl + * @return frontendAPIUrl + **/ + @javax.annotation.Nonnull + public String getFrontendAPIUrl() { + return frontendAPIUrl; + } + + public void setFrontendAPIUrl(String frontendAPIUrl) { + this.frontendAPIUrl = frontendAPIUrl; + } + + + public ProjectConfig applicationUrl(String applicationUrl) { + this.applicationUrl = applicationUrl; + return this; + } + + /** + * Get applicationUrl + * @return applicationUrl + **/ + @javax.annotation.Nonnull + public String getApplicationUrl() { + return applicationUrl; + } + + public void setApplicationUrl(String applicationUrl) { + this.applicationUrl = applicationUrl; + } + + + public ProjectConfig useCli(Boolean useCli) { + this.useCli = useCli; + return this; + } + + /** + * Get useCli + * @return useCli + **/ + @javax.annotation.Nonnull + public Boolean getUseCli() { + return useCli; + } + + public void setUseCli(Boolean useCli) { + this.useCli = useCli; + } + + + public ProjectConfig doubleOptIn(Boolean doubleOptIn) { + this.doubleOptIn = doubleOptIn; + return this; + } + + /** + * Get doubleOptIn + * @return doubleOptIn + **/ + @javax.annotation.Nonnull + public Boolean getDoubleOptIn() { + return doubleOptIn; + } + + public void setDoubleOptIn(Boolean doubleOptIn) { + this.doubleOptIn = doubleOptIn; + } + + + public ProjectConfig userFullNameRequired(Boolean userFullNameRequired) { + this.userFullNameRequired = userFullNameRequired; + return this; + } + + /** + * Get userFullNameRequired + * @return userFullNameRequired + **/ + @javax.annotation.Nonnull + public Boolean getUserFullNameRequired() { + return userFullNameRequired; + } + + public void setUserFullNameRequired(Boolean userFullNameRequired) { + this.userFullNameRequired = userFullNameRequired; + } + + + public ProjectConfig webauthnRPID(String webauthnRPID) { + this.webauthnRPID = webauthnRPID; + return this; + } + + /** + * Get webauthnRPID + * @return webauthnRPID + **/ + @javax.annotation.Nonnull + public String getWebauthnRPID() { + return webauthnRPID; + } + + public void setWebauthnRPID(String webauthnRPID) { + this.webauthnRPID = webauthnRPID; + } + + + public ProjectConfig cname(String cname) { + this.cname = cname; + return this; + } + + /** + * Get cname + * @return cname + **/ + @javax.annotation.Nonnull + public String getCname() { + return cname; + } + + public void setCname(String cname) { + this.cname = cname; + } + + + public ProjectConfig webComponentDebug(Boolean webComponentDebug) { + this.webComponentDebug = webComponentDebug; + return this; + } + + /** + * Get webComponentDebug + * @return webComponentDebug + **/ + @javax.annotation.Nonnull + public Boolean getWebComponentDebug() { + return webComponentDebug; + } + + public void setWebComponentDebug(Boolean webComponentDebug) { + this.webComponentDebug = webComponentDebug; + } + + + public ProjectConfig smtpUseCustom(Boolean smtpUseCustom) { + this.smtpUseCustom = smtpUseCustom; + return this; + } + + /** + * Get smtpUseCustom + * @return smtpUseCustom + **/ + @javax.annotation.Nonnull + public Boolean getSmtpUseCustom() { + return smtpUseCustom; + } + + public void setSmtpUseCustom(Boolean smtpUseCustom) { + this.smtpUseCustom = smtpUseCustom; + } + + + public ProjectConfig smtpHost(String smtpHost) { + this.smtpHost = smtpHost; + return this; + } + + /** + * Get smtpHost + * @return smtpHost + **/ + @javax.annotation.Nonnull + public String getSmtpHost() { + return smtpHost; + } + + public void setSmtpHost(String smtpHost) { + this.smtpHost = smtpHost; + } + + + public ProjectConfig smtpPort(Integer smtpPort) { + this.smtpPort = smtpPort; + return this; + } + + /** + * Get smtpPort + * @return smtpPort + **/ + @javax.annotation.Nonnull + public Integer getSmtpPort() { + return smtpPort; + } + + public void setSmtpPort(Integer smtpPort) { + this.smtpPort = smtpPort; + } + + + public ProjectConfig smtpUsername(String smtpUsername) { + this.smtpUsername = smtpUsername; + return this; + } + + /** + * Get smtpUsername + * @return smtpUsername + **/ + @javax.annotation.Nonnull + public String getSmtpUsername() { + return smtpUsername; + } + + public void setSmtpUsername(String smtpUsername) { + this.smtpUsername = smtpUsername; + } + + + public ProjectConfig smtpPassword(String smtpPassword) { + this.smtpPassword = smtpPassword; + return this; + } + + /** + * Get smtpPassword + * @return smtpPassword + **/ + @javax.annotation.Nonnull + public String getSmtpPassword() { + return smtpPassword; + } + + public void setSmtpPassword(String smtpPassword) { + this.smtpPassword = smtpPassword; + } + + + public ProjectConfig supportEmail(String supportEmail) { + this.supportEmail = supportEmail; + return this; + } + + /** + * Get supportEmail + * @return supportEmail + **/ + @javax.annotation.Nonnull + public String getSupportEmail() { + return supportEmail; + } + + public void setSupportEmail(String supportEmail) { + this.supportEmail = supportEmail; + } + + + public ProjectConfig webhookActions(List webhookActions) { + this.webhookActions = webhookActions; + return this; + } + + public ProjectConfig addWebhookActionsItem(String webhookActionsItem) { + if (this.webhookActions == null) { + this.webhookActions = new ArrayList<>(); + } + this.webhookActions.add(webhookActionsItem); + return this; + } + + /** + * Get webhookActions + * @return webhookActions + **/ + @javax.annotation.Nonnull + public List getWebhookActions() { + return webhookActions; + } + + public void setWebhookActions(List webhookActions) { + this.webhookActions = webhookActions; + } + + + public ProjectConfig signupFlow(SignupFlowEnum signupFlow) { + this.signupFlow = signupFlow; + return this; + } + + /** + * Get signupFlow + * @return signupFlow + **/ + @javax.annotation.Nonnull + public SignupFlowEnum getSignupFlow() { + return signupFlow; + } + + public void setSignupFlow(SignupFlowEnum signupFlow) { + this.signupFlow = signupFlow; + } + + + public ProjectConfig signupFlowOptions(Object signupFlowOptions) { + this.signupFlowOptions = signupFlowOptions; + return this; + } + + /** + * Get signupFlowOptions + * @return signupFlowOptions + **/ + @javax.annotation.Nonnull + public Object getSignupFlowOptions() { + return signupFlowOptions; + } + + public void setSignupFlowOptions(Object signupFlowOptions) { + this.signupFlowOptions = signupFlowOptions; + } + + + public ProjectConfig loginFlow(LoginFlowEnum loginFlow) { + this.loginFlow = loginFlow; + return this; + } + + /** + * Get loginFlow + * @return loginFlow + **/ + @javax.annotation.Nonnull + public LoginFlowEnum getLoginFlow() { + return loginFlow; + } + + public void setLoginFlow(LoginFlowEnum loginFlow) { + this.loginFlow = loginFlow; + } + + + public ProjectConfig loginFlowOptions(Object loginFlowOptions) { + this.loginFlowOptions = loginFlowOptions; + return this; + } + + /** + * Get loginFlowOptions + * @return loginFlowOptions + **/ + @javax.annotation.Nonnull + public Object getLoginFlowOptions() { + return loginFlowOptions; + } + + public void setLoginFlowOptions(Object loginFlowOptions) { + this.loginFlowOptions = loginFlowOptions; + } + + + public ProjectConfig allowStaticChallenges(Boolean allowStaticChallenges) { + this.allowStaticChallenges = allowStaticChallenges; + return this; + } + + /** + * Get allowStaticChallenges + * @return allowStaticChallenges + **/ + @javax.annotation.Nonnull + public Boolean getAllowStaticChallenges() { + return allowStaticChallenges; + } + + public void setAllowStaticChallenges(Boolean allowStaticChallenges) { + this.allowStaticChallenges = allowStaticChallenges; + } + + + public ProjectConfig created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public ProjectConfig updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + public ProjectConfig status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectConfig projectConfig = (ProjectConfig) o; + return Objects.equals(this.projectID, projectConfig.projectID) && + Objects.equals(this.externalName, projectConfig.externalName) && + Objects.equals(this.appType, projectConfig.appType) && + Objects.equals(this.productKey, projectConfig.productKey) && + Objects.equals(this.projectSubscriptionID, projectConfig.projectSubscriptionID) && + Objects.equals(this.emailFrom, projectConfig.emailFrom) && + Objects.equals(this.smsFrom, projectConfig.smsFrom) && + Objects.equals(this.externalApplicationProtocolVersion, projectConfig.externalApplicationProtocolVersion) && + Objects.equals(this.webhookURL, projectConfig.webhookURL) && + Objects.equals(this.webhookUsername, projectConfig.webhookUsername) && + Objects.equals(this.webhookPassword, projectConfig.webhookPassword) && + Objects.equals(this.webhookTestInvalidUsername, projectConfig.webhookTestInvalidUsername) && + Objects.equals(this.webhookTestValidUsername, projectConfig.webhookTestValidUsername) && + Objects.equals(this.webhookTestValidPassword, projectConfig.webhookTestValidPassword) && + Objects.equals(this.externalApplicationUsername, projectConfig.externalApplicationUsername) && + Objects.equals(this.externalApplicationPassword, projectConfig.externalApplicationPassword) && + Objects.equals(this.legacyAuthMethodsUrl, projectConfig.legacyAuthMethodsUrl) && + Objects.equals(this.passwordVerifyUrl, projectConfig.passwordVerifyUrl) && + Objects.equals(this.authSuccessRedirectUrl, projectConfig.authSuccessRedirectUrl) && + Objects.equals(this.passwordResetUrl, projectConfig.passwordResetUrl) && + Objects.equals(this.allowUserRegistration, projectConfig.allowUserRegistration) && + Objects.equals(this.allowIPStickiness, projectConfig.allowIPStickiness) && + Objects.equals(this.passkeyAppendInterval, projectConfig.passkeyAppendInterval) && + Objects.equals(this.cliSecret, projectConfig.cliSecret) && + Objects.equals(this.fallbackLanguage, projectConfig.fallbackLanguage) && + Objects.equals(this.autoDetectLanguage, projectConfig.autoDetectLanguage) && + Objects.equals(this.hasExistingUsers, projectConfig.hasExistingUsers) && + Objects.equals(this.hasVerifiedSession, projectConfig.hasVerifiedSession) && + Objects.equals(this.hasGeneratedSession, projectConfig.hasGeneratedSession) && + Objects.equals(this.hasStartedUsingPasskeys, projectConfig.hasStartedUsingPasskeys) && + Objects.equals(this.hasStartedUsingSessions, projectConfig.hasStartedUsingSessions) && + Objects.equals(this.environment, projectConfig.environment) && + Objects.equals(this.frontendFramework, projectConfig.frontendFramework) && + Objects.equals(this.backendLanguage, projectConfig.backendLanguage) && + Objects.equals(this.backendAPIUrl, projectConfig.backendAPIUrl) && + Objects.equals(this.frontendAPIUrl, projectConfig.frontendAPIUrl) && + Objects.equals(this.applicationUrl, projectConfig.applicationUrl) && + Objects.equals(this.useCli, projectConfig.useCli) && + Objects.equals(this.doubleOptIn, projectConfig.doubleOptIn) && + Objects.equals(this.userFullNameRequired, projectConfig.userFullNameRequired) && + Objects.equals(this.webauthnRPID, projectConfig.webauthnRPID) && + Objects.equals(this.cname, projectConfig.cname) && + Objects.equals(this.webComponentDebug, projectConfig.webComponentDebug) && + Objects.equals(this.smtpUseCustom, projectConfig.smtpUseCustom) && + Objects.equals(this.smtpHost, projectConfig.smtpHost) && + Objects.equals(this.smtpPort, projectConfig.smtpPort) && + Objects.equals(this.smtpUsername, projectConfig.smtpUsername) && + Objects.equals(this.smtpPassword, projectConfig.smtpPassword) && + Objects.equals(this.supportEmail, projectConfig.supportEmail) && + Objects.equals(this.webhookActions, projectConfig.webhookActions) && + Objects.equals(this.signupFlow, projectConfig.signupFlow) && + Objects.equals(this.signupFlowOptions, projectConfig.signupFlowOptions) && + Objects.equals(this.loginFlow, projectConfig.loginFlow) && + Objects.equals(this.loginFlowOptions, projectConfig.loginFlowOptions) && + Objects.equals(this.allowStaticChallenges, projectConfig.allowStaticChallenges) && + Objects.equals(this.created, projectConfig.created) && + Objects.equals(this.updated, projectConfig.updated) && + Objects.equals(this.status, projectConfig.status); + } + + @Override + public int hashCode() { + return Objects.hash(projectID, externalName, appType, productKey, projectSubscriptionID, emailFrom, smsFrom, externalApplicationProtocolVersion, webhookURL, webhookUsername, webhookPassword, webhookTestInvalidUsername, webhookTestValidUsername, webhookTestValidPassword, externalApplicationUsername, externalApplicationPassword, legacyAuthMethodsUrl, passwordVerifyUrl, authSuccessRedirectUrl, passwordResetUrl, allowUserRegistration, allowIPStickiness, passkeyAppendInterval, cliSecret, fallbackLanguage, autoDetectLanguage, hasExistingUsers, hasVerifiedSession, hasGeneratedSession, hasStartedUsingPasskeys, hasStartedUsingSessions, environment, frontendFramework, backendLanguage, backendAPIUrl, frontendAPIUrl, applicationUrl, useCli, doubleOptIn, userFullNameRequired, webauthnRPID, cname, webComponentDebug, smtpUseCustom, smtpHost, smtpPort, smtpUsername, smtpPassword, supportEmail, webhookActions, signupFlow, signupFlowOptions, loginFlow, loginFlowOptions, allowStaticChallenges, created, updated, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectConfig {\n"); + sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); + sb.append(" externalName: ").append(toIndentedString(externalName)).append("\n"); + sb.append(" appType: ").append(toIndentedString(appType)).append("\n"); + sb.append(" productKey: ").append(toIndentedString(productKey)).append("\n"); + sb.append(" projectSubscriptionID: ").append(toIndentedString(projectSubscriptionID)).append("\n"); + sb.append(" emailFrom: ").append(toIndentedString(emailFrom)).append("\n"); + sb.append(" smsFrom: ").append(toIndentedString(smsFrom)).append("\n"); + sb.append(" externalApplicationProtocolVersion: ").append(toIndentedString(externalApplicationProtocolVersion)).append("\n"); + sb.append(" webhookURL: ").append(toIndentedString(webhookURL)).append("\n"); + sb.append(" webhookUsername: ").append(toIndentedString(webhookUsername)).append("\n"); + sb.append(" webhookPassword: ").append(toIndentedString(webhookPassword)).append("\n"); + sb.append(" webhookTestInvalidUsername: ").append(toIndentedString(webhookTestInvalidUsername)).append("\n"); + sb.append(" webhookTestValidUsername: ").append(toIndentedString(webhookTestValidUsername)).append("\n"); + sb.append(" webhookTestValidPassword: ").append(toIndentedString(webhookTestValidPassword)).append("\n"); + sb.append(" externalApplicationUsername: ").append(toIndentedString(externalApplicationUsername)).append("\n"); + sb.append(" externalApplicationPassword: ").append(toIndentedString(externalApplicationPassword)).append("\n"); + sb.append(" legacyAuthMethodsUrl: ").append(toIndentedString(legacyAuthMethodsUrl)).append("\n"); + sb.append(" passwordVerifyUrl: ").append(toIndentedString(passwordVerifyUrl)).append("\n"); + sb.append(" authSuccessRedirectUrl: ").append(toIndentedString(authSuccessRedirectUrl)).append("\n"); + sb.append(" passwordResetUrl: ").append(toIndentedString(passwordResetUrl)).append("\n"); + sb.append(" allowUserRegistration: ").append(toIndentedString(allowUserRegistration)).append("\n"); + sb.append(" allowIPStickiness: ").append(toIndentedString(allowIPStickiness)).append("\n"); + sb.append(" passkeyAppendInterval: ").append(toIndentedString(passkeyAppendInterval)).append("\n"); + sb.append(" cliSecret: ").append(toIndentedString(cliSecret)).append("\n"); + sb.append(" fallbackLanguage: ").append(toIndentedString(fallbackLanguage)).append("\n"); + sb.append(" autoDetectLanguage: ").append(toIndentedString(autoDetectLanguage)).append("\n"); + sb.append(" hasExistingUsers: ").append(toIndentedString(hasExistingUsers)).append("\n"); + sb.append(" hasVerifiedSession: ").append(toIndentedString(hasVerifiedSession)).append("\n"); + sb.append(" hasGeneratedSession: ").append(toIndentedString(hasGeneratedSession)).append("\n"); + sb.append(" hasStartedUsingPasskeys: ").append(toIndentedString(hasStartedUsingPasskeys)).append("\n"); + sb.append(" hasStartedUsingSessions: ").append(toIndentedString(hasStartedUsingSessions)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" frontendFramework: ").append(toIndentedString(frontendFramework)).append("\n"); + sb.append(" backendLanguage: ").append(toIndentedString(backendLanguage)).append("\n"); + sb.append(" backendAPIUrl: ").append(toIndentedString(backendAPIUrl)).append("\n"); + sb.append(" frontendAPIUrl: ").append(toIndentedString(frontendAPIUrl)).append("\n"); + sb.append(" applicationUrl: ").append(toIndentedString(applicationUrl)).append("\n"); + sb.append(" useCli: ").append(toIndentedString(useCli)).append("\n"); + sb.append(" doubleOptIn: ").append(toIndentedString(doubleOptIn)).append("\n"); + sb.append(" userFullNameRequired: ").append(toIndentedString(userFullNameRequired)).append("\n"); + sb.append(" webauthnRPID: ").append(toIndentedString(webauthnRPID)).append("\n"); + sb.append(" cname: ").append(toIndentedString(cname)).append("\n"); + sb.append(" webComponentDebug: ").append(toIndentedString(webComponentDebug)).append("\n"); + sb.append(" smtpUseCustom: ").append(toIndentedString(smtpUseCustom)).append("\n"); + sb.append(" smtpHost: ").append(toIndentedString(smtpHost)).append("\n"); + sb.append(" smtpPort: ").append(toIndentedString(smtpPort)).append("\n"); + sb.append(" smtpUsername: ").append(toIndentedString(smtpUsername)).append("\n"); + sb.append(" smtpPassword: ").append(toIndentedString(smtpPassword)).append("\n"); + sb.append(" supportEmail: ").append(toIndentedString(supportEmail)).append("\n"); + sb.append(" webhookActions: ").append(toIndentedString(webhookActions)).append("\n"); + sb.append(" signupFlow: ").append(toIndentedString(signupFlow)).append("\n"); + sb.append(" signupFlowOptions: ").append(toIndentedString(signupFlowOptions)).append("\n"); + sb.append(" loginFlow: ").append(toIndentedString(loginFlow)).append("\n"); + sb.append(" loginFlowOptions: ").append(toIndentedString(loginFlowOptions)).append("\n"); + sb.append(" allowStaticChallenges: ").append(toIndentedString(allowStaticChallenges)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("projectID"); + openapiFields.add("externalName"); + openapiFields.add("appType"); + openapiFields.add("productKey"); + openapiFields.add("projectSubscriptionID"); + openapiFields.add("emailFrom"); + openapiFields.add("smsFrom"); + openapiFields.add("externalApplicationProtocolVersion"); + openapiFields.add("webhookURL"); + openapiFields.add("webhookUsername"); + openapiFields.add("webhookPassword"); + openapiFields.add("webhookTestInvalidUsername"); + openapiFields.add("webhookTestValidUsername"); + openapiFields.add("webhookTestValidPassword"); + openapiFields.add("externalApplicationUsername"); + openapiFields.add("externalApplicationPassword"); + openapiFields.add("legacyAuthMethodsUrl"); + openapiFields.add("passwordVerifyUrl"); + openapiFields.add("authSuccessRedirectUrl"); + openapiFields.add("passwordResetUrl"); + openapiFields.add("allowUserRegistration"); + openapiFields.add("allowIPStickiness"); + openapiFields.add("passkeyAppendInterval"); + openapiFields.add("cliSecret"); + openapiFields.add("fallbackLanguage"); + openapiFields.add("autoDetectLanguage"); + openapiFields.add("hasExistingUsers"); + openapiFields.add("hasVerifiedSession"); + openapiFields.add("hasGeneratedSession"); + openapiFields.add("hasStartedUsingPasskeys"); + openapiFields.add("hasStartedUsingSessions"); + openapiFields.add("environment"); + openapiFields.add("frontendFramework"); + openapiFields.add("backendLanguage"); + openapiFields.add("backendAPIUrl"); + openapiFields.add("frontendAPIUrl"); + openapiFields.add("applicationUrl"); + openapiFields.add("useCli"); + openapiFields.add("doubleOptIn"); + openapiFields.add("userFullNameRequired"); + openapiFields.add("webauthnRPID"); + openapiFields.add("cname"); + openapiFields.add("webComponentDebug"); + openapiFields.add("smtpUseCustom"); + openapiFields.add("smtpHost"); + openapiFields.add("smtpPort"); + openapiFields.add("smtpUsername"); + openapiFields.add("smtpPassword"); + openapiFields.add("supportEmail"); + openapiFields.add("webhookActions"); + openapiFields.add("signupFlow"); + openapiFields.add("signupFlowOptions"); + openapiFields.add("loginFlow"); + openapiFields.add("loginFlowOptions"); + openapiFields.add("allowStaticChallenges"); + openapiFields.add("created"); + openapiFields.add("updated"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("projectID"); + openapiRequiredFields.add("externalName"); + openapiRequiredFields.add("appType"); + openapiRequiredFields.add("productKey"); + openapiRequiredFields.add("projectSubscriptionID"); + openapiRequiredFields.add("emailFrom"); + openapiRequiredFields.add("smsFrom"); + openapiRequiredFields.add("externalApplicationProtocolVersion"); + openapiRequiredFields.add("webhookURL"); + openapiRequiredFields.add("webhookUsername"); + openapiRequiredFields.add("webhookPassword"); + openapiRequiredFields.add("webhookTestInvalidUsername"); + openapiRequiredFields.add("webhookTestValidUsername"); + openapiRequiredFields.add("webhookTestValidPassword"); + openapiRequiredFields.add("externalApplicationUsername"); + openapiRequiredFields.add("externalApplicationPassword"); + openapiRequiredFields.add("legacyAuthMethodsUrl"); + openapiRequiredFields.add("passwordVerifyUrl"); + openapiRequiredFields.add("authSuccessRedirectUrl"); + openapiRequiredFields.add("passwordResetUrl"); + openapiRequiredFields.add("allowUserRegistration"); + openapiRequiredFields.add("allowIPStickiness"); + openapiRequiredFields.add("passkeyAppendInterval"); + openapiRequiredFields.add("cliSecret"); + openapiRequiredFields.add("fallbackLanguage"); + openapiRequiredFields.add("autoDetectLanguage"); + openapiRequiredFields.add("hasExistingUsers"); + openapiRequiredFields.add("hasVerifiedSession"); + openapiRequiredFields.add("hasGeneratedSession"); + openapiRequiredFields.add("hasStartedUsingPasskeys"); + openapiRequiredFields.add("hasStartedUsingSessions"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("frontendFramework"); + openapiRequiredFields.add("backendLanguage"); + openapiRequiredFields.add("backendAPIUrl"); + openapiRequiredFields.add("frontendAPIUrl"); + openapiRequiredFields.add("applicationUrl"); + openapiRequiredFields.add("useCli"); + openapiRequiredFields.add("doubleOptIn"); + openapiRequiredFields.add("userFullNameRequired"); + openapiRequiredFields.add("webauthnRPID"); + openapiRequiredFields.add("cname"); + openapiRequiredFields.add("webComponentDebug"); + openapiRequiredFields.add("smtpUseCustom"); + openapiRequiredFields.add("smtpHost"); + openapiRequiredFields.add("smtpPort"); + openapiRequiredFields.add("smtpUsername"); + openapiRequiredFields.add("smtpPassword"); + openapiRequiredFields.add("supportEmail"); + openapiRequiredFields.add("webhookActions"); + openapiRequiredFields.add("signupFlow"); + openapiRequiredFields.add("signupFlowOptions"); + openapiRequiredFields.add("loginFlow"); + openapiRequiredFields.add("loginFlowOptions"); + openapiRequiredFields.add("allowStaticChallenges"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ProjectConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProjectConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectConfig is not found in the empty JSON string", ProjectConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ProjectConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectConfig` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProjectConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("projectID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); + } + if (!jsonObj.get("externalName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `externalName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalName").toString())); + } + // validate the required field `appType` + AppType.validateJsonElement(jsonObj.get("appType")); + if (!jsonObj.get("productKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `productKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productKey").toString())); + } + if (!jsonObj.get("projectSubscriptionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `projectSubscriptionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectSubscriptionID").toString())); + } + if (!jsonObj.get("emailFrom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `emailFrom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailFrom").toString())); + } + if (!jsonObj.get("smsFrom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `smsFrom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smsFrom").toString())); + } + if (!jsonObj.get("externalApplicationProtocolVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `externalApplicationProtocolVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalApplicationProtocolVersion").toString())); + } + if (!jsonObj.get("webhookURL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookURL").toString())); + } + if (!jsonObj.get("webhookUsername").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookUsername").toString())); + } + if (!jsonObj.get("webhookPassword").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookPassword").toString())); + } + if (!jsonObj.get("webhookTestInvalidUsername").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookTestInvalidUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookTestInvalidUsername").toString())); + } + if (!jsonObj.get("webhookTestValidUsername").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookTestValidUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookTestValidUsername").toString())); + } + if (!jsonObj.get("webhookTestValidPassword").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookTestValidPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookTestValidPassword").toString())); + } + if (!jsonObj.get("externalApplicationUsername").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `externalApplicationUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalApplicationUsername").toString())); + } + if (!jsonObj.get("externalApplicationPassword").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `externalApplicationPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalApplicationPassword").toString())); + } + if (!jsonObj.get("legacyAuthMethodsUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `legacyAuthMethodsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legacyAuthMethodsUrl").toString())); + } + if (!jsonObj.get("passwordVerifyUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `passwordVerifyUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passwordVerifyUrl").toString())); + } + if (!jsonObj.get("authSuccessRedirectUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authSuccessRedirectUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authSuccessRedirectUrl").toString())); + } + if (!jsonObj.get("passwordResetUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `passwordResetUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passwordResetUrl").toString())); + } + if (!jsonObj.get("passkeyAppendInterval").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `passkeyAppendInterval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passkeyAppendInterval").toString())); + } + // validate the required field `passkeyAppendInterval` + PasskeyAppendIntervalEnum.validateJsonElement(jsonObj.get("passkeyAppendInterval")); + if (!jsonObj.get("cliSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cliSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cliSecret").toString())); + } + if (!jsonObj.get("fallbackLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fallbackLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fallbackLanguage").toString())); + } + if (!jsonObj.get("environment").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `environment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environment").toString())); + } + // validate the required field `environment` + EnvironmentEnum.validateJsonElement(jsonObj.get("environment")); + if (!jsonObj.get("frontendFramework").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `frontendFramework` to be a primitive type in the JSON string but got `%s`", jsonObj.get("frontendFramework").toString())); + } + // validate the required field `frontendFramework` + FrontendFrameworkEnum.validateJsonElement(jsonObj.get("frontendFramework")); + if (!jsonObj.get("backendLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `backendLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("backendLanguage").toString())); + } + // validate the required field `backendLanguage` + BackendLanguageEnum.validateJsonElement(jsonObj.get("backendLanguage")); + if (!jsonObj.get("backendAPIUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `backendAPIUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("backendAPIUrl").toString())); + } + if (!jsonObj.get("frontendAPIUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `frontendAPIUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("frontendAPIUrl").toString())); + } + if (!jsonObj.get("applicationUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `applicationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applicationUrl").toString())); + } + if (!jsonObj.get("webauthnRPID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `webauthnRPID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webauthnRPID").toString())); + } + if (!jsonObj.get("cname").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cname` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cname").toString())); + } + if (!jsonObj.get("smtpHost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `smtpHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpHost").toString())); + } + if (!jsonObj.get("smtpUsername").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `smtpUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpUsername").toString())); + } + if (!jsonObj.get("smtpPassword").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `smtpPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpPassword").toString())); + } + if (!jsonObj.get("supportEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `supportEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("supportEmail").toString())); + } + // ensure the required json array is present + if (jsonObj.get("webhookActions") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("webhookActions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookActions` to be an array in the JSON string but got `%s`", jsonObj.get("webhookActions").toString())); + } + if (!jsonObj.get("signupFlow").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signupFlow` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signupFlow").toString())); + } + // validate the required field `signupFlow` + SignupFlowEnum.validateJsonElement(jsonObj.get("signupFlow")); + if (!jsonObj.get("loginFlow").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loginFlow` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginFlow").toString())); + } + // validate the required field `loginFlow` + LoginFlowEnum.validateJsonElement(jsonObj.get("loginFlow")); + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProjectConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProjectConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProjectConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ProjectConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProjectConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProjectConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProjectConfig + * @throws IOException if the JSON string is invalid with respect to ProjectConfig + */ + public static ProjectConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProjectConfig.class); + } + + /** + * Convert an instance of ProjectConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ProjectConfigGetRsp.java b/src/main/java/com/corbado/generated/model/ProjectConfigGetRsp.java new file mode 100644 index 0000000..a7a6ef1 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ProjectConfigGetRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ProjectConfig; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ProjectConfigGetRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ProjectConfigGetRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private ProjectConfig data; + + public ProjectConfigGetRsp() { + } + + public ProjectConfigGetRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public ProjectConfigGetRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public ProjectConfigGetRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public ProjectConfigGetRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public ProjectConfigGetRsp data(ProjectConfig data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public ProjectConfig getData() { + return data; + } + + public void setData(ProjectConfig data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectConfigGetRsp projectConfigGetRsp = (ProjectConfigGetRsp) o; + return Objects.equals(this.httpStatusCode, projectConfigGetRsp.httpStatusCode) && + Objects.equals(this.message, projectConfigGetRsp.message) && + Objects.equals(this.requestData, projectConfigGetRsp.requestData) && + Objects.equals(this.runtime, projectConfigGetRsp.runtime) && + Objects.equals(this.data, projectConfigGetRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectConfigGetRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ProjectConfigGetRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProjectConfigGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectConfigGetRsp is not found in the empty JSON string", ProjectConfigGetRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ProjectConfigGetRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectConfigGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProjectConfigGetRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + ProjectConfig.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProjectConfigGetRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProjectConfigGetRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProjectConfigGetRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ProjectConfigGetRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProjectConfigGetRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProjectConfigGetRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProjectConfigGetRsp + * @throws IOException if the JSON string is invalid with respect to ProjectConfigGetRsp + */ + public static ProjectConfigGetRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProjectConfigGetRsp.class); + } + + /** + * Convert an instance of ProjectConfigGetRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ProjectConfigSaveReq.java b/src/main/java/com/corbado/generated/model/ProjectConfigSaveReq.java new file mode 100644 index 0000000..92d1309 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ProjectConfigSaveReq.java @@ -0,0 +1,2036 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.AppType; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ProjectConfigSaveReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ProjectConfigSaveReq { + public static final String SERIALIZED_NAME_EXTERNAL_NAME = "externalName"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_NAME) + private String externalName; + + public static final String SERIALIZED_NAME_APP_TYPE = "appType"; + @SerializedName(SERIALIZED_NAME_APP_TYPE) + private AppType appType; + + public static final String SERIALIZED_NAME_PRODUCT_KEY = "productKey"; + @SerializedName(SERIALIZED_NAME_PRODUCT_KEY) + private String productKey; + + public static final String SERIALIZED_NAME_EMAIL_FROM = "emailFrom"; + @SerializedName(SERIALIZED_NAME_EMAIL_FROM) + private String emailFrom; + + public static final String SERIALIZED_NAME_SMS_FROM = "smsFrom"; + @SerializedName(SERIALIZED_NAME_SMS_FROM) + private String smsFrom; + + /** + * Defines which version of webhook is used + */ + @JsonAdapter(ExternalApplicationProtocolVersionEnum.Adapter.class) + public enum ExternalApplicationProtocolVersionEnum { + V1("v1"), + + V2("v2"); + + private String value; + + ExternalApplicationProtocolVersionEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ExternalApplicationProtocolVersionEnum fromValue(String value) { + for (ExternalApplicationProtocolVersionEnum b : ExternalApplicationProtocolVersionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ExternalApplicationProtocolVersionEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ExternalApplicationProtocolVersionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ExternalApplicationProtocolVersionEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ExternalApplicationProtocolVersionEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EXTERNAL_APPLICATION_PROTOCOL_VERSION = "externalApplicationProtocolVersion"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_APPLICATION_PROTOCOL_VERSION) + private ExternalApplicationProtocolVersionEnum externalApplicationProtocolVersion; + + public static final String SERIALIZED_NAME_WEBHOOK_U_R_L = "webhookURL"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_U_R_L) + private String webhookURL; + + public static final String SERIALIZED_NAME_WEBHOOK_ACTIONS = "webhookActions"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_ACTIONS) + private List webhookActions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_WEBHOOK_USERNAME = "webhookUsername"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_USERNAME) + private String webhookUsername; + + public static final String SERIALIZED_NAME_WEBHOOK_PASSWORD = "webhookPassword"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_PASSWORD) + private String webhookPassword; + + public static final String SERIALIZED_NAME_WEBHOOK_TEST_INVALID_USERNAME = "webhookTestInvalidUsername"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_TEST_INVALID_USERNAME) + private String webhookTestInvalidUsername; + + public static final String SERIALIZED_NAME_WEBHOOK_TEST_VALID_USERNAME = "webhookTestValidUsername"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_TEST_VALID_USERNAME) + private String webhookTestValidUsername; + + public static final String SERIALIZED_NAME_WEBHOOK_TEST_VALID_PASSWORD = "webhookTestValidPassword"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_TEST_VALID_PASSWORD) + private String webhookTestValidPassword; + + public static final String SERIALIZED_NAME_EXTERNAL_APPLICATION_USERNAME = "externalApplicationUsername"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_APPLICATION_USERNAME) + private String externalApplicationUsername; + + public static final String SERIALIZED_NAME_EXTERNAL_APPLICATION_PASSWORD = "externalApplicationPassword"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_APPLICATION_PASSWORD) + private String externalApplicationPassword; + + public static final String SERIALIZED_NAME_LEGACY_AUTH_METHODS_URL = "legacyAuthMethodsUrl"; + @SerializedName(SERIALIZED_NAME_LEGACY_AUTH_METHODS_URL) + private String legacyAuthMethodsUrl; + + public static final String SERIALIZED_NAME_PASSWORD_VERIFY_URL = "passwordVerifyUrl"; + @SerializedName(SERIALIZED_NAME_PASSWORD_VERIFY_URL) + private String passwordVerifyUrl; + + public static final String SERIALIZED_NAME_AUTH_SUCCESS_REDIRECT_URL = "authSuccessRedirectUrl"; + @SerializedName(SERIALIZED_NAME_AUTH_SUCCESS_REDIRECT_URL) + private String authSuccessRedirectUrl; + + public static final String SERIALIZED_NAME_PASSWORD_RESET_URL = "passwordResetUrl"; + @SerializedName(SERIALIZED_NAME_PASSWORD_RESET_URL) + private String passwordResetUrl; + + public static final String SERIALIZED_NAME_ALLOW_USER_REGISTRATION = "allowUserRegistration"; + @SerializedName(SERIALIZED_NAME_ALLOW_USER_REGISTRATION) + private Boolean allowUserRegistration; + + public static final String SERIALIZED_NAME_ALLOW_I_P_STICKINESS = "allowIPStickiness"; + @SerializedName(SERIALIZED_NAME_ALLOW_I_P_STICKINESS) + private Boolean allowIPStickiness; + + /** + * Gets or Sets passkeyAppendInterval + */ + @JsonAdapter(PasskeyAppendIntervalEnum.Adapter.class) + public enum PasskeyAppendIntervalEnum { + _0D("0d"), + + _1D("1d"), + + _3D("3d"), + + _1W("1w"), + + _3W("3w"), + + _1M("1m"), + + _3M("3m"); + + private String value; + + PasskeyAppendIntervalEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PasskeyAppendIntervalEnum fromValue(String value) { + for (PasskeyAppendIntervalEnum b : PasskeyAppendIntervalEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PasskeyAppendIntervalEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PasskeyAppendIntervalEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PasskeyAppendIntervalEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PasskeyAppendIntervalEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PASSKEY_APPEND_INTERVAL = "passkeyAppendInterval"; + @SerializedName(SERIALIZED_NAME_PASSKEY_APPEND_INTERVAL) + private PasskeyAppendIntervalEnum passkeyAppendInterval; + + public static final String SERIALIZED_NAME_FALLBACK_LANGUAGE = "fallbackLanguage"; + @SerializedName(SERIALIZED_NAME_FALLBACK_LANGUAGE) + private String fallbackLanguage; + + public static final String SERIALIZED_NAME_AUTO_DETECT_LANGUAGE = "autoDetectLanguage"; + @SerializedName(SERIALIZED_NAME_AUTO_DETECT_LANGUAGE) + private Boolean autoDetectLanguage; + + public static final String SERIALIZED_NAME_HAS_EXISTING_USERS = "hasExistingUsers"; + @SerializedName(SERIALIZED_NAME_HAS_EXISTING_USERS) + private Boolean hasExistingUsers; + + public static final String SERIALIZED_NAME_HAS_VERIFIED_SESSION = "hasVerifiedSession"; + @SerializedName(SERIALIZED_NAME_HAS_VERIFIED_SESSION) + private Boolean hasVerifiedSession; + + public static final String SERIALIZED_NAME_HAS_GENERATED_SESSION = "hasGeneratedSession"; + @SerializedName(SERIALIZED_NAME_HAS_GENERATED_SESSION) + private Boolean hasGeneratedSession; + + public static final String SERIALIZED_NAME_HAS_STARTED_USING_PASSKEYS = "hasStartedUsingPasskeys"; + @SerializedName(SERIALIZED_NAME_HAS_STARTED_USING_PASSKEYS) + private Boolean hasStartedUsingPasskeys; + + public static final String SERIALIZED_NAME_HAS_STARTED_USING_SESSIONS = "hasStartedUsingSessions"; + @SerializedName(SERIALIZED_NAME_HAS_STARTED_USING_SESSIONS) + private Boolean hasStartedUsingSessions; + + public static final String SERIALIZED_NAME_APPLICATION_URL = "applicationUrl"; + @SerializedName(SERIALIZED_NAME_APPLICATION_URL) + private String applicationUrl; + + public static final String SERIALIZED_NAME_USE_CLI = "useCli"; + @SerializedName(SERIALIZED_NAME_USE_CLI) + private Boolean useCli; + + public static final String SERIALIZED_NAME_DOUBLE_OPT_IN = "doubleOptIn"; + @SerializedName(SERIALIZED_NAME_DOUBLE_OPT_IN) + private Boolean doubleOptIn; + + public static final String SERIALIZED_NAME_USER_FULL_NAME_REQUIRED = "userFullNameRequired"; + @SerializedName(SERIALIZED_NAME_USER_FULL_NAME_REQUIRED) + private Boolean userFullNameRequired; + + public static final String SERIALIZED_NAME_WEBAUTHN_R_P_I_D = "webauthnRPID"; + @SerializedName(SERIALIZED_NAME_WEBAUTHN_R_P_I_D) + private String webauthnRPID; + + /** + * Gets or Sets environment + */ + @JsonAdapter(EnvironmentEnum.Adapter.class) + public enum EnvironmentEnum { + DEV("dev"), + + PROD("prod"); + + private String value; + + EnvironmentEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnvironmentEnum fromValue(String value) { + for (EnvironmentEnum b : EnvironmentEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnvironmentEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnvironmentEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnvironmentEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EnvironmentEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private EnvironmentEnum environment; + + /** + * Gets or Sets frontendFramework + */ + @JsonAdapter(FrontendFrameworkEnum.Adapter.class) + public enum FrontendFrameworkEnum { + REACT("react"), + + VUEJS("vuejs"), + + VANILLAJS("vanillajs"), + + ANGULAR("angular"), + + SVELTE("svelte"), + + NEXTJS("nextjs"), + + NUXTJS("nuxtjs"), + + FLUTTER("flutter"); + + private String value; + + FrontendFrameworkEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FrontendFrameworkEnum fromValue(String value) { + for (FrontendFrameworkEnum b : FrontendFrameworkEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FrontendFrameworkEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FrontendFrameworkEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FrontendFrameworkEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + FrontendFrameworkEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_FRONTEND_FRAMEWORK = "frontendFramework"; + @SerializedName(SERIALIZED_NAME_FRONTEND_FRAMEWORK) + private FrontendFrameworkEnum frontendFramework; + + /** + * Gets or Sets backendLanguage + */ + @JsonAdapter(BackendLanguageEnum.Adapter.class) + public enum BackendLanguageEnum { + JAVASCRIPT("javascript"), + + PHP("php"), + + GO("go"), + + OTHER("other"); + + private String value; + + BackendLanguageEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static BackendLanguageEnum fromValue(String value) { + for (BackendLanguageEnum b : BackendLanguageEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final BackendLanguageEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public BackendLanguageEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return BackendLanguageEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + BackendLanguageEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_BACKEND_LANGUAGE = "backendLanguage"; + @SerializedName(SERIALIZED_NAME_BACKEND_LANGUAGE) + private BackendLanguageEnum backendLanguage; + + public static final String SERIALIZED_NAME_WEB_COMPONENT_DEBUG = "webComponentDebug"; + @SerializedName(SERIALIZED_NAME_WEB_COMPONENT_DEBUG) + private Boolean webComponentDebug; + + public static final String SERIALIZED_NAME_SMTP_USE_CUSTOM = "smtpUseCustom"; + @SerializedName(SERIALIZED_NAME_SMTP_USE_CUSTOM) + private Boolean smtpUseCustom; + + public static final String SERIALIZED_NAME_SMTP_HOST = "smtpHost"; + @SerializedName(SERIALIZED_NAME_SMTP_HOST) + private String smtpHost; + + public static final String SERIALIZED_NAME_SMTP_PORT = "smtpPort"; + @SerializedName(SERIALIZED_NAME_SMTP_PORT) + private Integer smtpPort; + + public static final String SERIALIZED_NAME_SMTP_USERNAME = "smtpUsername"; + @SerializedName(SERIALIZED_NAME_SMTP_USERNAME) + private String smtpUsername; + + public static final String SERIALIZED_NAME_SMTP_PASSWORD = "smtpPassword"; + @SerializedName(SERIALIZED_NAME_SMTP_PASSWORD) + private String smtpPassword; + + public static final String SERIALIZED_NAME_SUPPORT_EMAIL = "supportEmail"; + @SerializedName(SERIALIZED_NAME_SUPPORT_EMAIL) + private String supportEmail; + + /** + * Gets or Sets signupFlow + */ + @JsonAdapter(SignupFlowEnum.Adapter.class) + public enum SignupFlowEnum { + PASSKEY_WITH_EMAIL_OTP_FALLBACK("PasskeyWithEmailOTPFallback"), + + EMAIL_OTP_SIGNUP("EmailOTPSignup"); + + private String value; + + SignupFlowEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SignupFlowEnum fromValue(String value) { + for (SignupFlowEnum b : SignupFlowEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SignupFlowEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SignupFlowEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SignupFlowEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SignupFlowEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SIGNUP_FLOW = "signupFlow"; + @SerializedName(SERIALIZED_NAME_SIGNUP_FLOW) + private SignupFlowEnum signupFlow; + + public static final String SERIALIZED_NAME_SIGNUP_FLOW_OPTIONS = "signupFlowOptions"; + @SerializedName(SERIALIZED_NAME_SIGNUP_FLOW_OPTIONS) + private Object signupFlowOptions; + + /** + * Gets or Sets loginFlow + */ + @JsonAdapter(LoginFlowEnum.Adapter.class) + public enum LoginFlowEnum { + PASSKEY_WITH_EMAIL_OTP_FALLBACK("PasskeyWithEmailOTPFallback"); + + private String value; + + LoginFlowEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LoginFlowEnum fromValue(String value) { + for (LoginFlowEnum b : LoginFlowEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LoginFlowEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LoginFlowEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LoginFlowEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + LoginFlowEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_LOGIN_FLOW = "loginFlow"; + @SerializedName(SERIALIZED_NAME_LOGIN_FLOW) + private LoginFlowEnum loginFlow; + + public static final String SERIALIZED_NAME_LOGIN_FLOW_OPTIONS = "loginFlowOptions"; + @SerializedName(SERIALIZED_NAME_LOGIN_FLOW_OPTIONS) + private Object loginFlowOptions; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public static final String SERIALIZED_NAME_ALLOW_STATIC_CHALLENGES = "allowStaticChallenges"; + @SerializedName(SERIALIZED_NAME_ALLOW_STATIC_CHALLENGES) + private Boolean allowStaticChallenges; + + public ProjectConfigSaveReq() { + } + + public ProjectConfigSaveReq externalName(String externalName) { + this.externalName = externalName; + return this; + } + + /** + * Get externalName + * @return externalName + **/ + @javax.annotation.Nullable + public String getExternalName() { + return externalName; + } + + public void setExternalName(String externalName) { + this.externalName = externalName; + } + + + public ProjectConfigSaveReq appType(AppType appType) { + this.appType = appType; + return this; + } + + /** + * Get appType + * @return appType + **/ + @javax.annotation.Nullable + public AppType getAppType() { + return appType; + } + + public void setAppType(AppType appType) { + this.appType = appType; + } + + + public ProjectConfigSaveReq productKey(String productKey) { + this.productKey = productKey; + return this; + } + + /** + * Get productKey + * @return productKey + **/ + @javax.annotation.Nullable + public String getProductKey() { + return productKey; + } + + public void setProductKey(String productKey) { + this.productKey = productKey; + } + + + public ProjectConfigSaveReq emailFrom(String emailFrom) { + this.emailFrom = emailFrom; + return this; + } + + /** + * Get emailFrom + * @return emailFrom + **/ + @javax.annotation.Nullable + public String getEmailFrom() { + return emailFrom; + } + + public void setEmailFrom(String emailFrom) { + this.emailFrom = emailFrom; + } + + + public ProjectConfigSaveReq smsFrom(String smsFrom) { + this.smsFrom = smsFrom; + return this; + } + + /** + * Get smsFrom + * @return smsFrom + **/ + @javax.annotation.Nullable + public String getSmsFrom() { + return smsFrom; + } + + public void setSmsFrom(String smsFrom) { + this.smsFrom = smsFrom; + } + + + public ProjectConfigSaveReq externalApplicationProtocolVersion(ExternalApplicationProtocolVersionEnum externalApplicationProtocolVersion) { + this.externalApplicationProtocolVersion = externalApplicationProtocolVersion; + return this; + } + + /** + * Defines which version of webhook is used + * @return externalApplicationProtocolVersion + **/ + @javax.annotation.Nullable + public ExternalApplicationProtocolVersionEnum getExternalApplicationProtocolVersion() { + return externalApplicationProtocolVersion; + } + + public void setExternalApplicationProtocolVersion(ExternalApplicationProtocolVersionEnum externalApplicationProtocolVersion) { + this.externalApplicationProtocolVersion = externalApplicationProtocolVersion; + } + + + public ProjectConfigSaveReq webhookURL(String webhookURL) { + this.webhookURL = webhookURL; + return this; + } + + /** + * Get webhookURL + * @return webhookURL + **/ + @javax.annotation.Nullable + public String getWebhookURL() { + return webhookURL; + } + + public void setWebhookURL(String webhookURL) { + this.webhookURL = webhookURL; + } + + + public ProjectConfigSaveReq webhookActions(List webhookActions) { + this.webhookActions = webhookActions; + return this; + } + + public ProjectConfigSaveReq addWebhookActionsItem(String webhookActionsItem) { + if (this.webhookActions == null) { + this.webhookActions = new ArrayList<>(); + } + this.webhookActions.add(webhookActionsItem); + return this; + } + + /** + * Get webhookActions + * @return webhookActions + **/ + @javax.annotation.Nullable + public List getWebhookActions() { + return webhookActions; + } + + public void setWebhookActions(List webhookActions) { + this.webhookActions = webhookActions; + } + + + public ProjectConfigSaveReq webhookUsername(String webhookUsername) { + this.webhookUsername = webhookUsername; + return this; + } + + /** + * Get webhookUsername + * @return webhookUsername + **/ + @javax.annotation.Nullable + public String getWebhookUsername() { + return webhookUsername; + } + + public void setWebhookUsername(String webhookUsername) { + this.webhookUsername = webhookUsername; + } + + + public ProjectConfigSaveReq webhookPassword(String webhookPassword) { + this.webhookPassword = webhookPassword; + return this; + } + + /** + * Get webhookPassword + * @return webhookPassword + **/ + @javax.annotation.Nullable + public String getWebhookPassword() { + return webhookPassword; + } + + public void setWebhookPassword(String webhookPassword) { + this.webhookPassword = webhookPassword; + } + + + public ProjectConfigSaveReq webhookTestInvalidUsername(String webhookTestInvalidUsername) { + this.webhookTestInvalidUsername = webhookTestInvalidUsername; + return this; + } + + /** + * Get webhookTestInvalidUsername + * @return webhookTestInvalidUsername + **/ + @javax.annotation.Nullable + public String getWebhookTestInvalidUsername() { + return webhookTestInvalidUsername; + } + + public void setWebhookTestInvalidUsername(String webhookTestInvalidUsername) { + this.webhookTestInvalidUsername = webhookTestInvalidUsername; + } + + + public ProjectConfigSaveReq webhookTestValidUsername(String webhookTestValidUsername) { + this.webhookTestValidUsername = webhookTestValidUsername; + return this; + } + + /** + * Get webhookTestValidUsername + * @return webhookTestValidUsername + **/ + @javax.annotation.Nullable + public String getWebhookTestValidUsername() { + return webhookTestValidUsername; + } + + public void setWebhookTestValidUsername(String webhookTestValidUsername) { + this.webhookTestValidUsername = webhookTestValidUsername; + } + + + public ProjectConfigSaveReq webhookTestValidPassword(String webhookTestValidPassword) { + this.webhookTestValidPassword = webhookTestValidPassword; + return this; + } + + /** + * Get webhookTestValidPassword + * @return webhookTestValidPassword + **/ + @javax.annotation.Nullable + public String getWebhookTestValidPassword() { + return webhookTestValidPassword; + } + + public void setWebhookTestValidPassword(String webhookTestValidPassword) { + this.webhookTestValidPassword = webhookTestValidPassword; + } + + + public ProjectConfigSaveReq externalApplicationUsername(String externalApplicationUsername) { + this.externalApplicationUsername = externalApplicationUsername; + return this; + } + + /** + * Get externalApplicationUsername + * @return externalApplicationUsername + **/ + @javax.annotation.Nullable + public String getExternalApplicationUsername() { + return externalApplicationUsername; + } + + public void setExternalApplicationUsername(String externalApplicationUsername) { + this.externalApplicationUsername = externalApplicationUsername; + } + + + public ProjectConfigSaveReq externalApplicationPassword(String externalApplicationPassword) { + this.externalApplicationPassword = externalApplicationPassword; + return this; + } + + /** + * Get externalApplicationPassword + * @return externalApplicationPassword + **/ + @javax.annotation.Nullable + public String getExternalApplicationPassword() { + return externalApplicationPassword; + } + + public void setExternalApplicationPassword(String externalApplicationPassword) { + this.externalApplicationPassword = externalApplicationPassword; + } + + + public ProjectConfigSaveReq legacyAuthMethodsUrl(String legacyAuthMethodsUrl) { + this.legacyAuthMethodsUrl = legacyAuthMethodsUrl; + return this; + } + + /** + * Get legacyAuthMethodsUrl + * @return legacyAuthMethodsUrl + **/ + @javax.annotation.Nullable + public String getLegacyAuthMethodsUrl() { + return legacyAuthMethodsUrl; + } + + public void setLegacyAuthMethodsUrl(String legacyAuthMethodsUrl) { + this.legacyAuthMethodsUrl = legacyAuthMethodsUrl; + } + + + public ProjectConfigSaveReq passwordVerifyUrl(String passwordVerifyUrl) { + this.passwordVerifyUrl = passwordVerifyUrl; + return this; + } + + /** + * Get passwordVerifyUrl + * @return passwordVerifyUrl + **/ + @javax.annotation.Nullable + public String getPasswordVerifyUrl() { + return passwordVerifyUrl; + } + + public void setPasswordVerifyUrl(String passwordVerifyUrl) { + this.passwordVerifyUrl = passwordVerifyUrl; + } + + + public ProjectConfigSaveReq authSuccessRedirectUrl(String authSuccessRedirectUrl) { + this.authSuccessRedirectUrl = authSuccessRedirectUrl; + return this; + } + + /** + * Get authSuccessRedirectUrl + * @return authSuccessRedirectUrl + **/ + @javax.annotation.Nullable + public String getAuthSuccessRedirectUrl() { + return authSuccessRedirectUrl; + } + + public void setAuthSuccessRedirectUrl(String authSuccessRedirectUrl) { + this.authSuccessRedirectUrl = authSuccessRedirectUrl; + } + + + public ProjectConfigSaveReq passwordResetUrl(String passwordResetUrl) { + this.passwordResetUrl = passwordResetUrl; + return this; + } + + /** + * Get passwordResetUrl + * @return passwordResetUrl + **/ + @javax.annotation.Nullable + public String getPasswordResetUrl() { + return passwordResetUrl; + } + + public void setPasswordResetUrl(String passwordResetUrl) { + this.passwordResetUrl = passwordResetUrl; + } + + + public ProjectConfigSaveReq allowUserRegistration(Boolean allowUserRegistration) { + this.allowUserRegistration = allowUserRegistration; + return this; + } + + /** + * Get allowUserRegistration + * @return allowUserRegistration + **/ + @javax.annotation.Nullable + public Boolean getAllowUserRegistration() { + return allowUserRegistration; + } + + public void setAllowUserRegistration(Boolean allowUserRegistration) { + this.allowUserRegistration = allowUserRegistration; + } + + + public ProjectConfigSaveReq allowIPStickiness(Boolean allowIPStickiness) { + this.allowIPStickiness = allowIPStickiness; + return this; + } + + /** + * Get allowIPStickiness + * @return allowIPStickiness + **/ + @javax.annotation.Nullable + public Boolean getAllowIPStickiness() { + return allowIPStickiness; + } + + public void setAllowIPStickiness(Boolean allowIPStickiness) { + this.allowIPStickiness = allowIPStickiness; + } + + + public ProjectConfigSaveReq passkeyAppendInterval(PasskeyAppendIntervalEnum passkeyAppendInterval) { + this.passkeyAppendInterval = passkeyAppendInterval; + return this; + } + + /** + * Get passkeyAppendInterval + * @return passkeyAppendInterval + **/ + @javax.annotation.Nullable + public PasskeyAppendIntervalEnum getPasskeyAppendInterval() { + return passkeyAppendInterval; + } + + public void setPasskeyAppendInterval(PasskeyAppendIntervalEnum passkeyAppendInterval) { + this.passkeyAppendInterval = passkeyAppendInterval; + } + + + public ProjectConfigSaveReq fallbackLanguage(String fallbackLanguage) { + this.fallbackLanguage = fallbackLanguage; + return this; + } + + /** + * Get fallbackLanguage + * @return fallbackLanguage + **/ + @javax.annotation.Nullable + public String getFallbackLanguage() { + return fallbackLanguage; + } + + public void setFallbackLanguage(String fallbackLanguage) { + this.fallbackLanguage = fallbackLanguage; + } + + + public ProjectConfigSaveReq autoDetectLanguage(Boolean autoDetectLanguage) { + this.autoDetectLanguage = autoDetectLanguage; + return this; + } + + /** + * Get autoDetectLanguage + * @return autoDetectLanguage + **/ + @javax.annotation.Nullable + public Boolean getAutoDetectLanguage() { + return autoDetectLanguage; + } + + public void setAutoDetectLanguage(Boolean autoDetectLanguage) { + this.autoDetectLanguage = autoDetectLanguage; + } + + + public ProjectConfigSaveReq hasExistingUsers(Boolean hasExistingUsers) { + this.hasExistingUsers = hasExistingUsers; + return this; + } + + /** + * Get hasExistingUsers + * @return hasExistingUsers + **/ + @javax.annotation.Nullable + public Boolean getHasExistingUsers() { + return hasExistingUsers; + } + + public void setHasExistingUsers(Boolean hasExistingUsers) { + this.hasExistingUsers = hasExistingUsers; + } + + + public ProjectConfigSaveReq hasVerifiedSession(Boolean hasVerifiedSession) { + this.hasVerifiedSession = hasVerifiedSession; + return this; + } + + /** + * Get hasVerifiedSession + * @return hasVerifiedSession + **/ + @javax.annotation.Nullable + public Boolean getHasVerifiedSession() { + return hasVerifiedSession; + } + + public void setHasVerifiedSession(Boolean hasVerifiedSession) { + this.hasVerifiedSession = hasVerifiedSession; + } + + + public ProjectConfigSaveReq hasGeneratedSession(Boolean hasGeneratedSession) { + this.hasGeneratedSession = hasGeneratedSession; + return this; + } + + /** + * Get hasGeneratedSession + * @return hasGeneratedSession + **/ + @javax.annotation.Nullable + public Boolean getHasGeneratedSession() { + return hasGeneratedSession; + } + + public void setHasGeneratedSession(Boolean hasGeneratedSession) { + this.hasGeneratedSession = hasGeneratedSession; + } + + + public ProjectConfigSaveReq hasStartedUsingPasskeys(Boolean hasStartedUsingPasskeys) { + this.hasStartedUsingPasskeys = hasStartedUsingPasskeys; + return this; + } + + /** + * Get hasStartedUsingPasskeys + * @return hasStartedUsingPasskeys + **/ + @javax.annotation.Nullable + public Boolean getHasStartedUsingPasskeys() { + return hasStartedUsingPasskeys; + } + + public void setHasStartedUsingPasskeys(Boolean hasStartedUsingPasskeys) { + this.hasStartedUsingPasskeys = hasStartedUsingPasskeys; + } + + + public ProjectConfigSaveReq hasStartedUsingSessions(Boolean hasStartedUsingSessions) { + this.hasStartedUsingSessions = hasStartedUsingSessions; + return this; + } + + /** + * Get hasStartedUsingSessions + * @return hasStartedUsingSessions + **/ + @javax.annotation.Nullable + public Boolean getHasStartedUsingSessions() { + return hasStartedUsingSessions; + } + + public void setHasStartedUsingSessions(Boolean hasStartedUsingSessions) { + this.hasStartedUsingSessions = hasStartedUsingSessions; + } + + + public ProjectConfigSaveReq applicationUrl(String applicationUrl) { + this.applicationUrl = applicationUrl; + return this; + } + + /** + * Get applicationUrl + * @return applicationUrl + **/ + @javax.annotation.Nullable + public String getApplicationUrl() { + return applicationUrl; + } + + public void setApplicationUrl(String applicationUrl) { + this.applicationUrl = applicationUrl; + } + + + public ProjectConfigSaveReq useCli(Boolean useCli) { + this.useCli = useCli; + return this; + } + + /** + * Get useCli + * @return useCli + **/ + @javax.annotation.Nullable + public Boolean getUseCli() { + return useCli; + } + + public void setUseCli(Boolean useCli) { + this.useCli = useCli; + } + + + public ProjectConfigSaveReq doubleOptIn(Boolean doubleOptIn) { + this.doubleOptIn = doubleOptIn; + return this; + } + + /** + * Get doubleOptIn + * @return doubleOptIn + **/ + @javax.annotation.Nullable + public Boolean getDoubleOptIn() { + return doubleOptIn; + } + + public void setDoubleOptIn(Boolean doubleOptIn) { + this.doubleOptIn = doubleOptIn; + } + + + public ProjectConfigSaveReq userFullNameRequired(Boolean userFullNameRequired) { + this.userFullNameRequired = userFullNameRequired; + return this; + } + + /** + * Get userFullNameRequired + * @return userFullNameRequired + **/ + @javax.annotation.Nullable + public Boolean getUserFullNameRequired() { + return userFullNameRequired; + } + + public void setUserFullNameRequired(Boolean userFullNameRequired) { + this.userFullNameRequired = userFullNameRequired; + } + + + public ProjectConfigSaveReq webauthnRPID(String webauthnRPID) { + this.webauthnRPID = webauthnRPID; + return this; + } + + /** + * Get webauthnRPID + * @return webauthnRPID + **/ + @javax.annotation.Nullable + public String getWebauthnRPID() { + return webauthnRPID; + } + + public void setWebauthnRPID(String webauthnRPID) { + this.webauthnRPID = webauthnRPID; + } + + + public ProjectConfigSaveReq environment(EnvironmentEnum environment) { + this.environment = environment; + return this; + } + + /** + * Get environment + * @return environment + **/ + @javax.annotation.Nullable + public EnvironmentEnum getEnvironment() { + return environment; + } + + public void setEnvironment(EnvironmentEnum environment) { + this.environment = environment; + } + + + public ProjectConfigSaveReq frontendFramework(FrontendFrameworkEnum frontendFramework) { + this.frontendFramework = frontendFramework; + return this; + } + + /** + * Get frontendFramework + * @return frontendFramework + **/ + @javax.annotation.Nullable + public FrontendFrameworkEnum getFrontendFramework() { + return frontendFramework; + } + + public void setFrontendFramework(FrontendFrameworkEnum frontendFramework) { + this.frontendFramework = frontendFramework; + } + + + public ProjectConfigSaveReq backendLanguage(BackendLanguageEnum backendLanguage) { + this.backendLanguage = backendLanguage; + return this; + } + + /** + * Get backendLanguage + * @return backendLanguage + **/ + @javax.annotation.Nullable + public BackendLanguageEnum getBackendLanguage() { + return backendLanguage; + } + + public void setBackendLanguage(BackendLanguageEnum backendLanguage) { + this.backendLanguage = backendLanguage; + } + + + public ProjectConfigSaveReq webComponentDebug(Boolean webComponentDebug) { + this.webComponentDebug = webComponentDebug; + return this; + } + + /** + * Get webComponentDebug + * @return webComponentDebug + **/ + @javax.annotation.Nullable + public Boolean getWebComponentDebug() { + return webComponentDebug; + } + + public void setWebComponentDebug(Boolean webComponentDebug) { + this.webComponentDebug = webComponentDebug; + } + + + public ProjectConfigSaveReq smtpUseCustom(Boolean smtpUseCustom) { + this.smtpUseCustom = smtpUseCustom; + return this; + } + + /** + * Get smtpUseCustom + * @return smtpUseCustom + **/ + @javax.annotation.Nullable + public Boolean getSmtpUseCustom() { + return smtpUseCustom; + } + + public void setSmtpUseCustom(Boolean smtpUseCustom) { + this.smtpUseCustom = smtpUseCustom; + } + + + public ProjectConfigSaveReq smtpHost(String smtpHost) { + this.smtpHost = smtpHost; + return this; + } + + /** + * Get smtpHost + * @return smtpHost + **/ + @javax.annotation.Nullable + public String getSmtpHost() { + return smtpHost; + } + + public void setSmtpHost(String smtpHost) { + this.smtpHost = smtpHost; + } + + + public ProjectConfigSaveReq smtpPort(Integer smtpPort) { + this.smtpPort = smtpPort; + return this; + } + + /** + * Get smtpPort + * @return smtpPort + **/ + @javax.annotation.Nullable + public Integer getSmtpPort() { + return smtpPort; + } + + public void setSmtpPort(Integer smtpPort) { + this.smtpPort = smtpPort; + } + + + public ProjectConfigSaveReq smtpUsername(String smtpUsername) { + this.smtpUsername = smtpUsername; + return this; + } + + /** + * Get smtpUsername + * @return smtpUsername + **/ + @javax.annotation.Nullable + public String getSmtpUsername() { + return smtpUsername; + } + + public void setSmtpUsername(String smtpUsername) { + this.smtpUsername = smtpUsername; + } + + + public ProjectConfigSaveReq smtpPassword(String smtpPassword) { + this.smtpPassword = smtpPassword; + return this; + } + + /** + * Get smtpPassword + * @return smtpPassword + **/ + @javax.annotation.Nullable + public String getSmtpPassword() { + return smtpPassword; + } + + public void setSmtpPassword(String smtpPassword) { + this.smtpPassword = smtpPassword; + } + + + public ProjectConfigSaveReq supportEmail(String supportEmail) { + this.supportEmail = supportEmail; + return this; + } + + /** + * Get supportEmail + * @return supportEmail + **/ + @javax.annotation.Nullable + public String getSupportEmail() { + return supportEmail; + } + + public void setSupportEmail(String supportEmail) { + this.supportEmail = supportEmail; + } + + + public ProjectConfigSaveReq signupFlow(SignupFlowEnum signupFlow) { + this.signupFlow = signupFlow; + return this; + } + + /** + * Get signupFlow + * @return signupFlow + **/ + @javax.annotation.Nullable + public SignupFlowEnum getSignupFlow() { + return signupFlow; + } + + public void setSignupFlow(SignupFlowEnum signupFlow) { + this.signupFlow = signupFlow; + } + + + public ProjectConfigSaveReq signupFlowOptions(Object signupFlowOptions) { + this.signupFlowOptions = signupFlowOptions; + return this; + } + + /** + * Get signupFlowOptions + * @return signupFlowOptions + **/ + @javax.annotation.Nullable + public Object getSignupFlowOptions() { + return signupFlowOptions; + } + + public void setSignupFlowOptions(Object signupFlowOptions) { + this.signupFlowOptions = signupFlowOptions; + } + + + public ProjectConfigSaveReq loginFlow(LoginFlowEnum loginFlow) { + this.loginFlow = loginFlow; + return this; + } + + /** + * Get loginFlow + * @return loginFlow + **/ + @javax.annotation.Nullable + public LoginFlowEnum getLoginFlow() { + return loginFlow; + } + + public void setLoginFlow(LoginFlowEnum loginFlow) { + this.loginFlow = loginFlow; + } + + + public ProjectConfigSaveReq loginFlowOptions(Object loginFlowOptions) { + this.loginFlowOptions = loginFlowOptions; + return this; + } + + /** + * Get loginFlowOptions + * @return loginFlowOptions + **/ + @javax.annotation.Nullable + public Object getLoginFlowOptions() { + return loginFlowOptions; + } + + public void setLoginFlowOptions(Object loginFlowOptions) { + this.loginFlowOptions = loginFlowOptions; + } + + + public ProjectConfigSaveReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public ProjectConfigSaveReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + public ProjectConfigSaveReq allowStaticChallenges(Boolean allowStaticChallenges) { + this.allowStaticChallenges = allowStaticChallenges; + return this; + } + + /** + * Get allowStaticChallenges + * @return allowStaticChallenges + **/ + @javax.annotation.Nullable + public Boolean getAllowStaticChallenges() { + return allowStaticChallenges; + } + + public void setAllowStaticChallenges(Boolean allowStaticChallenges) { + this.allowStaticChallenges = allowStaticChallenges; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectConfigSaveReq projectConfigSaveReq = (ProjectConfigSaveReq) o; + return Objects.equals(this.externalName, projectConfigSaveReq.externalName) && + Objects.equals(this.appType, projectConfigSaveReq.appType) && + Objects.equals(this.productKey, projectConfigSaveReq.productKey) && + Objects.equals(this.emailFrom, projectConfigSaveReq.emailFrom) && + Objects.equals(this.smsFrom, projectConfigSaveReq.smsFrom) && + Objects.equals(this.externalApplicationProtocolVersion, projectConfigSaveReq.externalApplicationProtocolVersion) && + Objects.equals(this.webhookURL, projectConfigSaveReq.webhookURL) && + Objects.equals(this.webhookActions, projectConfigSaveReq.webhookActions) && + Objects.equals(this.webhookUsername, projectConfigSaveReq.webhookUsername) && + Objects.equals(this.webhookPassword, projectConfigSaveReq.webhookPassword) && + Objects.equals(this.webhookTestInvalidUsername, projectConfigSaveReq.webhookTestInvalidUsername) && + Objects.equals(this.webhookTestValidUsername, projectConfigSaveReq.webhookTestValidUsername) && + Objects.equals(this.webhookTestValidPassword, projectConfigSaveReq.webhookTestValidPassword) && + Objects.equals(this.externalApplicationUsername, projectConfigSaveReq.externalApplicationUsername) && + Objects.equals(this.externalApplicationPassword, projectConfigSaveReq.externalApplicationPassword) && + Objects.equals(this.legacyAuthMethodsUrl, projectConfigSaveReq.legacyAuthMethodsUrl) && + Objects.equals(this.passwordVerifyUrl, projectConfigSaveReq.passwordVerifyUrl) && + Objects.equals(this.authSuccessRedirectUrl, projectConfigSaveReq.authSuccessRedirectUrl) && + Objects.equals(this.passwordResetUrl, projectConfigSaveReq.passwordResetUrl) && + Objects.equals(this.allowUserRegistration, projectConfigSaveReq.allowUserRegistration) && + Objects.equals(this.allowIPStickiness, projectConfigSaveReq.allowIPStickiness) && + Objects.equals(this.passkeyAppendInterval, projectConfigSaveReq.passkeyAppendInterval) && + Objects.equals(this.fallbackLanguage, projectConfigSaveReq.fallbackLanguage) && + Objects.equals(this.autoDetectLanguage, projectConfigSaveReq.autoDetectLanguage) && + Objects.equals(this.hasExistingUsers, projectConfigSaveReq.hasExistingUsers) && + Objects.equals(this.hasVerifiedSession, projectConfigSaveReq.hasVerifiedSession) && + Objects.equals(this.hasGeneratedSession, projectConfigSaveReq.hasGeneratedSession) && + Objects.equals(this.hasStartedUsingPasskeys, projectConfigSaveReq.hasStartedUsingPasskeys) && + Objects.equals(this.hasStartedUsingSessions, projectConfigSaveReq.hasStartedUsingSessions) && + Objects.equals(this.applicationUrl, projectConfigSaveReq.applicationUrl) && + Objects.equals(this.useCli, projectConfigSaveReq.useCli) && + Objects.equals(this.doubleOptIn, projectConfigSaveReq.doubleOptIn) && + Objects.equals(this.userFullNameRequired, projectConfigSaveReq.userFullNameRequired) && + Objects.equals(this.webauthnRPID, projectConfigSaveReq.webauthnRPID) && + Objects.equals(this.environment, projectConfigSaveReq.environment) && + Objects.equals(this.frontendFramework, projectConfigSaveReq.frontendFramework) && + Objects.equals(this.backendLanguage, projectConfigSaveReq.backendLanguage) && + Objects.equals(this.webComponentDebug, projectConfigSaveReq.webComponentDebug) && + Objects.equals(this.smtpUseCustom, projectConfigSaveReq.smtpUseCustom) && + Objects.equals(this.smtpHost, projectConfigSaveReq.smtpHost) && + Objects.equals(this.smtpPort, projectConfigSaveReq.smtpPort) && + Objects.equals(this.smtpUsername, projectConfigSaveReq.smtpUsername) && + Objects.equals(this.smtpPassword, projectConfigSaveReq.smtpPassword) && + Objects.equals(this.supportEmail, projectConfigSaveReq.supportEmail) && + Objects.equals(this.signupFlow, projectConfigSaveReq.signupFlow) && + Objects.equals(this.signupFlowOptions, projectConfigSaveReq.signupFlowOptions) && + Objects.equals(this.loginFlow, projectConfigSaveReq.loginFlow) && + Objects.equals(this.loginFlowOptions, projectConfigSaveReq.loginFlowOptions) && + Objects.equals(this.requestID, projectConfigSaveReq.requestID) && + Objects.equals(this.clientInfo, projectConfigSaveReq.clientInfo) && + Objects.equals(this.allowStaticChallenges, projectConfigSaveReq.allowStaticChallenges); + } + + @Override + public int hashCode() { + return Objects.hash(externalName, appType, productKey, emailFrom, smsFrom, externalApplicationProtocolVersion, webhookURL, webhookActions, webhookUsername, webhookPassword, webhookTestInvalidUsername, webhookTestValidUsername, webhookTestValidPassword, externalApplicationUsername, externalApplicationPassword, legacyAuthMethodsUrl, passwordVerifyUrl, authSuccessRedirectUrl, passwordResetUrl, allowUserRegistration, allowIPStickiness, passkeyAppendInterval, fallbackLanguage, autoDetectLanguage, hasExistingUsers, hasVerifiedSession, hasGeneratedSession, hasStartedUsingPasskeys, hasStartedUsingSessions, applicationUrl, useCli, doubleOptIn, userFullNameRequired, webauthnRPID, environment, frontendFramework, backendLanguage, webComponentDebug, smtpUseCustom, smtpHost, smtpPort, smtpUsername, smtpPassword, supportEmail, signupFlow, signupFlowOptions, loginFlow, loginFlowOptions, requestID, clientInfo, allowStaticChallenges); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectConfigSaveReq {\n"); + sb.append(" externalName: ").append(toIndentedString(externalName)).append("\n"); + sb.append(" appType: ").append(toIndentedString(appType)).append("\n"); + sb.append(" productKey: ").append(toIndentedString(productKey)).append("\n"); + sb.append(" emailFrom: ").append(toIndentedString(emailFrom)).append("\n"); + sb.append(" smsFrom: ").append(toIndentedString(smsFrom)).append("\n"); + sb.append(" externalApplicationProtocolVersion: ").append(toIndentedString(externalApplicationProtocolVersion)).append("\n"); + sb.append(" webhookURL: ").append(toIndentedString(webhookURL)).append("\n"); + sb.append(" webhookActions: ").append(toIndentedString(webhookActions)).append("\n"); + sb.append(" webhookUsername: ").append(toIndentedString(webhookUsername)).append("\n"); + sb.append(" webhookPassword: ").append(toIndentedString(webhookPassword)).append("\n"); + sb.append(" webhookTestInvalidUsername: ").append(toIndentedString(webhookTestInvalidUsername)).append("\n"); + sb.append(" webhookTestValidUsername: ").append(toIndentedString(webhookTestValidUsername)).append("\n"); + sb.append(" webhookTestValidPassword: ").append(toIndentedString(webhookTestValidPassword)).append("\n"); + sb.append(" externalApplicationUsername: ").append(toIndentedString(externalApplicationUsername)).append("\n"); + sb.append(" externalApplicationPassword: ").append(toIndentedString(externalApplicationPassword)).append("\n"); + sb.append(" legacyAuthMethodsUrl: ").append(toIndentedString(legacyAuthMethodsUrl)).append("\n"); + sb.append(" passwordVerifyUrl: ").append(toIndentedString(passwordVerifyUrl)).append("\n"); + sb.append(" authSuccessRedirectUrl: ").append(toIndentedString(authSuccessRedirectUrl)).append("\n"); + sb.append(" passwordResetUrl: ").append(toIndentedString(passwordResetUrl)).append("\n"); + sb.append(" allowUserRegistration: ").append(toIndentedString(allowUserRegistration)).append("\n"); + sb.append(" allowIPStickiness: ").append(toIndentedString(allowIPStickiness)).append("\n"); + sb.append(" passkeyAppendInterval: ").append(toIndentedString(passkeyAppendInterval)).append("\n"); + sb.append(" fallbackLanguage: ").append(toIndentedString(fallbackLanguage)).append("\n"); + sb.append(" autoDetectLanguage: ").append(toIndentedString(autoDetectLanguage)).append("\n"); + sb.append(" hasExistingUsers: ").append(toIndentedString(hasExistingUsers)).append("\n"); + sb.append(" hasVerifiedSession: ").append(toIndentedString(hasVerifiedSession)).append("\n"); + sb.append(" hasGeneratedSession: ").append(toIndentedString(hasGeneratedSession)).append("\n"); + sb.append(" hasStartedUsingPasskeys: ").append(toIndentedString(hasStartedUsingPasskeys)).append("\n"); + sb.append(" hasStartedUsingSessions: ").append(toIndentedString(hasStartedUsingSessions)).append("\n"); + sb.append(" applicationUrl: ").append(toIndentedString(applicationUrl)).append("\n"); + sb.append(" useCli: ").append(toIndentedString(useCli)).append("\n"); + sb.append(" doubleOptIn: ").append(toIndentedString(doubleOptIn)).append("\n"); + sb.append(" userFullNameRequired: ").append(toIndentedString(userFullNameRequired)).append("\n"); + sb.append(" webauthnRPID: ").append(toIndentedString(webauthnRPID)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" frontendFramework: ").append(toIndentedString(frontendFramework)).append("\n"); + sb.append(" backendLanguage: ").append(toIndentedString(backendLanguage)).append("\n"); + sb.append(" webComponentDebug: ").append(toIndentedString(webComponentDebug)).append("\n"); + sb.append(" smtpUseCustom: ").append(toIndentedString(smtpUseCustom)).append("\n"); + sb.append(" smtpHost: ").append(toIndentedString(smtpHost)).append("\n"); + sb.append(" smtpPort: ").append(toIndentedString(smtpPort)).append("\n"); + sb.append(" smtpUsername: ").append(toIndentedString(smtpUsername)).append("\n"); + sb.append(" smtpPassword: ").append(toIndentedString(smtpPassword)).append("\n"); + sb.append(" supportEmail: ").append(toIndentedString(supportEmail)).append("\n"); + sb.append(" signupFlow: ").append(toIndentedString(signupFlow)).append("\n"); + sb.append(" signupFlowOptions: ").append(toIndentedString(signupFlowOptions)).append("\n"); + sb.append(" loginFlow: ").append(toIndentedString(loginFlow)).append("\n"); + sb.append(" loginFlowOptions: ").append(toIndentedString(loginFlowOptions)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append(" allowStaticChallenges: ").append(toIndentedString(allowStaticChallenges)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("externalName"); + openapiFields.add("appType"); + openapiFields.add("productKey"); + openapiFields.add("emailFrom"); + openapiFields.add("smsFrom"); + openapiFields.add("externalApplicationProtocolVersion"); + openapiFields.add("webhookURL"); + openapiFields.add("webhookActions"); + openapiFields.add("webhookUsername"); + openapiFields.add("webhookPassword"); + openapiFields.add("webhookTestInvalidUsername"); + openapiFields.add("webhookTestValidUsername"); + openapiFields.add("webhookTestValidPassword"); + openapiFields.add("externalApplicationUsername"); + openapiFields.add("externalApplicationPassword"); + openapiFields.add("legacyAuthMethodsUrl"); + openapiFields.add("passwordVerifyUrl"); + openapiFields.add("authSuccessRedirectUrl"); + openapiFields.add("passwordResetUrl"); + openapiFields.add("allowUserRegistration"); + openapiFields.add("allowIPStickiness"); + openapiFields.add("passkeyAppendInterval"); + openapiFields.add("fallbackLanguage"); + openapiFields.add("autoDetectLanguage"); + openapiFields.add("hasExistingUsers"); + openapiFields.add("hasVerifiedSession"); + openapiFields.add("hasGeneratedSession"); + openapiFields.add("hasStartedUsingPasskeys"); + openapiFields.add("hasStartedUsingSessions"); + openapiFields.add("applicationUrl"); + openapiFields.add("useCli"); + openapiFields.add("doubleOptIn"); + openapiFields.add("userFullNameRequired"); + openapiFields.add("webauthnRPID"); + openapiFields.add("environment"); + openapiFields.add("frontendFramework"); + openapiFields.add("backendLanguage"); + openapiFields.add("webComponentDebug"); + openapiFields.add("smtpUseCustom"); + openapiFields.add("smtpHost"); + openapiFields.add("smtpPort"); + openapiFields.add("smtpUsername"); + openapiFields.add("smtpPassword"); + openapiFields.add("supportEmail"); + openapiFields.add("signupFlow"); + openapiFields.add("signupFlowOptions"); + openapiFields.add("loginFlow"); + openapiFields.add("loginFlowOptions"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + openapiFields.add("allowStaticChallenges"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ProjectConfigSaveReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProjectConfigSaveReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectConfigSaveReq is not found in the empty JSON string", ProjectConfigSaveReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ProjectConfigSaveReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectConfigSaveReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("externalName") != null && !jsonObj.get("externalName").isJsonNull()) && !jsonObj.get("externalName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `externalName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalName").toString())); + } + // validate the optional field `appType` + if (jsonObj.get("appType") != null && !jsonObj.get("appType").isJsonNull()) { + AppType.validateJsonElement(jsonObj.get("appType")); + } + if ((jsonObj.get("productKey") != null && !jsonObj.get("productKey").isJsonNull()) && !jsonObj.get("productKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `productKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productKey").toString())); + } + if ((jsonObj.get("emailFrom") != null && !jsonObj.get("emailFrom").isJsonNull()) && !jsonObj.get("emailFrom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `emailFrom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailFrom").toString())); + } + if ((jsonObj.get("smsFrom") != null && !jsonObj.get("smsFrom").isJsonNull()) && !jsonObj.get("smsFrom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `smsFrom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smsFrom").toString())); + } + if ((jsonObj.get("externalApplicationProtocolVersion") != null && !jsonObj.get("externalApplicationProtocolVersion").isJsonNull()) && !jsonObj.get("externalApplicationProtocolVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `externalApplicationProtocolVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalApplicationProtocolVersion").toString())); + } + // validate the optional field `externalApplicationProtocolVersion` + if (jsonObj.get("externalApplicationProtocolVersion") != null && !jsonObj.get("externalApplicationProtocolVersion").isJsonNull()) { + ExternalApplicationProtocolVersionEnum.validateJsonElement(jsonObj.get("externalApplicationProtocolVersion")); + } + if ((jsonObj.get("webhookURL") != null && !jsonObj.get("webhookURL").isJsonNull()) && !jsonObj.get("webhookURL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookURL").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("webhookActions") != null && !jsonObj.get("webhookActions").isJsonNull() && !jsonObj.get("webhookActions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookActions` to be an array in the JSON string but got `%s`", jsonObj.get("webhookActions").toString())); + } + if ((jsonObj.get("webhookUsername") != null && !jsonObj.get("webhookUsername").isJsonNull()) && !jsonObj.get("webhookUsername").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookUsername").toString())); + } + if ((jsonObj.get("webhookPassword") != null && !jsonObj.get("webhookPassword").isJsonNull()) && !jsonObj.get("webhookPassword").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookPassword").toString())); + } + if ((jsonObj.get("webhookTestInvalidUsername") != null && !jsonObj.get("webhookTestInvalidUsername").isJsonNull()) && !jsonObj.get("webhookTestInvalidUsername").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookTestInvalidUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookTestInvalidUsername").toString())); + } + if ((jsonObj.get("webhookTestValidUsername") != null && !jsonObj.get("webhookTestValidUsername").isJsonNull()) && !jsonObj.get("webhookTestValidUsername").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookTestValidUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookTestValidUsername").toString())); + } + if ((jsonObj.get("webhookTestValidPassword") != null && !jsonObj.get("webhookTestValidPassword").isJsonNull()) && !jsonObj.get("webhookTestValidPassword").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookTestValidPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookTestValidPassword").toString())); + } + if ((jsonObj.get("externalApplicationUsername") != null && !jsonObj.get("externalApplicationUsername").isJsonNull()) && !jsonObj.get("externalApplicationUsername").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `externalApplicationUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalApplicationUsername").toString())); + } + if ((jsonObj.get("externalApplicationPassword") != null && !jsonObj.get("externalApplicationPassword").isJsonNull()) && !jsonObj.get("externalApplicationPassword").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `externalApplicationPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalApplicationPassword").toString())); + } + if ((jsonObj.get("legacyAuthMethodsUrl") != null && !jsonObj.get("legacyAuthMethodsUrl").isJsonNull()) && !jsonObj.get("legacyAuthMethodsUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `legacyAuthMethodsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legacyAuthMethodsUrl").toString())); + } + if ((jsonObj.get("passwordVerifyUrl") != null && !jsonObj.get("passwordVerifyUrl").isJsonNull()) && !jsonObj.get("passwordVerifyUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `passwordVerifyUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passwordVerifyUrl").toString())); + } + if ((jsonObj.get("authSuccessRedirectUrl") != null && !jsonObj.get("authSuccessRedirectUrl").isJsonNull()) && !jsonObj.get("authSuccessRedirectUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authSuccessRedirectUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authSuccessRedirectUrl").toString())); + } + if ((jsonObj.get("passwordResetUrl") != null && !jsonObj.get("passwordResetUrl").isJsonNull()) && !jsonObj.get("passwordResetUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `passwordResetUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passwordResetUrl").toString())); + } + if ((jsonObj.get("passkeyAppendInterval") != null && !jsonObj.get("passkeyAppendInterval").isJsonNull()) && !jsonObj.get("passkeyAppendInterval").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `passkeyAppendInterval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passkeyAppendInterval").toString())); + } + // validate the optional field `passkeyAppendInterval` + if (jsonObj.get("passkeyAppendInterval") != null && !jsonObj.get("passkeyAppendInterval").isJsonNull()) { + PasskeyAppendIntervalEnum.validateJsonElement(jsonObj.get("passkeyAppendInterval")); + } + if ((jsonObj.get("fallbackLanguage") != null && !jsonObj.get("fallbackLanguage").isJsonNull()) && !jsonObj.get("fallbackLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fallbackLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fallbackLanguage").toString())); + } + if ((jsonObj.get("applicationUrl") != null && !jsonObj.get("applicationUrl").isJsonNull()) && !jsonObj.get("applicationUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `applicationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applicationUrl").toString())); + } + if ((jsonObj.get("webauthnRPID") != null && !jsonObj.get("webauthnRPID").isJsonNull()) && !jsonObj.get("webauthnRPID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `webauthnRPID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webauthnRPID").toString())); + } + if ((jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonNull()) && !jsonObj.get("environment").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `environment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environment").toString())); + } + // validate the optional field `environment` + if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonNull()) { + EnvironmentEnum.validateJsonElement(jsonObj.get("environment")); + } + if ((jsonObj.get("frontendFramework") != null && !jsonObj.get("frontendFramework").isJsonNull()) && !jsonObj.get("frontendFramework").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `frontendFramework` to be a primitive type in the JSON string but got `%s`", jsonObj.get("frontendFramework").toString())); + } + // validate the optional field `frontendFramework` + if (jsonObj.get("frontendFramework") != null && !jsonObj.get("frontendFramework").isJsonNull()) { + FrontendFrameworkEnum.validateJsonElement(jsonObj.get("frontendFramework")); + } + if ((jsonObj.get("backendLanguage") != null && !jsonObj.get("backendLanguage").isJsonNull()) && !jsonObj.get("backendLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `backendLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("backendLanguage").toString())); + } + // validate the optional field `backendLanguage` + if (jsonObj.get("backendLanguage") != null && !jsonObj.get("backendLanguage").isJsonNull()) { + BackendLanguageEnum.validateJsonElement(jsonObj.get("backendLanguage")); + } + if ((jsonObj.get("smtpHost") != null && !jsonObj.get("smtpHost").isJsonNull()) && !jsonObj.get("smtpHost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `smtpHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpHost").toString())); + } + if ((jsonObj.get("smtpUsername") != null && !jsonObj.get("smtpUsername").isJsonNull()) && !jsonObj.get("smtpUsername").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `smtpUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpUsername").toString())); + } + if ((jsonObj.get("smtpPassword") != null && !jsonObj.get("smtpPassword").isJsonNull()) && !jsonObj.get("smtpPassword").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `smtpPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpPassword").toString())); + } + if ((jsonObj.get("supportEmail") != null && !jsonObj.get("supportEmail").isJsonNull()) && !jsonObj.get("supportEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `supportEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("supportEmail").toString())); + } + if ((jsonObj.get("signupFlow") != null && !jsonObj.get("signupFlow").isJsonNull()) && !jsonObj.get("signupFlow").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signupFlow` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signupFlow").toString())); + } + // validate the optional field `signupFlow` + if (jsonObj.get("signupFlow") != null && !jsonObj.get("signupFlow").isJsonNull()) { + SignupFlowEnum.validateJsonElement(jsonObj.get("signupFlow")); + } + if ((jsonObj.get("loginFlow") != null && !jsonObj.get("loginFlow").isJsonNull()) && !jsonObj.get("loginFlow").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loginFlow` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginFlow").toString())); + } + // validate the optional field `loginFlow` + if (jsonObj.get("loginFlow") != null && !jsonObj.get("loginFlow").isJsonNull()) { + LoginFlowEnum.validateJsonElement(jsonObj.get("loginFlow")); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProjectConfigSaveReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProjectConfigSaveReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProjectConfigSaveReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ProjectConfigSaveReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProjectConfigSaveReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProjectConfigSaveReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProjectConfigSaveReq + * @throws IOException if the JSON string is invalid with respect to ProjectConfigSaveReq + */ + public static ProjectConfigSaveReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProjectConfigSaveReq.class); + } + + /** + * Convert an instance of ProjectConfigSaveReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestReq.java b/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestReq.java new file mode 100644 index 0000000..8bf71bb --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestReq.java @@ -0,0 +1,328 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ProjectConfigWebhookTestReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ProjectConfigWebhookTestReq { + /** + * Gets or Sets action + */ + @JsonAdapter(ActionEnum.Adapter.class) + public enum ActionEnum { + AUTH_METHODS("authMethods"), + + PASSWORD_VERIFY("passwordVerify"); + + private String value; + + ActionEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ActionEnum fromValue(String value) { + for (ActionEnum b : ActionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ActionEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ActionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ActionEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ActionEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ACTION = "action"; + @SerializedName(SERIALIZED_NAME_ACTION) + private ActionEnum action; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public ProjectConfigWebhookTestReq() { + } + + public ProjectConfigWebhookTestReq action(ActionEnum action) { + this.action = action; + return this; + } + + /** + * Get action + * @return action + **/ + @javax.annotation.Nonnull + public ActionEnum getAction() { + return action; + } + + public void setAction(ActionEnum action) { + this.action = action; + } + + + public ProjectConfigWebhookTestReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public ProjectConfigWebhookTestReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectConfigWebhookTestReq projectConfigWebhookTestReq = (ProjectConfigWebhookTestReq) o; + return Objects.equals(this.action, projectConfigWebhookTestReq.action) && + Objects.equals(this.requestID, projectConfigWebhookTestReq.requestID) && + Objects.equals(this.clientInfo, projectConfigWebhookTestReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(action, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectConfigWebhookTestReq {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("action"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("action"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ProjectConfigWebhookTestReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProjectConfigWebhookTestReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectConfigWebhookTestReq is not found in the empty JSON string", ProjectConfigWebhookTestReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ProjectConfigWebhookTestReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectConfigWebhookTestReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProjectConfigWebhookTestReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("action").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString())); + } + // validate the required field `action` + ActionEnum.validateJsonElement(jsonObj.get("action")); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProjectConfigWebhookTestReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProjectConfigWebhookTestReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProjectConfigWebhookTestReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ProjectConfigWebhookTestReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProjectConfigWebhookTestReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProjectConfigWebhookTestReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProjectConfigWebhookTestReq + * @throws IOException if the JSON string is invalid with respect to ProjectConfigWebhookTestReq + */ + public static ProjectConfigWebhookTestReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProjectConfigWebhookTestReq.class); + } + + /** + * Convert an instance of ProjectConfigWebhookTestReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRsp.java b/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRsp.java new file mode 100644 index 0000000..5dfe28c --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ProjectConfigWebhookTestRspAllOfData; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ProjectConfigWebhookTestRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ProjectConfigWebhookTestRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private ProjectConfigWebhookTestRspAllOfData data; + + public ProjectConfigWebhookTestRsp() { + } + + public ProjectConfigWebhookTestRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public ProjectConfigWebhookTestRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public ProjectConfigWebhookTestRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public ProjectConfigWebhookTestRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public ProjectConfigWebhookTestRsp data(ProjectConfigWebhookTestRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public ProjectConfigWebhookTestRspAllOfData getData() { + return data; + } + + public void setData(ProjectConfigWebhookTestRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectConfigWebhookTestRsp projectConfigWebhookTestRsp = (ProjectConfigWebhookTestRsp) o; + return Objects.equals(this.httpStatusCode, projectConfigWebhookTestRsp.httpStatusCode) && + Objects.equals(this.message, projectConfigWebhookTestRsp.message) && + Objects.equals(this.requestData, projectConfigWebhookTestRsp.requestData) && + Objects.equals(this.runtime, projectConfigWebhookTestRsp.runtime) && + Objects.equals(this.data, projectConfigWebhookTestRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectConfigWebhookTestRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ProjectConfigWebhookTestRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProjectConfigWebhookTestRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectConfigWebhookTestRsp is not found in the empty JSON string", ProjectConfigWebhookTestRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ProjectConfigWebhookTestRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectConfigWebhookTestRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProjectConfigWebhookTestRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + ProjectConfigWebhookTestRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProjectConfigWebhookTestRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProjectConfigWebhookTestRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProjectConfigWebhookTestRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ProjectConfigWebhookTestRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProjectConfigWebhookTestRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProjectConfigWebhookTestRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProjectConfigWebhookTestRsp + * @throws IOException if the JSON string is invalid with respect to ProjectConfigWebhookTestRsp + */ + public static ProjectConfigWebhookTestRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProjectConfigWebhookTestRsp.class); + } + + /** + * Convert an instance of ProjectConfigWebhookTestRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRspAllOfData.java b/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRspAllOfData.java new file mode 100644 index 0000000..aa8bb6a --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRspAllOfData.java @@ -0,0 +1,272 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ProjectConfigWebhookTestRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ProjectConfigWebhookTestRspAllOfData { + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + public static final String SERIALIZED_NAME_DETAILS = "details"; + @SerializedName(SERIALIZED_NAME_DETAILS) + private String details; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private BigDecimal runtime; + + public ProjectConfigWebhookTestRspAllOfData() { + } + + public ProjectConfigWebhookTestRspAllOfData code(String code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @javax.annotation.Nonnull + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + + public ProjectConfigWebhookTestRspAllOfData details(String details) { + this.details = details; + return this; + } + + /** + * Get details + * @return details + **/ + @javax.annotation.Nonnull + public String getDetails() { + return details; + } + + public void setDetails(String details) { + this.details = details; + } + + + public ProjectConfigWebhookTestRspAllOfData runtime(BigDecimal runtime) { + this.runtime = runtime; + return this; + } + + /** + * Get runtime + * @return runtime + **/ + @javax.annotation.Nonnull + public BigDecimal getRuntime() { + return runtime; + } + + public void setRuntime(BigDecimal runtime) { + this.runtime = runtime; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectConfigWebhookTestRspAllOfData projectConfigWebhookTestRspAllOfData = (ProjectConfigWebhookTestRspAllOfData) o; + return Objects.equals(this.code, projectConfigWebhookTestRspAllOfData.code) && + Objects.equals(this.details, projectConfigWebhookTestRspAllOfData.details) && + Objects.equals(this.runtime, projectConfigWebhookTestRspAllOfData.runtime); + } + + @Override + public int hashCode() { + return Objects.hash(code, details, runtime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectConfigWebhookTestRspAllOfData {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("details"); + openapiFields.add("runtime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("code"); + openapiRequiredFields.add("details"); + openapiRequiredFields.add("runtime"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ProjectConfigWebhookTestRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProjectConfigWebhookTestRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectConfigWebhookTestRspAllOfData is not found in the empty JSON string", ProjectConfigWebhookTestRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ProjectConfigWebhookTestRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectConfigWebhookTestRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProjectConfigWebhookTestRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if (!jsonObj.get("details").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `details` to be a primitive type in the JSON string but got `%s`", jsonObj.get("details").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProjectConfigWebhookTestRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProjectConfigWebhookTestRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProjectConfigWebhookTestRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ProjectConfigWebhookTestRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProjectConfigWebhookTestRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProjectConfigWebhookTestRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProjectConfigWebhookTestRspAllOfData + * @throws IOException if the JSON string is invalid with respect to ProjectConfigWebhookTestRspAllOfData + */ + public static ProjectConfigWebhookTestRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProjectConfigWebhookTestRspAllOfData.class); + } + + /** + * Convert an instance of ProjectConfigWebhookTestRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ProjectSecretCreateReq.java b/src/main/java/com/corbado/generated/model/ProjectSecretCreateReq.java new file mode 100644 index 0000000..314ff40 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ProjectSecretCreateReq.java @@ -0,0 +1,237 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ProjectSecretCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ProjectSecretCreateReq { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public ProjectSecretCreateReq() { + } + + public ProjectSecretCreateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public ProjectSecretCreateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectSecretCreateReq projectSecretCreateReq = (ProjectSecretCreateReq) o; + return Objects.equals(this.requestID, projectSecretCreateReq.requestID) && + Objects.equals(this.clientInfo, projectSecretCreateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectSecretCreateReq {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ProjectSecretCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProjectSecretCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectSecretCreateReq is not found in the empty JSON string", ProjectSecretCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ProjectSecretCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectSecretCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProjectSecretCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProjectSecretCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProjectSecretCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ProjectSecretCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProjectSecretCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProjectSecretCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProjectSecretCreateReq + * @throws IOException if the JSON string is invalid with respect to ProjectSecretCreateReq + */ + public static ProjectSecretCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProjectSecretCreateReq.class); + } + + /** + * Convert an instance of ProjectSecretCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ProjectSecretCreateRsp.java b/src/main/java/com/corbado/generated/model/ProjectSecretCreateRsp.java new file mode 100644 index 0000000..0c72f48 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ProjectSecretCreateRsp.java @@ -0,0 +1,419 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ProjectSecretCreateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ProjectSecretCreateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public static final String SERIALIZED_NAME_HINT = "hint"; + @SerializedName(SERIALIZED_NAME_HINT) + private String hint; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public ProjectSecretCreateRsp() { + } + + public ProjectSecretCreateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public ProjectSecretCreateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public ProjectSecretCreateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public ProjectSecretCreateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public ProjectSecretCreateRsp id(String id) { + this.id = id; + return this; + } + + /** + * ID of project secret + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public ProjectSecretCreateRsp secret(String secret) { + this.secret = secret; + return this; + } + + /** + * Server-side generated secret. Only filled on create + * @return secret + **/ + @javax.annotation.Nullable + public String getSecret() { + return secret; + } + + public void setSecret(String secret) { + this.secret = secret; + } + + + public ProjectSecretCreateRsp hint(String hint) { + this.hint = hint; + return this; + } + + /** + * Hint of the server-side generated secret. First 3 characters and last 3 characters + * @return hint + **/ + @javax.annotation.Nonnull + public String getHint() { + return hint; + } + + public void setHint(String hint) { + this.hint = hint; + } + + + public ProjectSecretCreateRsp created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectSecretCreateRsp projectSecretCreateRsp = (ProjectSecretCreateRsp) o; + return Objects.equals(this.httpStatusCode, projectSecretCreateRsp.httpStatusCode) && + Objects.equals(this.message, projectSecretCreateRsp.message) && + Objects.equals(this.requestData, projectSecretCreateRsp.requestData) && + Objects.equals(this.runtime, projectSecretCreateRsp.runtime) && + Objects.equals(this.id, projectSecretCreateRsp.id) && + Objects.equals(this.secret, projectSecretCreateRsp.secret) && + Objects.equals(this.hint, projectSecretCreateRsp.hint) && + Objects.equals(this.created, projectSecretCreateRsp.created); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, id, secret, hint, created); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectSecretCreateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("id"); + openapiFields.add("secret"); + openapiFields.add("hint"); + openapiFields.add("created"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("hint"); + openapiRequiredFields.add("created"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ProjectSecretCreateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProjectSecretCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectSecretCreateRsp is not found in the empty JSON string", ProjectSecretCreateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ProjectSecretCreateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectSecretCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProjectSecretCreateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("secret") != null && !jsonObj.get("secret").isJsonNull()) && !jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + if (!jsonObj.get("hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProjectSecretCreateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProjectSecretCreateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProjectSecretCreateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ProjectSecretCreateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProjectSecretCreateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProjectSecretCreateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProjectSecretCreateRsp + * @throws IOException if the JSON string is invalid with respect to ProjectSecretCreateRsp + */ + public static ProjectSecretCreateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProjectSecretCreateRsp.class); + } + + /** + * Convert an instance of ProjectSecretCreateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ProjectSecretDeleteReq.java b/src/main/java/com/corbado/generated/model/ProjectSecretDeleteReq.java new file mode 100644 index 0000000..2a5b1fe --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ProjectSecretDeleteReq.java @@ -0,0 +1,237 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ProjectSecretDeleteReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ProjectSecretDeleteReq { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public ProjectSecretDeleteReq() { + } + + public ProjectSecretDeleteReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public ProjectSecretDeleteReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectSecretDeleteReq projectSecretDeleteReq = (ProjectSecretDeleteReq) o; + return Objects.equals(this.requestID, projectSecretDeleteReq.requestID) && + Objects.equals(this.clientInfo, projectSecretDeleteReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectSecretDeleteReq {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ProjectSecretDeleteReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProjectSecretDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectSecretDeleteReq is not found in the empty JSON string", ProjectSecretDeleteReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ProjectSecretDeleteReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectSecretDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProjectSecretDeleteReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProjectSecretDeleteReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProjectSecretDeleteReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ProjectSecretDeleteReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProjectSecretDeleteReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProjectSecretDeleteReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProjectSecretDeleteReq + * @throws IOException if the JSON string is invalid with respect to ProjectSecretDeleteReq + */ + public static ProjectSecretDeleteReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProjectSecretDeleteReq.class); + } + + /** + * Convert an instance of ProjectSecretDeleteReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ProjectSecretItem.java b/src/main/java/com/corbado/generated/model/ProjectSecretItem.java new file mode 100644 index 0000000..7e1f042 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ProjectSecretItem.java @@ -0,0 +1,303 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ProjectSecretItem + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ProjectSecretItem { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public static final String SERIALIZED_NAME_HINT = "hint"; + @SerializedName(SERIALIZED_NAME_HINT) + private String hint; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public ProjectSecretItem() { + } + + public ProjectSecretItem id(String id) { + this.id = id; + return this; + } + + /** + * ID of project secret + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public ProjectSecretItem secret(String secret) { + this.secret = secret; + return this; + } + + /** + * Server-side generated secret. Only filled on create + * @return secret + **/ + @javax.annotation.Nullable + public String getSecret() { + return secret; + } + + public void setSecret(String secret) { + this.secret = secret; + } + + + public ProjectSecretItem hint(String hint) { + this.hint = hint; + return this; + } + + /** + * Hint of the server-side generated secret. First 3 characters and last 3 characters + * @return hint + **/ + @javax.annotation.Nonnull + public String getHint() { + return hint; + } + + public void setHint(String hint) { + this.hint = hint; + } + + + public ProjectSecretItem created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectSecretItem projectSecretItem = (ProjectSecretItem) o; + return Objects.equals(this.id, projectSecretItem.id) && + Objects.equals(this.secret, projectSecretItem.secret) && + Objects.equals(this.hint, projectSecretItem.hint) && + Objects.equals(this.created, projectSecretItem.created); + } + + @Override + public int hashCode() { + return Objects.hash(id, secret, hint, created); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectSecretItem {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("secret"); + openapiFields.add("hint"); + openapiFields.add("created"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("hint"); + openapiRequiredFields.add("created"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ProjectSecretItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProjectSecretItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectSecretItem is not found in the empty JSON string", ProjectSecretItem.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ProjectSecretItem.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectSecretItem` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProjectSecretItem.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("secret") != null && !jsonObj.get("secret").isJsonNull()) && !jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + if (!jsonObj.get("hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProjectSecretItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProjectSecretItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProjectSecretItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ProjectSecretItem value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProjectSecretItem read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProjectSecretItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProjectSecretItem + * @throws IOException if the JSON string is invalid with respect to ProjectSecretItem + */ + public static ProjectSecretItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProjectSecretItem.class); + } + + /** + * Convert an instance of ProjectSecretItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ProjectSecretListRsp.java b/src/main/java/com/corbado/generated/model/ProjectSecretListRsp.java new file mode 100644 index 0000000..7780529 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ProjectSecretListRsp.java @@ -0,0 +1,378 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.ProjectSecretItem; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ProjectSecretListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ProjectSecretListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_ROWS = "rows"; + @SerializedName(SERIALIZED_NAME_ROWS) + private List rows = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public ProjectSecretListRsp() { + } + + public ProjectSecretListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public ProjectSecretListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public ProjectSecretListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public ProjectSecretListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public ProjectSecretListRsp rows(List rows) { + this.rows = rows; + return this; + } + + public ProjectSecretListRsp addRowsItem(ProjectSecretItem rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * @return rows + **/ + @javax.annotation.Nonnull + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + + public ProjectSecretListRsp paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectSecretListRsp projectSecretListRsp = (ProjectSecretListRsp) o; + return Objects.equals(this.httpStatusCode, projectSecretListRsp.httpStatusCode) && + Objects.equals(this.message, projectSecretListRsp.message) && + Objects.equals(this.requestData, projectSecretListRsp.requestData) && + Objects.equals(this.runtime, projectSecretListRsp.runtime) && + Objects.equals(this.rows, projectSecretListRsp.rows) && + Objects.equals(this.paging, projectSecretListRsp.paging); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, rows, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectSecretListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("rows"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("rows"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ProjectSecretListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProjectSecretListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectSecretListRsp is not found in the empty JSON string", ProjectSecretListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ProjectSecretListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectSecretListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProjectSecretListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rows` to be an array in the JSON string but got `%s`", jsonObj.get("rows").toString())); + } + + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + // validate the required field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + ProjectSecretItem.validateJsonElement(jsonArrayrows.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProjectSecretListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProjectSecretListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProjectSecretListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ProjectSecretListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProjectSecretListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProjectSecretListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProjectSecretListRsp + * @throws IOException if the JSON string is invalid with respect to ProjectSecretListRsp + */ + public static ProjectSecretListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProjectSecretListRsp.class); + } + + /** + * Convert an instance of ProjectSecretListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/RequestData.java b/src/main/java/com/corbado/generated/model/RequestData.java new file mode 100644 index 0000000..67f2e97 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/RequestData.java @@ -0,0 +1,244 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * Data about the request itself, can be used for debugging + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class RequestData { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_LINK = "link"; + @SerializedName(SERIALIZED_NAME_LINK) + private String link; + + public RequestData() { + } + + public RequestData requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nonnull + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public RequestData link(String link) { + this.link = link; + return this; + } + + /** + * Link to dashboard with details about request + * @return link + **/ + @javax.annotation.Nonnull + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestData requestData = (RequestData) o; + return Objects.equals(this.requestID, requestData.requestID) && + Objects.equals(this.link, requestData.link); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, link); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestData {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" link: ").append(toIndentedString(link)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("link"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("requestID"); + openapiRequiredFields.add("link"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RequestData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RequestData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RequestData is not found in the empty JSON string", RequestData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RequestData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RequestData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RequestData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + if (!jsonObj.get("link").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `link` to be a primitive type in the JSON string but got `%s`", jsonObj.get("link").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RequestData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RequestData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RequestData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RequestData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RequestData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RequestData given an JSON string + * + * @param jsonString JSON string + * @return An instance of RequestData + * @throws IOException if the JSON string is invalid with respect to RequestData + */ + public static RequestData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RequestData.class); + } + + /** + * Convert an instance of RequestData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/RequestLog.java b/src/main/java/com/corbado/generated/model/RequestLog.java new file mode 100644 index 0000000..fb25459 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/RequestLog.java @@ -0,0 +1,706 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * Request log entry + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class RequestLog { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; + @SerializedName(SERIALIZED_NAME_PROJECT_I_D) + private String projectID; + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_APPLICATION = "application"; + @SerializedName(SERIALIZED_NAME_APPLICATION) + private String application; + + public static final String SERIALIZED_NAME_METHOD = "method"; + @SerializedName(SERIALIZED_NAME_METHOD) + private String method; + + public static final String SERIALIZED_NAME_ENDPOINT = "endpoint"; + @SerializedName(SERIALIZED_NAME_ENDPOINT) + private String endpoint; + + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + private String source; + + public static final String SERIALIZED_NAME_REQUEST = "request"; + @SerializedName(SERIALIZED_NAME_REQUEST) + private String request; + + public static final String SERIALIZED_NAME_REQUEST_HEADERS = "requestHeaders"; + @SerializedName(SERIALIZED_NAME_REQUEST_HEADERS) + private Map requestHeaders = new HashMap<>(); + + public static final String SERIALIZED_NAME_QUERY_PARAMS = "queryParams"; + @SerializedName(SERIALIZED_NAME_QUERY_PARAMS) + private String queryParams; + + public static final String SERIALIZED_NAME_RESPONSE_STATUS = "responseStatus"; + @SerializedName(SERIALIZED_NAME_RESPONSE_STATUS) + private BigDecimal responseStatus; + + public static final String SERIALIZED_NAME_RESPONSE = "response"; + @SerializedName(SERIALIZED_NAME_RESPONSE) + private String response; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_REMOTE_ADDRESS = "remoteAddress"; + @SerializedName(SERIALIZED_NAME_REMOTE_ADDRESS) + private String remoteAddress; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + private Object tags; + + public static final String SERIALIZED_NAME_DETAILS = "details"; + @SerializedName(SERIALIZED_NAME_DETAILS) + private List details = new ArrayList<>(); + + public RequestLog() { + } + + public RequestLog requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nonnull + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public RequestLog projectID(String projectID) { + this.projectID = projectID; + return this; + } + + /** + * ID of project + * @return projectID + **/ + @javax.annotation.Nonnull + public String getProjectID() { + return projectID; + } + + public void setProjectID(String projectID) { + this.projectID = projectID; + } + + + public RequestLog userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + **/ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public RequestLog application(String application) { + this.application = application; + return this; + } + + /** + * Application this request was processed with + * @return application + **/ + @javax.annotation.Nonnull + public String getApplication() { + return application; + } + + public void setApplication(String application) { + this.application = application; + } + + + public RequestLog method(String method) { + this.method = method; + return this; + } + + /** + * HTTP method (such as GET and POST) + * @return method + **/ + @javax.annotation.Nonnull + public String getMethod() { + return method; + } + + public void setMethod(String method) { + this.method = method; + } + + + public RequestLog endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Endpoint that was requested + * @return endpoint + **/ + @javax.annotation.Nonnull + public String getEndpoint() { + return endpoint; + } + + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + + public RequestLog source(String source) { + this.source = source; + return this; + } + + /** + * Request source + * @return source + **/ + @javax.annotation.Nonnull + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + + public RequestLog request(String request) { + this.request = request; + return this; + } + + /** + * Request JSON data + * @return request + **/ + @javax.annotation.Nonnull + public String getRequest() { + return request; + } + + public void setRequest(String request) { + this.request = request; + } + + + public RequestLog requestHeaders(Map requestHeaders) { + this.requestHeaders = requestHeaders; + return this; + } + + public RequestLog putRequestHeadersItem(String key, String requestHeadersItem) { + if (this.requestHeaders == null) { + this.requestHeaders = new HashMap<>(); + } + this.requestHeaders.put(key, requestHeadersItem); + return this; + } + + /** + * Request headers + * @return requestHeaders + **/ + @javax.annotation.Nonnull + public Map getRequestHeaders() { + return requestHeaders; + } + + public void setRequestHeaders(Map requestHeaders) { + this.requestHeaders = requestHeaders; + } + + + public RequestLog queryParams(String queryParams) { + this.queryParams = queryParams; + return this; + } + + /** + * Request query parameters + * @return queryParams + **/ + @javax.annotation.Nonnull + public String getQueryParams() { + return queryParams; + } + + public void setQueryParams(String queryParams) { + this.queryParams = queryParams; + } + + + public RequestLog responseStatus(BigDecimal responseStatus) { + this.responseStatus = responseStatus; + return this; + } + + /** + * Response HTTP status + * @return responseStatus + **/ + @javax.annotation.Nonnull + public BigDecimal getResponseStatus() { + return responseStatus; + } + + public void setResponseStatus(BigDecimal responseStatus) { + this.responseStatus = responseStatus; + } + + + public RequestLog response(String response) { + this.response = response; + return this; + } + + /** + * Response JSON data + * @return response + **/ + @javax.annotation.Nonnull + public String getResponse() { + return response; + } + + public void setResponse(String response) { + this.response = response; + } + + + public RequestLog runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public RequestLog remoteAddress(String remoteAddress) { + this.remoteAddress = remoteAddress; + return this; + } + + /** + * Caller remote address + * @return remoteAddress + **/ + @javax.annotation.Nonnull + public String getRemoteAddress() { + return remoteAddress; + } + + public void setRemoteAddress(String remoteAddress) { + this.remoteAddress = remoteAddress; + } + + + public RequestLog created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the request was performed in RFC3339 format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public RequestLog tags(Object tags) { + this.tags = tags; + return this; + } + + /** + * Arbitrary tags attached to this request + * @return tags + **/ + @javax.annotation.Nonnull + public Object getTags() { + return tags; + } + + public void setTags(Object tags) { + this.tags = tags; + } + + + public RequestLog details(List details) { + this.details = details; + return this; + } + + public RequestLog addDetailsItem(String detailsItem) { + if (this.details == null) { + this.details = new ArrayList<>(); + } + this.details.add(detailsItem); + return this; + } + + /** + * Any freetext additional information attached to this request. Additional logs, errors, etc. + * @return details + **/ + @javax.annotation.Nonnull + public List getDetails() { + return details; + } + + public void setDetails(List details) { + this.details = details; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestLog requestLog = (RequestLog) o; + return Objects.equals(this.requestID, requestLog.requestID) && + Objects.equals(this.projectID, requestLog.projectID) && + Objects.equals(this.userID, requestLog.userID) && + Objects.equals(this.application, requestLog.application) && + Objects.equals(this.method, requestLog.method) && + Objects.equals(this.endpoint, requestLog.endpoint) && + Objects.equals(this.source, requestLog.source) && + Objects.equals(this.request, requestLog.request) && + Objects.equals(this.requestHeaders, requestLog.requestHeaders) && + Objects.equals(this.queryParams, requestLog.queryParams) && + Objects.equals(this.responseStatus, requestLog.responseStatus) && + Objects.equals(this.response, requestLog.response) && + Objects.equals(this.runtime, requestLog.runtime) && + Objects.equals(this.remoteAddress, requestLog.remoteAddress) && + Objects.equals(this.created, requestLog.created) && + Objects.equals(this.tags, requestLog.tags) && + Objects.equals(this.details, requestLog.details); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, projectID, userID, application, method, endpoint, source, request, requestHeaders, queryParams, responseStatus, response, runtime, remoteAddress, created, tags, details); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestLog {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" application: ").append(toIndentedString(application)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" endpoint: ").append(toIndentedString(endpoint)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" request: ").append(toIndentedString(request)).append("\n"); + sb.append(" requestHeaders: ").append(toIndentedString(requestHeaders)).append("\n"); + sb.append(" queryParams: ").append(toIndentedString(queryParams)).append("\n"); + sb.append(" responseStatus: ").append(toIndentedString(responseStatus)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" remoteAddress: ").append(toIndentedString(remoteAddress)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("projectID"); + openapiFields.add("userID"); + openapiFields.add("application"); + openapiFields.add("method"); + openapiFields.add("endpoint"); + openapiFields.add("source"); + openapiFields.add("request"); + openapiFields.add("requestHeaders"); + openapiFields.add("queryParams"); + openapiFields.add("responseStatus"); + openapiFields.add("response"); + openapiFields.add("runtime"); + openapiFields.add("remoteAddress"); + openapiFields.add("created"); + openapiFields.add("tags"); + openapiFields.add("details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("requestID"); + openapiRequiredFields.add("projectID"); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("application"); + openapiRequiredFields.add("method"); + openapiRequiredFields.add("endpoint"); + openapiRequiredFields.add("source"); + openapiRequiredFields.add("request"); + openapiRequiredFields.add("requestHeaders"); + openapiRequiredFields.add("queryParams"); + openapiRequiredFields.add("responseStatus"); + openapiRequiredFields.add("response"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("remoteAddress"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("tags"); + openapiRequiredFields.add("details"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RequestLog + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RequestLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RequestLog is not found in the empty JSON string", RequestLog.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RequestLog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RequestLog` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RequestLog.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + if (!jsonObj.get("projectID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); + } + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("application").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `application` to be a primitive type in the JSON string but got `%s`", jsonObj.get("application").toString())); + } + if (!jsonObj.get("method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); + } + if (!jsonObj.get("endpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `endpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endpoint").toString())); + } + if (!jsonObj.get("source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString())); + } + if (!jsonObj.get("request").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `request` to be a primitive type in the JSON string but got `%s`", jsonObj.get("request").toString())); + } + if (!jsonObj.get("queryParams").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `queryParams` to be a primitive type in the JSON string but got `%s`", jsonObj.get("queryParams").toString())); + } + if (!jsonObj.get("response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response").toString())); + } + if (!jsonObj.get("remoteAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `remoteAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remoteAddress").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + // ensure the required json array is present + if (jsonObj.get("details") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `details` to be an array in the JSON string but got `%s`", jsonObj.get("details").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RequestLog.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RequestLog' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RequestLog.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RequestLog value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RequestLog read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RequestLog given an JSON string + * + * @param jsonString JSON string + * @return An instance of RequestLog + * @throws IOException if the JSON string is invalid with respect to RequestLog + */ + public static RequestLog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RequestLog.class); + } + + /** + * Convert an instance of RequestLog to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/RequestLogGetRsp.java b/src/main/java/com/corbado/generated/model/RequestLogGetRsp.java new file mode 100644 index 0000000..4bb58db --- /dev/null +++ b/src/main/java/com/corbado/generated/model/RequestLogGetRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.RequestLog; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * RequestLogGetRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class RequestLogGetRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private RequestLog data; + + public RequestLogGetRsp() { + } + + public RequestLogGetRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public RequestLogGetRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public RequestLogGetRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public RequestLogGetRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public RequestLogGetRsp data(RequestLog data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public RequestLog getData() { + return data; + } + + public void setData(RequestLog data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestLogGetRsp requestLogGetRsp = (RequestLogGetRsp) o; + return Objects.equals(this.httpStatusCode, requestLogGetRsp.httpStatusCode) && + Objects.equals(this.message, requestLogGetRsp.message) && + Objects.equals(this.requestData, requestLogGetRsp.requestData) && + Objects.equals(this.runtime, requestLogGetRsp.runtime) && + Objects.equals(this.data, requestLogGetRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestLogGetRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RequestLogGetRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RequestLogGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RequestLogGetRsp is not found in the empty JSON string", RequestLogGetRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RequestLogGetRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RequestLogGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RequestLogGetRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + RequestLog.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RequestLogGetRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RequestLogGetRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RequestLogGetRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RequestLogGetRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RequestLogGetRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RequestLogGetRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of RequestLogGetRsp + * @throws IOException if the JSON string is invalid with respect to RequestLogGetRsp + */ + public static RequestLogGetRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RequestLogGetRsp.class); + } + + /** + * Convert an instance of RequestLogGetRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/RequestLogsListRsp.java b/src/main/java/com/corbado/generated/model/RequestLogsListRsp.java new file mode 100644 index 0000000..700bf03 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/RequestLogsListRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.RequestLogsListRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * RequestLogsListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class RequestLogsListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private RequestLogsListRspAllOfData data; + + public RequestLogsListRsp() { + } + + public RequestLogsListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public RequestLogsListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public RequestLogsListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public RequestLogsListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public RequestLogsListRsp data(RequestLogsListRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public RequestLogsListRspAllOfData getData() { + return data; + } + + public void setData(RequestLogsListRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestLogsListRsp requestLogsListRsp = (RequestLogsListRsp) o; + return Objects.equals(this.httpStatusCode, requestLogsListRsp.httpStatusCode) && + Objects.equals(this.message, requestLogsListRsp.message) && + Objects.equals(this.requestData, requestLogsListRsp.requestData) && + Objects.equals(this.runtime, requestLogsListRsp.runtime) && + Objects.equals(this.data, requestLogsListRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestLogsListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RequestLogsListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RequestLogsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RequestLogsListRsp is not found in the empty JSON string", RequestLogsListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RequestLogsListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RequestLogsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RequestLogsListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + RequestLogsListRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RequestLogsListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RequestLogsListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RequestLogsListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RequestLogsListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RequestLogsListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RequestLogsListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of RequestLogsListRsp + * @throws IOException if the JSON string is invalid with respect to RequestLogsListRsp + */ + public static RequestLogsListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RequestLogsListRsp.class); + } + + /** + * Convert an instance of RequestLogsListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/RequestLogsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/RequestLogsListRspAllOfData.java new file mode 100644 index 0000000..f256489 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/RequestLogsListRspAllOfData.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.RequestLog; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * RequestLogsListRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class RequestLogsListRspAllOfData { + public static final String SERIALIZED_NAME_LOGS = "logs"; + @SerializedName(SERIALIZED_NAME_LOGS) + private List logs = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public RequestLogsListRspAllOfData() { + } + + public RequestLogsListRspAllOfData logs(List logs) { + this.logs = logs; + return this; + } + + public RequestLogsListRspAllOfData addLogsItem(RequestLog logsItem) { + if (this.logs == null) { + this.logs = new ArrayList<>(); + } + this.logs.add(logsItem); + return this; + } + + /** + * Get logs + * @return logs + **/ + @javax.annotation.Nonnull + public List getLogs() { + return logs; + } + + public void setLogs(List logs) { + this.logs = logs; + } + + + public RequestLogsListRspAllOfData paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestLogsListRspAllOfData requestLogsListRspAllOfData = (RequestLogsListRspAllOfData) o; + return Objects.equals(this.logs, requestLogsListRspAllOfData.logs) && + Objects.equals(this.paging, requestLogsListRspAllOfData.paging); + } + + @Override + public int hashCode() { + return Objects.hash(logs, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestLogsListRspAllOfData {\n"); + sb.append(" logs: ").append(toIndentedString(logs)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("logs"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("logs"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RequestLogsListRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RequestLogsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RequestLogsListRspAllOfData is not found in the empty JSON string", RequestLogsListRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RequestLogsListRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RequestLogsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RequestLogsListRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("logs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `logs` to be an array in the JSON string but got `%s`", jsonObj.get("logs").toString())); + } + + JsonArray jsonArraylogs = jsonObj.getAsJsonArray("logs"); + // validate the required field `logs` (array) + for (int i = 0; i < jsonArraylogs.size(); i++) { + RequestLog.validateJsonElement(jsonArraylogs.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RequestLogsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RequestLogsListRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RequestLogsListRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RequestLogsListRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RequestLogsListRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RequestLogsListRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of RequestLogsListRspAllOfData + * @throws IOException if the JSON string is invalid with respect to RequestLogsListRspAllOfData + */ + public static RequestLogsListRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RequestLogsListRspAllOfData.class); + } + + /** + * Convert an instance of RequestLogsListRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SessionConfig.java b/src/main/java/com/corbado/generated/model/SessionConfig.java new file mode 100644 index 0000000..d7675c6 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SessionConfig.java @@ -0,0 +1,756 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.AppType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SessionConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SessionConfig { + public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; + @SerializedName(SERIALIZED_NAME_PROJECT_I_D) + private String projectID; + + public static final String SERIALIZED_NAME_APP_TYPE = "appType"; + @SerializedName(SERIALIZED_NAME_APP_TYPE) + private AppType appType; + + public static final String SERIALIZED_NAME_ACTIVE = "active"; + @SerializedName(SERIALIZED_NAME_ACTIVE) + private Boolean active; + + public static final String SERIALIZED_NAME_SHORT_LIFETIME_MINUTES = "shortLifetimeMinutes"; + @SerializedName(SERIALIZED_NAME_SHORT_LIFETIME_MINUTES) + private Integer shortLifetimeMinutes; + + public static final String SERIALIZED_NAME_SHORT_COOKIE_DOMAIN = "shortCookieDomain"; + @SerializedName(SERIALIZED_NAME_SHORT_COOKIE_DOMAIN) + private String shortCookieDomain; + + public static final String SERIALIZED_NAME_SHORT_COOKIE_SECURE = "shortCookieSecure"; + @SerializedName(SERIALIZED_NAME_SHORT_COOKIE_SECURE) + private Boolean shortCookieSecure; + + /** + * Gets or Sets shortCookieSameSite + */ + @JsonAdapter(ShortCookieSameSiteEnum.Adapter.class) + public enum ShortCookieSameSiteEnum { + LAX("lax"), + + STRICT("strict"), + + NONE("none"); + + private String value; + + ShortCookieSameSiteEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ShortCookieSameSiteEnum fromValue(String value) { + for (ShortCookieSameSiteEnum b : ShortCookieSameSiteEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ShortCookieSameSiteEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ShortCookieSameSiteEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ShortCookieSameSiteEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ShortCookieSameSiteEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SHORT_COOKIE_SAME_SITE = "shortCookieSameSite"; + @SerializedName(SERIALIZED_NAME_SHORT_COOKIE_SAME_SITE) + private ShortCookieSameSiteEnum shortCookieSameSite; + + public static final String SERIALIZED_NAME_LONG_LIFETIME_VALUE = "longLifetimeValue"; + @SerializedName(SERIALIZED_NAME_LONG_LIFETIME_VALUE) + private Integer longLifetimeValue; + + /** + * Gets or Sets longLifetimeUnit + */ + @JsonAdapter(LongLifetimeUnitEnum.Adapter.class) + public enum LongLifetimeUnitEnum { + MIN("min"), + + HOUR("hour"), + + DAY("day"); + + private String value; + + LongLifetimeUnitEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LongLifetimeUnitEnum fromValue(String value) { + for (LongLifetimeUnitEnum b : LongLifetimeUnitEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LongLifetimeUnitEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LongLifetimeUnitEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LongLifetimeUnitEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + LongLifetimeUnitEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_LONG_LIFETIME_UNIT = "longLifetimeUnit"; + @SerializedName(SERIALIZED_NAME_LONG_LIFETIME_UNIT) + private LongLifetimeUnitEnum longLifetimeUnit; + + public static final String SERIALIZED_NAME_LONG_INACTIVITY_VALUE = "longInactivityValue"; + @SerializedName(SERIALIZED_NAME_LONG_INACTIVITY_VALUE) + private Integer longInactivityValue; + + /** + * Gets or Sets longInactivityUnit + */ + @JsonAdapter(LongInactivityUnitEnum.Adapter.class) + public enum LongInactivityUnitEnum { + MIN("min"), + + HOUR("hour"), + + DAY("day"); + + private String value; + + LongInactivityUnitEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LongInactivityUnitEnum fromValue(String value) { + for (LongInactivityUnitEnum b : LongInactivityUnitEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LongInactivityUnitEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LongInactivityUnitEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LongInactivityUnitEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + LongInactivityUnitEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_LONG_INACTIVITY_UNIT = "longInactivityUnit"; + @SerializedName(SERIALIZED_NAME_LONG_INACTIVITY_UNIT) + private LongInactivityUnitEnum longInactivityUnit; + + public static final String SERIALIZED_NAME_JWT_AUDIENCE = "jwtAudience"; + @SerializedName(SERIALIZED_NAME_JWT_AUDIENCE) + private String jwtAudience; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public SessionConfig() { + } + + public SessionConfig projectID(String projectID) { + this.projectID = projectID; + return this; + } + + /** + * ID of project + * @return projectID + **/ + @javax.annotation.Nonnull + public String getProjectID() { + return projectID; + } + + public void setProjectID(String projectID) { + this.projectID = projectID; + } + + + public SessionConfig appType(AppType appType) { + this.appType = appType; + return this; + } + + /** + * Get appType + * @return appType + **/ + @javax.annotation.Nonnull + public AppType getAppType() { + return appType; + } + + public void setAppType(AppType appType) { + this.appType = appType; + } + + + public SessionConfig active(Boolean active) { + this.active = active; + return this; + } + + /** + * Get active + * @return active + **/ + @javax.annotation.Nullable + public Boolean getActive() { + return active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + + public SessionConfig shortLifetimeMinutes(Integer shortLifetimeMinutes) { + this.shortLifetimeMinutes = shortLifetimeMinutes; + return this; + } + + /** + * Get shortLifetimeMinutes + * @return shortLifetimeMinutes + **/ + @javax.annotation.Nonnull + public Integer getShortLifetimeMinutes() { + return shortLifetimeMinutes; + } + + public void setShortLifetimeMinutes(Integer shortLifetimeMinutes) { + this.shortLifetimeMinutes = shortLifetimeMinutes; + } + + + public SessionConfig shortCookieDomain(String shortCookieDomain) { + this.shortCookieDomain = shortCookieDomain; + return this; + } + + /** + * Get shortCookieDomain + * @return shortCookieDomain + **/ + @javax.annotation.Nonnull + public String getShortCookieDomain() { + return shortCookieDomain; + } + + public void setShortCookieDomain(String shortCookieDomain) { + this.shortCookieDomain = shortCookieDomain; + } + + + public SessionConfig shortCookieSecure(Boolean shortCookieSecure) { + this.shortCookieSecure = shortCookieSecure; + return this; + } + + /** + * Get shortCookieSecure + * @return shortCookieSecure + **/ + @javax.annotation.Nonnull + public Boolean getShortCookieSecure() { + return shortCookieSecure; + } + + public void setShortCookieSecure(Boolean shortCookieSecure) { + this.shortCookieSecure = shortCookieSecure; + } + + + public SessionConfig shortCookieSameSite(ShortCookieSameSiteEnum shortCookieSameSite) { + this.shortCookieSameSite = shortCookieSameSite; + return this; + } + + /** + * Get shortCookieSameSite + * @return shortCookieSameSite + **/ + @javax.annotation.Nonnull + public ShortCookieSameSiteEnum getShortCookieSameSite() { + return shortCookieSameSite; + } + + public void setShortCookieSameSite(ShortCookieSameSiteEnum shortCookieSameSite) { + this.shortCookieSameSite = shortCookieSameSite; + } + + + public SessionConfig longLifetimeValue(Integer longLifetimeValue) { + this.longLifetimeValue = longLifetimeValue; + return this; + } + + /** + * Get longLifetimeValue + * @return longLifetimeValue + **/ + @javax.annotation.Nonnull + public Integer getLongLifetimeValue() { + return longLifetimeValue; + } + + public void setLongLifetimeValue(Integer longLifetimeValue) { + this.longLifetimeValue = longLifetimeValue; + } + + + public SessionConfig longLifetimeUnit(LongLifetimeUnitEnum longLifetimeUnit) { + this.longLifetimeUnit = longLifetimeUnit; + return this; + } + + /** + * Get longLifetimeUnit + * @return longLifetimeUnit + **/ + @javax.annotation.Nonnull + public LongLifetimeUnitEnum getLongLifetimeUnit() { + return longLifetimeUnit; + } + + public void setLongLifetimeUnit(LongLifetimeUnitEnum longLifetimeUnit) { + this.longLifetimeUnit = longLifetimeUnit; + } + + + public SessionConfig longInactivityValue(Integer longInactivityValue) { + this.longInactivityValue = longInactivityValue; + return this; + } + + /** + * Get longInactivityValue + * @return longInactivityValue + **/ + @javax.annotation.Nonnull + public Integer getLongInactivityValue() { + return longInactivityValue; + } + + public void setLongInactivityValue(Integer longInactivityValue) { + this.longInactivityValue = longInactivityValue; + } + + + public SessionConfig longInactivityUnit(LongInactivityUnitEnum longInactivityUnit) { + this.longInactivityUnit = longInactivityUnit; + return this; + } + + /** + * Get longInactivityUnit + * @return longInactivityUnit + **/ + @javax.annotation.Nonnull + public LongInactivityUnitEnum getLongInactivityUnit() { + return longInactivityUnit; + } + + public void setLongInactivityUnit(LongInactivityUnitEnum longInactivityUnit) { + this.longInactivityUnit = longInactivityUnit; + } + + + public SessionConfig jwtAudience(String jwtAudience) { + this.jwtAudience = jwtAudience; + return this; + } + + /** + * Get jwtAudience + * @return jwtAudience + **/ + @javax.annotation.Nonnull + public String getJwtAudience() { + return jwtAudience; + } + + public void setJwtAudience(String jwtAudience) { + this.jwtAudience = jwtAudience; + } + + + public SessionConfig created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public SessionConfig updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionConfig sessionConfig = (SessionConfig) o; + return Objects.equals(this.projectID, sessionConfig.projectID) && + Objects.equals(this.appType, sessionConfig.appType) && + Objects.equals(this.active, sessionConfig.active) && + Objects.equals(this.shortLifetimeMinutes, sessionConfig.shortLifetimeMinutes) && + Objects.equals(this.shortCookieDomain, sessionConfig.shortCookieDomain) && + Objects.equals(this.shortCookieSecure, sessionConfig.shortCookieSecure) && + Objects.equals(this.shortCookieSameSite, sessionConfig.shortCookieSameSite) && + Objects.equals(this.longLifetimeValue, sessionConfig.longLifetimeValue) && + Objects.equals(this.longLifetimeUnit, sessionConfig.longLifetimeUnit) && + Objects.equals(this.longInactivityValue, sessionConfig.longInactivityValue) && + Objects.equals(this.longInactivityUnit, sessionConfig.longInactivityUnit) && + Objects.equals(this.jwtAudience, sessionConfig.jwtAudience) && + Objects.equals(this.created, sessionConfig.created) && + Objects.equals(this.updated, sessionConfig.updated); + } + + @Override + public int hashCode() { + return Objects.hash(projectID, appType, active, shortLifetimeMinutes, shortCookieDomain, shortCookieSecure, shortCookieSameSite, longLifetimeValue, longLifetimeUnit, longInactivityValue, longInactivityUnit, jwtAudience, created, updated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionConfig {\n"); + sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); + sb.append(" appType: ").append(toIndentedString(appType)).append("\n"); + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" shortLifetimeMinutes: ").append(toIndentedString(shortLifetimeMinutes)).append("\n"); + sb.append(" shortCookieDomain: ").append(toIndentedString(shortCookieDomain)).append("\n"); + sb.append(" shortCookieSecure: ").append(toIndentedString(shortCookieSecure)).append("\n"); + sb.append(" shortCookieSameSite: ").append(toIndentedString(shortCookieSameSite)).append("\n"); + sb.append(" longLifetimeValue: ").append(toIndentedString(longLifetimeValue)).append("\n"); + sb.append(" longLifetimeUnit: ").append(toIndentedString(longLifetimeUnit)).append("\n"); + sb.append(" longInactivityValue: ").append(toIndentedString(longInactivityValue)).append("\n"); + sb.append(" longInactivityUnit: ").append(toIndentedString(longInactivityUnit)).append("\n"); + sb.append(" jwtAudience: ").append(toIndentedString(jwtAudience)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("projectID"); + openapiFields.add("appType"); + openapiFields.add("active"); + openapiFields.add("shortLifetimeMinutes"); + openapiFields.add("shortCookieDomain"); + openapiFields.add("shortCookieSecure"); + openapiFields.add("shortCookieSameSite"); + openapiFields.add("longLifetimeValue"); + openapiFields.add("longLifetimeUnit"); + openapiFields.add("longInactivityValue"); + openapiFields.add("longInactivityUnit"); + openapiFields.add("jwtAudience"); + openapiFields.add("created"); + openapiFields.add("updated"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("projectID"); + openapiRequiredFields.add("appType"); + openapiRequiredFields.add("shortLifetimeMinutes"); + openapiRequiredFields.add("shortCookieDomain"); + openapiRequiredFields.add("shortCookieSecure"); + openapiRequiredFields.add("shortCookieSameSite"); + openapiRequiredFields.add("longLifetimeValue"); + openapiRequiredFields.add("longLifetimeUnit"); + openapiRequiredFields.add("longInactivityValue"); + openapiRequiredFields.add("longInactivityUnit"); + openapiRequiredFields.add("jwtAudience"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SessionConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SessionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SessionConfig is not found in the empty JSON string", SessionConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SessionConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionConfig` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SessionConfig.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("projectID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); + } + // validate the required field `appType` + AppType.validateJsonElement(jsonObj.get("appType")); + if (!jsonObj.get("shortCookieDomain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shortCookieDomain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shortCookieDomain").toString())); + } + if (!jsonObj.get("shortCookieSameSite").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shortCookieSameSite` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shortCookieSameSite").toString())); + } + // validate the required field `shortCookieSameSite` + ShortCookieSameSiteEnum.validateJsonElement(jsonObj.get("shortCookieSameSite")); + if (!jsonObj.get("longLifetimeUnit").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `longLifetimeUnit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("longLifetimeUnit").toString())); + } + // validate the required field `longLifetimeUnit` + LongLifetimeUnitEnum.validateJsonElement(jsonObj.get("longLifetimeUnit")); + if (!jsonObj.get("longInactivityUnit").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `longInactivityUnit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("longInactivityUnit").toString())); + } + // validate the required field `longInactivityUnit` + LongInactivityUnitEnum.validateJsonElement(jsonObj.get("longInactivityUnit")); + if (!jsonObj.get("jwtAudience").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `jwtAudience` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jwtAudience").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SessionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SessionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SessionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SessionConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SessionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionConfig + * @throws IOException if the JSON string is invalid with respect to SessionConfig + */ + public static SessionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SessionConfig.class); + } + + /** + * Convert an instance of SessionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SessionConfigGetRsp.java b/src/main/java/com/corbado/generated/model/SessionConfigGetRsp.java new file mode 100644 index 0000000..f24c792 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SessionConfigGetRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.SessionConfig; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SessionConfigGetRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SessionConfigGetRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private SessionConfig data; + + public SessionConfigGetRsp() { + } + + public SessionConfigGetRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public SessionConfigGetRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public SessionConfigGetRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public SessionConfigGetRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public SessionConfigGetRsp data(SessionConfig data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public SessionConfig getData() { + return data; + } + + public void setData(SessionConfig data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionConfigGetRsp sessionConfigGetRsp = (SessionConfigGetRsp) o; + return Objects.equals(this.httpStatusCode, sessionConfigGetRsp.httpStatusCode) && + Objects.equals(this.message, sessionConfigGetRsp.message) && + Objects.equals(this.requestData, sessionConfigGetRsp.requestData) && + Objects.equals(this.runtime, sessionConfigGetRsp.runtime) && + Objects.equals(this.data, sessionConfigGetRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionConfigGetRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SessionConfigGetRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SessionConfigGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SessionConfigGetRsp is not found in the empty JSON string", SessionConfigGetRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SessionConfigGetRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionConfigGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SessionConfigGetRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + SessionConfig.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionConfigGetRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SessionConfigGetRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SessionConfigGetRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SessionConfigGetRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SessionConfigGetRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SessionConfigGetRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionConfigGetRsp + * @throws IOException if the JSON string is invalid with respect to SessionConfigGetRsp + */ + public static SessionConfigGetRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SessionConfigGetRsp.class); + } + + /** + * Convert an instance of SessionConfigGetRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SessionConfigUpdateReq.java b/src/main/java/com/corbado/generated/model/SessionConfigUpdateReq.java new file mode 100644 index 0000000..1c0b9a5 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SessionConfigUpdateReq.java @@ -0,0 +1,719 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.AppType; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SessionConfigUpdateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SessionConfigUpdateReq { + public static final String SERIALIZED_NAME_APP_TYPE = "appType"; + @SerializedName(SERIALIZED_NAME_APP_TYPE) + private AppType appType; + + public static final String SERIALIZED_NAME_ACTIVE = "active"; + @SerializedName(SERIALIZED_NAME_ACTIVE) + private Boolean active; + + public static final String SERIALIZED_NAME_SHORT_LIFETIME_MINUTES = "shortLifetimeMinutes"; + @SerializedName(SERIALIZED_NAME_SHORT_LIFETIME_MINUTES) + private Integer shortLifetimeMinutes; + + public static final String SERIALIZED_NAME_SHORT_COOKIE_DOMAIN = "shortCookieDomain"; + @SerializedName(SERIALIZED_NAME_SHORT_COOKIE_DOMAIN) + private String shortCookieDomain; + + public static final String SERIALIZED_NAME_SHORT_COOKIE_SECURE = "shortCookieSecure"; + @SerializedName(SERIALIZED_NAME_SHORT_COOKIE_SECURE) + private Boolean shortCookieSecure; + + /** + * Gets or Sets shortCookieSameSite + */ + @JsonAdapter(ShortCookieSameSiteEnum.Adapter.class) + public enum ShortCookieSameSiteEnum { + LAX("lax"), + + STRICT("strict"), + + NONE("none"); + + private String value; + + ShortCookieSameSiteEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ShortCookieSameSiteEnum fromValue(String value) { + for (ShortCookieSameSiteEnum b : ShortCookieSameSiteEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ShortCookieSameSiteEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ShortCookieSameSiteEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ShortCookieSameSiteEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ShortCookieSameSiteEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SHORT_COOKIE_SAME_SITE = "shortCookieSameSite"; + @SerializedName(SERIALIZED_NAME_SHORT_COOKIE_SAME_SITE) + private ShortCookieSameSiteEnum shortCookieSameSite; + + public static final String SERIALIZED_NAME_LONG_LIFETIME_VALUE = "longLifetimeValue"; + @SerializedName(SERIALIZED_NAME_LONG_LIFETIME_VALUE) + private Integer longLifetimeValue; + + /** + * Gets or Sets longLifetimeUnit + */ + @JsonAdapter(LongLifetimeUnitEnum.Adapter.class) + public enum LongLifetimeUnitEnum { + MIN("min"), + + HOUR("hour"); + + private String value; + + LongLifetimeUnitEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LongLifetimeUnitEnum fromValue(String value) { + for (LongLifetimeUnitEnum b : LongLifetimeUnitEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LongLifetimeUnitEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LongLifetimeUnitEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LongLifetimeUnitEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + LongLifetimeUnitEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_LONG_LIFETIME_UNIT = "longLifetimeUnit"; + @SerializedName(SERIALIZED_NAME_LONG_LIFETIME_UNIT) + private LongLifetimeUnitEnum longLifetimeUnit; + + public static final String SERIALIZED_NAME_LONG_INACTIVITY_VALUE = "longInactivityValue"; + @SerializedName(SERIALIZED_NAME_LONG_INACTIVITY_VALUE) + private Integer longInactivityValue; + + /** + * Gets or Sets longInactivityUnit + */ + @JsonAdapter(LongInactivityUnitEnum.Adapter.class) + public enum LongInactivityUnitEnum { + MIN("min"), + + HOUR("hour"); + + private String value; + + LongInactivityUnitEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LongInactivityUnitEnum fromValue(String value) { + for (LongInactivityUnitEnum b : LongInactivityUnitEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LongInactivityUnitEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LongInactivityUnitEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LongInactivityUnitEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + LongInactivityUnitEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_LONG_INACTIVITY_UNIT = "longInactivityUnit"; + @SerializedName(SERIALIZED_NAME_LONG_INACTIVITY_UNIT) + private LongInactivityUnitEnum longInactivityUnit; + + public static final String SERIALIZED_NAME_JWT_AUDIENCE = "jwtAudience"; + @SerializedName(SERIALIZED_NAME_JWT_AUDIENCE) + private String jwtAudience; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public SessionConfigUpdateReq() { + } + + public SessionConfigUpdateReq appType(AppType appType) { + this.appType = appType; + return this; + } + + /** + * Get appType + * @return appType + **/ + @javax.annotation.Nonnull + public AppType getAppType() { + return appType; + } + + public void setAppType(AppType appType) { + this.appType = appType; + } + + + public SessionConfigUpdateReq active(Boolean active) { + this.active = active; + return this; + } + + /** + * Get active + * @return active + **/ + @javax.annotation.Nullable + public Boolean getActive() { + return active; + } + + public void setActive(Boolean active) { + this.active = active; + } + + + public SessionConfigUpdateReq shortLifetimeMinutes(Integer shortLifetimeMinutes) { + this.shortLifetimeMinutes = shortLifetimeMinutes; + return this; + } + + /** + * Get shortLifetimeMinutes + * @return shortLifetimeMinutes + **/ + @javax.annotation.Nullable + public Integer getShortLifetimeMinutes() { + return shortLifetimeMinutes; + } + + public void setShortLifetimeMinutes(Integer shortLifetimeMinutes) { + this.shortLifetimeMinutes = shortLifetimeMinutes; + } + + + public SessionConfigUpdateReq shortCookieDomain(String shortCookieDomain) { + this.shortCookieDomain = shortCookieDomain; + return this; + } + + /** + * Get shortCookieDomain + * @return shortCookieDomain + **/ + @javax.annotation.Nullable + public String getShortCookieDomain() { + return shortCookieDomain; + } + + public void setShortCookieDomain(String shortCookieDomain) { + this.shortCookieDomain = shortCookieDomain; + } + + + public SessionConfigUpdateReq shortCookieSecure(Boolean shortCookieSecure) { + this.shortCookieSecure = shortCookieSecure; + return this; + } + + /** + * Get shortCookieSecure + * @return shortCookieSecure + **/ + @javax.annotation.Nullable + public Boolean getShortCookieSecure() { + return shortCookieSecure; + } + + public void setShortCookieSecure(Boolean shortCookieSecure) { + this.shortCookieSecure = shortCookieSecure; + } + + + public SessionConfigUpdateReq shortCookieSameSite(ShortCookieSameSiteEnum shortCookieSameSite) { + this.shortCookieSameSite = shortCookieSameSite; + return this; + } + + /** + * Get shortCookieSameSite + * @return shortCookieSameSite + **/ + @javax.annotation.Nullable + public ShortCookieSameSiteEnum getShortCookieSameSite() { + return shortCookieSameSite; + } + + public void setShortCookieSameSite(ShortCookieSameSiteEnum shortCookieSameSite) { + this.shortCookieSameSite = shortCookieSameSite; + } + + + public SessionConfigUpdateReq longLifetimeValue(Integer longLifetimeValue) { + this.longLifetimeValue = longLifetimeValue; + return this; + } + + /** + * Get longLifetimeValue + * @return longLifetimeValue + **/ + @javax.annotation.Nullable + public Integer getLongLifetimeValue() { + return longLifetimeValue; + } + + public void setLongLifetimeValue(Integer longLifetimeValue) { + this.longLifetimeValue = longLifetimeValue; + } + + + public SessionConfigUpdateReq longLifetimeUnit(LongLifetimeUnitEnum longLifetimeUnit) { + this.longLifetimeUnit = longLifetimeUnit; + return this; + } + + /** + * Get longLifetimeUnit + * @return longLifetimeUnit + **/ + @javax.annotation.Nullable + public LongLifetimeUnitEnum getLongLifetimeUnit() { + return longLifetimeUnit; + } + + public void setLongLifetimeUnit(LongLifetimeUnitEnum longLifetimeUnit) { + this.longLifetimeUnit = longLifetimeUnit; + } + + + public SessionConfigUpdateReq longInactivityValue(Integer longInactivityValue) { + this.longInactivityValue = longInactivityValue; + return this; + } + + /** + * Get longInactivityValue + * @return longInactivityValue + **/ + @javax.annotation.Nullable + public Integer getLongInactivityValue() { + return longInactivityValue; + } + + public void setLongInactivityValue(Integer longInactivityValue) { + this.longInactivityValue = longInactivityValue; + } + + + public SessionConfigUpdateReq longInactivityUnit(LongInactivityUnitEnum longInactivityUnit) { + this.longInactivityUnit = longInactivityUnit; + return this; + } + + /** + * Get longInactivityUnit + * @return longInactivityUnit + **/ + @javax.annotation.Nullable + public LongInactivityUnitEnum getLongInactivityUnit() { + return longInactivityUnit; + } + + public void setLongInactivityUnit(LongInactivityUnitEnum longInactivityUnit) { + this.longInactivityUnit = longInactivityUnit; + } + + + public SessionConfigUpdateReq jwtAudience(String jwtAudience) { + this.jwtAudience = jwtAudience; + return this; + } + + /** + * Get jwtAudience + * @return jwtAudience + **/ + @javax.annotation.Nullable + public String getJwtAudience() { + return jwtAudience; + } + + public void setJwtAudience(String jwtAudience) { + this.jwtAudience = jwtAudience; + } + + + public SessionConfigUpdateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public SessionConfigUpdateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionConfigUpdateReq sessionConfigUpdateReq = (SessionConfigUpdateReq) o; + return Objects.equals(this.appType, sessionConfigUpdateReq.appType) && + Objects.equals(this.active, sessionConfigUpdateReq.active) && + Objects.equals(this.shortLifetimeMinutes, sessionConfigUpdateReq.shortLifetimeMinutes) && + Objects.equals(this.shortCookieDomain, sessionConfigUpdateReq.shortCookieDomain) && + Objects.equals(this.shortCookieSecure, sessionConfigUpdateReq.shortCookieSecure) && + Objects.equals(this.shortCookieSameSite, sessionConfigUpdateReq.shortCookieSameSite) && + Objects.equals(this.longLifetimeValue, sessionConfigUpdateReq.longLifetimeValue) && + Objects.equals(this.longLifetimeUnit, sessionConfigUpdateReq.longLifetimeUnit) && + Objects.equals(this.longInactivityValue, sessionConfigUpdateReq.longInactivityValue) && + Objects.equals(this.longInactivityUnit, sessionConfigUpdateReq.longInactivityUnit) && + Objects.equals(this.jwtAudience, sessionConfigUpdateReq.jwtAudience) && + Objects.equals(this.requestID, sessionConfigUpdateReq.requestID) && + Objects.equals(this.clientInfo, sessionConfigUpdateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(appType, active, shortLifetimeMinutes, shortCookieDomain, shortCookieSecure, shortCookieSameSite, longLifetimeValue, longLifetimeUnit, longInactivityValue, longInactivityUnit, jwtAudience, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionConfigUpdateReq {\n"); + sb.append(" appType: ").append(toIndentedString(appType)).append("\n"); + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" shortLifetimeMinutes: ").append(toIndentedString(shortLifetimeMinutes)).append("\n"); + sb.append(" shortCookieDomain: ").append(toIndentedString(shortCookieDomain)).append("\n"); + sb.append(" shortCookieSecure: ").append(toIndentedString(shortCookieSecure)).append("\n"); + sb.append(" shortCookieSameSite: ").append(toIndentedString(shortCookieSameSite)).append("\n"); + sb.append(" longLifetimeValue: ").append(toIndentedString(longLifetimeValue)).append("\n"); + sb.append(" longLifetimeUnit: ").append(toIndentedString(longLifetimeUnit)).append("\n"); + sb.append(" longInactivityValue: ").append(toIndentedString(longInactivityValue)).append("\n"); + sb.append(" longInactivityUnit: ").append(toIndentedString(longInactivityUnit)).append("\n"); + sb.append(" jwtAudience: ").append(toIndentedString(jwtAudience)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("appType"); + openapiFields.add("active"); + openapiFields.add("shortLifetimeMinutes"); + openapiFields.add("shortCookieDomain"); + openapiFields.add("shortCookieSecure"); + openapiFields.add("shortCookieSameSite"); + openapiFields.add("longLifetimeValue"); + openapiFields.add("longLifetimeUnit"); + openapiFields.add("longInactivityValue"); + openapiFields.add("longInactivityUnit"); + openapiFields.add("jwtAudience"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("appType"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SessionConfigUpdateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SessionConfigUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SessionConfigUpdateReq is not found in the empty JSON string", SessionConfigUpdateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SessionConfigUpdateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionConfigUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SessionConfigUpdateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `appType` + AppType.validateJsonElement(jsonObj.get("appType")); + if ((jsonObj.get("shortCookieDomain") != null && !jsonObj.get("shortCookieDomain").isJsonNull()) && !jsonObj.get("shortCookieDomain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shortCookieDomain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shortCookieDomain").toString())); + } + if ((jsonObj.get("shortCookieSameSite") != null && !jsonObj.get("shortCookieSameSite").isJsonNull()) && !jsonObj.get("shortCookieSameSite").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shortCookieSameSite` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shortCookieSameSite").toString())); + } + // validate the optional field `shortCookieSameSite` + if (jsonObj.get("shortCookieSameSite") != null && !jsonObj.get("shortCookieSameSite").isJsonNull()) { + ShortCookieSameSiteEnum.validateJsonElement(jsonObj.get("shortCookieSameSite")); + } + if ((jsonObj.get("longLifetimeUnit") != null && !jsonObj.get("longLifetimeUnit").isJsonNull()) && !jsonObj.get("longLifetimeUnit").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `longLifetimeUnit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("longLifetimeUnit").toString())); + } + // validate the optional field `longLifetimeUnit` + if (jsonObj.get("longLifetimeUnit") != null && !jsonObj.get("longLifetimeUnit").isJsonNull()) { + LongLifetimeUnitEnum.validateJsonElement(jsonObj.get("longLifetimeUnit")); + } + if ((jsonObj.get("longInactivityUnit") != null && !jsonObj.get("longInactivityUnit").isJsonNull()) && !jsonObj.get("longInactivityUnit").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `longInactivityUnit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("longInactivityUnit").toString())); + } + // validate the optional field `longInactivityUnit` + if (jsonObj.get("longInactivityUnit") != null && !jsonObj.get("longInactivityUnit").isJsonNull()) { + LongInactivityUnitEnum.validateJsonElement(jsonObj.get("longInactivityUnit")); + } + if ((jsonObj.get("jwtAudience") != null && !jsonObj.get("jwtAudience").isJsonNull()) && !jsonObj.get("jwtAudience").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `jwtAudience` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jwtAudience").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionConfigUpdateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SessionConfigUpdateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SessionConfigUpdateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SessionConfigUpdateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SessionConfigUpdateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SessionConfigUpdateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionConfigUpdateReq + * @throws IOException if the JSON string is invalid with respect to SessionConfigUpdateReq + */ + public static SessionConfigUpdateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SessionConfigUpdateReq.class); + } + + /** + * Convert an instance of SessionConfigUpdateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SessionTokenCreateReq.java b/src/main/java/com/corbado/generated/model/SessionTokenCreateReq.java new file mode 100644 index 0000000..920b49b --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SessionTokenCreateReq.java @@ -0,0 +1,303 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SessionTokenCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SessionTokenCreateReq { + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_USER_DATA = "userData"; + @SerializedName(SERIALIZED_NAME_USER_DATA) + private String userData; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public SessionTokenCreateReq() { + } + + public SessionTokenCreateReq userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + **/ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public SessionTokenCreateReq userData(String userData) { + this.userData = userData; + return this; + } + + /** + * Additional user data in JSON format + * @return userData + **/ + @javax.annotation.Nonnull + public String getUserData() { + return userData; + } + + public void setUserData(String userData) { + this.userData = userData; + } + + + public SessionTokenCreateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public SessionTokenCreateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nonnull + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionTokenCreateReq sessionTokenCreateReq = (SessionTokenCreateReq) o; + return Objects.equals(this.userID, sessionTokenCreateReq.userID) && + Objects.equals(this.userData, sessionTokenCreateReq.userData) && + Objects.equals(this.requestID, sessionTokenCreateReq.requestID) && + Objects.equals(this.clientInfo, sessionTokenCreateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(userID, userData, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionTokenCreateReq {\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userID"); + openapiFields.add("userData"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("userData"); + openapiRequiredFields.add("clientInfo"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SessionTokenCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SessionTokenCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SessionTokenCreateReq is not found in the empty JSON string", SessionTokenCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SessionTokenCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionTokenCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SessionTokenCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("userData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userData").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the required field `clientInfo` + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionTokenCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SessionTokenCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SessionTokenCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SessionTokenCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SessionTokenCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SessionTokenCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionTokenCreateReq + * @throws IOException if the JSON string is invalid with respect to SessionTokenCreateReq + */ + public static SessionTokenCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SessionTokenCreateReq.class); + } + + /** + * Convert an instance of SessionTokenCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SessionTokenCreateRsp.java b/src/main/java/com/corbado/generated/model/SessionTokenCreateRsp.java new file mode 100644 index 0000000..ef0182a --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SessionTokenCreateRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.SessionTokenCreateRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SessionTokenCreateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SessionTokenCreateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private SessionTokenCreateRspAllOfData data; + + public SessionTokenCreateRsp() { + } + + public SessionTokenCreateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public SessionTokenCreateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public SessionTokenCreateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public SessionTokenCreateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public SessionTokenCreateRsp data(SessionTokenCreateRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public SessionTokenCreateRspAllOfData getData() { + return data; + } + + public void setData(SessionTokenCreateRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionTokenCreateRsp sessionTokenCreateRsp = (SessionTokenCreateRsp) o; + return Objects.equals(this.httpStatusCode, sessionTokenCreateRsp.httpStatusCode) && + Objects.equals(this.message, sessionTokenCreateRsp.message) && + Objects.equals(this.requestData, sessionTokenCreateRsp.requestData) && + Objects.equals(this.runtime, sessionTokenCreateRsp.runtime) && + Objects.equals(this.data, sessionTokenCreateRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionTokenCreateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SessionTokenCreateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SessionTokenCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SessionTokenCreateRsp is not found in the empty JSON string", SessionTokenCreateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SessionTokenCreateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionTokenCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SessionTokenCreateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + SessionTokenCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionTokenCreateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SessionTokenCreateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SessionTokenCreateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SessionTokenCreateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SessionTokenCreateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SessionTokenCreateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionTokenCreateRsp + * @throws IOException if the JSON string is invalid with respect to SessionTokenCreateRsp + */ + public static SessionTokenCreateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SessionTokenCreateRsp.class); + } + + /** + * Convert an instance of SessionTokenCreateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SessionTokenCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/SessionTokenCreateRspAllOfData.java new file mode 100644 index 0000000..dd7bb7f --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SessionTokenCreateRspAllOfData.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SessionTokenCreateRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SessionTokenCreateRspAllOfData { + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + private String token; + + public SessionTokenCreateRspAllOfData() { + } + + public SessionTokenCreateRspAllOfData token(String token) { + this.token = token; + return this; + } + + /** + * Get token + * @return token + **/ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionTokenCreateRspAllOfData sessionTokenCreateRspAllOfData = (SessionTokenCreateRspAllOfData) o; + return Objects.equals(this.token, sessionTokenCreateRspAllOfData.token); + } + + @Override + public int hashCode() { + return Objects.hash(token); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionTokenCreateRspAllOfData {\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("token"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SessionTokenCreateRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SessionTokenCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SessionTokenCreateRspAllOfData is not found in the empty JSON string", SessionTokenCreateRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SessionTokenCreateRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionTokenCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SessionTokenCreateRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionTokenCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SessionTokenCreateRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SessionTokenCreateRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SessionTokenCreateRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SessionTokenCreateRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SessionTokenCreateRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionTokenCreateRspAllOfData + * @throws IOException if the JSON string is invalid with respect to SessionTokenCreateRspAllOfData + */ + public static SessionTokenCreateRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SessionTokenCreateRspAllOfData.class); + } + + /** + * Convert an instance of SessionTokenCreateRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SessionTokenVerifyReq.java b/src/main/java/com/corbado/generated/model/SessionTokenVerifyReq.java new file mode 100644 index 0000000..8401bfd --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SessionTokenVerifyReq.java @@ -0,0 +1,273 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SessionTokenVerifyReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SessionTokenVerifyReq { + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + private String token; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public SessionTokenVerifyReq() { + } + + public SessionTokenVerifyReq token(String token) { + this.token = token; + return this; + } + + /** + * Get token + * @return token + **/ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + + public SessionTokenVerifyReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public SessionTokenVerifyReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nonnull + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionTokenVerifyReq sessionTokenVerifyReq = (SessionTokenVerifyReq) o; + return Objects.equals(this.token, sessionTokenVerifyReq.token) && + Objects.equals(this.requestID, sessionTokenVerifyReq.requestID) && + Objects.equals(this.clientInfo, sessionTokenVerifyReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(token, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionTokenVerifyReq {\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("token"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("token"); + openapiRequiredFields.add("clientInfo"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SessionTokenVerifyReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SessionTokenVerifyReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SessionTokenVerifyReq is not found in the empty JSON string", SessionTokenVerifyReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SessionTokenVerifyReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionTokenVerifyReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SessionTokenVerifyReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the required field `clientInfo` + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionTokenVerifyReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SessionTokenVerifyReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SessionTokenVerifyReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SessionTokenVerifyReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SessionTokenVerifyReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SessionTokenVerifyReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionTokenVerifyReq + * @throws IOException if the JSON string is invalid with respect to SessionTokenVerifyReq + */ + public static SessionTokenVerifyReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SessionTokenVerifyReq.class); + } + + /** + * Convert an instance of SessionTokenVerifyReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SessionTokenVerifyRsp.java b/src/main/java/com/corbado/generated/model/SessionTokenVerifyRsp.java new file mode 100644 index 0000000..4aa7534 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SessionTokenVerifyRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.SessionTokenVerifyRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SessionTokenVerifyRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SessionTokenVerifyRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private SessionTokenVerifyRspAllOfData data; + + public SessionTokenVerifyRsp() { + } + + public SessionTokenVerifyRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public SessionTokenVerifyRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public SessionTokenVerifyRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public SessionTokenVerifyRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public SessionTokenVerifyRsp data(SessionTokenVerifyRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public SessionTokenVerifyRspAllOfData getData() { + return data; + } + + public void setData(SessionTokenVerifyRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionTokenVerifyRsp sessionTokenVerifyRsp = (SessionTokenVerifyRsp) o; + return Objects.equals(this.httpStatusCode, sessionTokenVerifyRsp.httpStatusCode) && + Objects.equals(this.message, sessionTokenVerifyRsp.message) && + Objects.equals(this.requestData, sessionTokenVerifyRsp.requestData) && + Objects.equals(this.runtime, sessionTokenVerifyRsp.runtime) && + Objects.equals(this.data, sessionTokenVerifyRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionTokenVerifyRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SessionTokenVerifyRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SessionTokenVerifyRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SessionTokenVerifyRsp is not found in the empty JSON string", SessionTokenVerifyRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SessionTokenVerifyRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionTokenVerifyRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SessionTokenVerifyRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + SessionTokenVerifyRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionTokenVerifyRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SessionTokenVerifyRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SessionTokenVerifyRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SessionTokenVerifyRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SessionTokenVerifyRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SessionTokenVerifyRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionTokenVerifyRsp + * @throws IOException if the JSON string is invalid with respect to SessionTokenVerifyRsp + */ + public static SessionTokenVerifyRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SessionTokenVerifyRsp.class); + } + + /** + * Convert an instance of SessionTokenVerifyRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SessionTokenVerifyRspAllOfData.java b/src/main/java/com/corbado/generated/model/SessionTokenVerifyRspAllOfData.java new file mode 100644 index 0000000..824e58d --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SessionTokenVerifyRspAllOfData.java @@ -0,0 +1,274 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.FullUser; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SessionTokenVerifyRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SessionTokenVerifyRspAllOfData { + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_USER = "user"; + @SerializedName(SERIALIZED_NAME_USER) + private FullUser user; + + public static final String SERIALIZED_NAME_USER_DATA = "userData"; + @SerializedName(SERIALIZED_NAME_USER_DATA) + private String userData; + + public SessionTokenVerifyRspAllOfData() { + } + + public SessionTokenVerifyRspAllOfData userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + **/ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public SessionTokenVerifyRspAllOfData user(FullUser user) { + this.user = user; + return this; + } + + /** + * Get user + * @return user + **/ + @javax.annotation.Nonnull + public FullUser getUser() { + return user; + } + + public void setUser(FullUser user) { + this.user = user; + } + + + public SessionTokenVerifyRspAllOfData userData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get userData + * @return userData + **/ + @javax.annotation.Nonnull + public String getUserData() { + return userData; + } + + public void setUserData(String userData) { + this.userData = userData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionTokenVerifyRspAllOfData sessionTokenVerifyRspAllOfData = (SessionTokenVerifyRspAllOfData) o; + return Objects.equals(this.userID, sessionTokenVerifyRspAllOfData.userID) && + Objects.equals(this.user, sessionTokenVerifyRspAllOfData.user) && + Objects.equals(this.userData, sessionTokenVerifyRspAllOfData.userData); + } + + @Override + public int hashCode() { + return Objects.hash(userID, user, userData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionTokenVerifyRspAllOfData {\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userID"); + openapiFields.add("user"); + openapiFields.add("userData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("user"); + openapiRequiredFields.add("userData"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SessionTokenVerifyRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SessionTokenVerifyRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SessionTokenVerifyRspAllOfData is not found in the empty JSON string", SessionTokenVerifyRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SessionTokenVerifyRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionTokenVerifyRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SessionTokenVerifyRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + // validate the required field `user` + FullUser.validateJsonElement(jsonObj.get("user")); + if (!jsonObj.get("userData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userData").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionTokenVerifyRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SessionTokenVerifyRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SessionTokenVerifyRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SessionTokenVerifyRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SessionTokenVerifyRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SessionTokenVerifyRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionTokenVerifyRspAllOfData + * @throws IOException if the JSON string is invalid with respect to SessionTokenVerifyRspAllOfData + */ + public static SessionTokenVerifyRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SessionTokenVerifyRspAllOfData.class); + } + + /** + * Convert an instance of SessionTokenVerifyRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SmsCodeSendReq.java b/src/main/java/com/corbado/generated/model/SmsCodeSendReq.java new file mode 100644 index 0000000..a0bbf38 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SmsCodeSendReq.java @@ -0,0 +1,359 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SmsCodeSendReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SmsCodeSendReq { + public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) + private String phoneNumber; + + public static final String SERIALIZED_NAME_CREATE = "create"; + @SerializedName(SERIALIZED_NAME_CREATE) + private Boolean create; + + public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; + @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) + private String userFullName; + + public static final String SERIALIZED_NAME_TEMPLATE_NAME = "templateName"; + @SerializedName(SERIALIZED_NAME_TEMPLATE_NAME) + private String templateName; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public SmsCodeSendReq() { + } + + public SmsCodeSendReq phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Recipient phone number + * @return phoneNumber + **/ + @javax.annotation.Nonnull + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + + public SmsCodeSendReq create(Boolean create) { + this.create = create; + return this; + } + + /** + * Defines if user phone number should be created if not found + * @return create + **/ + @javax.annotation.Nonnull + public Boolean getCreate() { + return create; + } + + public void setCreate(Boolean create) { + this.create = create; + } + + + public SmsCodeSendReq userFullName(String userFullName) { + this.userFullName = userFullName; + return this; + } + + /** + * Optional user's full name to be used if the user wasn't found and needs to be created first + * @return userFullName + **/ + @javax.annotation.Nullable + public String getUserFullName() { + return userFullName; + } + + public void setUserFullName(String userFullName) { + this.userFullName = userFullName; + } + + + public SmsCodeSendReq templateName(String templateName) { + this.templateName = templateName; + return this; + } + + /** + * Template name of SMS to send + * @return templateName + **/ + @javax.annotation.Nullable + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + + public SmsCodeSendReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public SmsCodeSendReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsCodeSendReq smsCodeSendReq = (SmsCodeSendReq) o; + return Objects.equals(this.phoneNumber, smsCodeSendReq.phoneNumber) && + Objects.equals(this.create, smsCodeSendReq.create) && + Objects.equals(this.userFullName, smsCodeSendReq.userFullName) && + Objects.equals(this.templateName, smsCodeSendReq.templateName) && + Objects.equals(this.requestID, smsCodeSendReq.requestID) && + Objects.equals(this.clientInfo, smsCodeSendReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(phoneNumber, create, userFullName, templateName, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SmsCodeSendReq {\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" create: ").append(toIndentedString(create)).append("\n"); + sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); + sb.append(" templateName: ").append(toIndentedString(templateName)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("phoneNumber"); + openapiFields.add("create"); + openapiFields.add("userFullName"); + openapiFields.add("templateName"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("phoneNumber"); + openapiRequiredFields.add("create"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SmsCodeSendReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SmsCodeSendReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SmsCodeSendReq is not found in the empty JSON string", SmsCodeSendReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SmsCodeSendReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsCodeSendReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SmsCodeSendReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("phoneNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); + } + if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); + } + if ((jsonObj.get("templateName") != null && !jsonObj.get("templateName").isJsonNull()) && !jsonObj.get("templateName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `templateName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("templateName").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SmsCodeSendReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SmsCodeSendReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SmsCodeSendReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SmsCodeSendReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SmsCodeSendReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SmsCodeSendReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of SmsCodeSendReq + * @throws IOException if the JSON string is invalid with respect to SmsCodeSendReq + */ + public static SmsCodeSendReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SmsCodeSendReq.class); + } + + /** + * Convert an instance of SmsCodeSendReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SmsCodeSendRsp.java b/src/main/java/com/corbado/generated/model/SmsCodeSendRsp.java new file mode 100644 index 0000000..1168a40 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SmsCodeSendRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.SmsCodeSendRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SmsCodeSendRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SmsCodeSendRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private SmsCodeSendRspAllOfData data; + + public SmsCodeSendRsp() { + } + + public SmsCodeSendRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public SmsCodeSendRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public SmsCodeSendRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public SmsCodeSendRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public SmsCodeSendRsp data(SmsCodeSendRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public SmsCodeSendRspAllOfData getData() { + return data; + } + + public void setData(SmsCodeSendRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsCodeSendRsp smsCodeSendRsp = (SmsCodeSendRsp) o; + return Objects.equals(this.httpStatusCode, smsCodeSendRsp.httpStatusCode) && + Objects.equals(this.message, smsCodeSendRsp.message) && + Objects.equals(this.requestData, smsCodeSendRsp.requestData) && + Objects.equals(this.runtime, smsCodeSendRsp.runtime) && + Objects.equals(this.data, smsCodeSendRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SmsCodeSendRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SmsCodeSendRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SmsCodeSendRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SmsCodeSendRsp is not found in the empty JSON string", SmsCodeSendRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SmsCodeSendRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsCodeSendRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SmsCodeSendRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + SmsCodeSendRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SmsCodeSendRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SmsCodeSendRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SmsCodeSendRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SmsCodeSendRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SmsCodeSendRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SmsCodeSendRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of SmsCodeSendRsp + * @throws IOException if the JSON string is invalid with respect to SmsCodeSendRsp + */ + public static SmsCodeSendRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SmsCodeSendRsp.class); + } + + /** + * Convert an instance of SmsCodeSendRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SmsCodeSendRspAllOfData.java b/src/main/java/com/corbado/generated/model/SmsCodeSendRspAllOfData.java new file mode 100644 index 0000000..c00a6b3 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SmsCodeSendRspAllOfData.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SmsCodeSendRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SmsCodeSendRspAllOfData { + public static final String SERIALIZED_NAME_SMS_CODE_I_D = "smsCodeID"; + @SerializedName(SERIALIZED_NAME_SMS_CODE_I_D) + private String smsCodeID; + + public SmsCodeSendRspAllOfData() { + } + + public SmsCodeSendRspAllOfData smsCodeID(String smsCodeID) { + this.smsCodeID = smsCodeID; + return this; + } + + /** + * Get smsCodeID + * @return smsCodeID + **/ + @javax.annotation.Nonnull + public String getSmsCodeID() { + return smsCodeID; + } + + public void setSmsCodeID(String smsCodeID) { + this.smsCodeID = smsCodeID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsCodeSendRspAllOfData smsCodeSendRspAllOfData = (SmsCodeSendRspAllOfData) o; + return Objects.equals(this.smsCodeID, smsCodeSendRspAllOfData.smsCodeID); + } + + @Override + public int hashCode() { + return Objects.hash(smsCodeID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SmsCodeSendRspAllOfData {\n"); + sb.append(" smsCodeID: ").append(toIndentedString(smsCodeID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("smsCodeID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("smsCodeID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SmsCodeSendRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SmsCodeSendRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SmsCodeSendRspAllOfData is not found in the empty JSON string", SmsCodeSendRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SmsCodeSendRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsCodeSendRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SmsCodeSendRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("smsCodeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `smsCodeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smsCodeID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SmsCodeSendRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SmsCodeSendRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SmsCodeSendRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SmsCodeSendRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SmsCodeSendRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SmsCodeSendRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SmsCodeSendRspAllOfData + * @throws IOException if the JSON string is invalid with respect to SmsCodeSendRspAllOfData + */ + public static SmsCodeSendRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SmsCodeSendRspAllOfData.class); + } + + /** + * Convert an instance of SmsCodeSendRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SmsCodeValidateReq.java b/src/main/java/com/corbado/generated/model/SmsCodeValidateReq.java new file mode 100644 index 0000000..b2dcfb0 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SmsCodeValidateReq.java @@ -0,0 +1,300 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SmsCodeValidateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SmsCodeValidateReq { + public static final String SERIALIZED_NAME_SMS_CODE = "smsCode"; + @SerializedName(SERIALIZED_NAME_SMS_CODE) + private String smsCode; + + public static final String SERIALIZED_NAME_CREATE_LOGIN_TOKEN = "createLoginToken"; + @SerializedName(SERIALIZED_NAME_CREATE_LOGIN_TOKEN) + private Boolean createLoginToken; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public SmsCodeValidateReq() { + } + + public SmsCodeValidateReq smsCode(String smsCode) { + this.smsCode = smsCode; + return this; + } + + /** + * SMS OTP to validate + * @return smsCode + **/ + @javax.annotation.Nonnull + public String getSmsCode() { + return smsCode; + } + + public void setSmsCode(String smsCode) { + this.smsCode = smsCode; + } + + + public SmsCodeValidateReq createLoginToken(Boolean createLoginToken) { + this.createLoginToken = createLoginToken; + return this; + } + + /** + * Get createLoginToken + * @return createLoginToken + **/ + @javax.annotation.Nullable + public Boolean getCreateLoginToken() { + return createLoginToken; + } + + public void setCreateLoginToken(Boolean createLoginToken) { + this.createLoginToken = createLoginToken; + } + + + public SmsCodeValidateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public SmsCodeValidateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsCodeValidateReq smsCodeValidateReq = (SmsCodeValidateReq) o; + return Objects.equals(this.smsCode, smsCodeValidateReq.smsCode) && + Objects.equals(this.createLoginToken, smsCodeValidateReq.createLoginToken) && + Objects.equals(this.requestID, smsCodeValidateReq.requestID) && + Objects.equals(this.clientInfo, smsCodeValidateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(smsCode, createLoginToken, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SmsCodeValidateReq {\n"); + sb.append(" smsCode: ").append(toIndentedString(smsCode)).append("\n"); + sb.append(" createLoginToken: ").append(toIndentedString(createLoginToken)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("smsCode"); + openapiFields.add("createLoginToken"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("smsCode"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SmsCodeValidateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SmsCodeValidateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SmsCodeValidateReq is not found in the empty JSON string", SmsCodeValidateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SmsCodeValidateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsCodeValidateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SmsCodeValidateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("smsCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `smsCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smsCode").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SmsCodeValidateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SmsCodeValidateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SmsCodeValidateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SmsCodeValidateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SmsCodeValidateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SmsCodeValidateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of SmsCodeValidateReq + * @throws IOException if the JSON string is invalid with respect to SmsCodeValidateReq + */ + public static SmsCodeValidateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SmsCodeValidateReq.class); + } + + /** + * Convert an instance of SmsCodeValidateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SmsCodeValidateRsp.java b/src/main/java/com/corbado/generated/model/SmsCodeValidateRsp.java new file mode 100644 index 0000000..57192ba --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SmsCodeValidateRsp.java @@ -0,0 +1,329 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SmsCodeValidateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SmsCodeValidateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_LOGIN_TOKEN = "loginToken"; + @SerializedName(SERIALIZED_NAME_LOGIN_TOKEN) + private String loginToken; + + public SmsCodeValidateRsp() { + } + + public SmsCodeValidateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public SmsCodeValidateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public SmsCodeValidateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public SmsCodeValidateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public SmsCodeValidateRsp loginToken(String loginToken) { + this.loginToken = loginToken; + return this; + } + + /** + * Get loginToken + * @return loginToken + **/ + @javax.annotation.Nullable + public String getLoginToken() { + return loginToken; + } + + public void setLoginToken(String loginToken) { + this.loginToken = loginToken; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsCodeValidateRsp smsCodeValidateRsp = (SmsCodeValidateRsp) o; + return Objects.equals(this.httpStatusCode, smsCodeValidateRsp.httpStatusCode) && + Objects.equals(this.message, smsCodeValidateRsp.message) && + Objects.equals(this.requestData, smsCodeValidateRsp.requestData) && + Objects.equals(this.runtime, smsCodeValidateRsp.runtime) && + Objects.equals(this.loginToken, smsCodeValidateRsp.loginToken); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, loginToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SmsCodeValidateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" loginToken: ").append(toIndentedString(loginToken)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("loginToken"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SmsCodeValidateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SmsCodeValidateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SmsCodeValidateRsp is not found in the empty JSON string", SmsCodeValidateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SmsCodeValidateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsCodeValidateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SmsCodeValidateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if ((jsonObj.get("loginToken") != null && !jsonObj.get("loginToken").isJsonNull()) && !jsonObj.get("loginToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loginToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SmsCodeValidateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SmsCodeValidateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SmsCodeValidateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SmsCodeValidateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SmsCodeValidateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SmsCodeValidateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of SmsCodeValidateRsp + * @throws IOException if the JSON string is invalid with respect to SmsCodeValidateRsp + */ + public static SmsCodeValidateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SmsCodeValidateRsp.class); + } + + /** + * Convert an instance of SmsCodeValidateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SmsTemplateCreateReq.java b/src/main/java/com/corbado/generated/model/SmsTemplateCreateReq.java new file mode 100644 index 0000000..174d2f6 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SmsTemplateCreateReq.java @@ -0,0 +1,415 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SmsTemplateCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SmsTemplateCreateReq { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + SMS_CODE("sms_code"), + + PASSKEY_NOTIFICATION("passkey_notification"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_TEXT_PLAIN = "textPlain"; + @SerializedName(SERIALIZED_NAME_TEXT_PLAIN) + private String textPlain; + + public static final String SERIALIZED_NAME_IS_DEFAULT = "isDefault"; + @SerializedName(SERIALIZED_NAME_IS_DEFAULT) + private Boolean isDefault; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public SmsTemplateCreateReq() { + } + + public SmsTemplateCreateReq type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + + public SmsTemplateCreateReq name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public SmsTemplateCreateReq textPlain(String textPlain) { + this.textPlain = textPlain; + return this; + } + + /** + * Get textPlain + * @return textPlain + **/ + @javax.annotation.Nonnull + public String getTextPlain() { + return textPlain; + } + + public void setTextPlain(String textPlain) { + this.textPlain = textPlain; + } + + + public SmsTemplateCreateReq isDefault(Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Get isDefault + * @return isDefault + **/ + @javax.annotation.Nonnull + public Boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + } + + + public SmsTemplateCreateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public SmsTemplateCreateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsTemplateCreateReq smsTemplateCreateReq = (SmsTemplateCreateReq) o; + return Objects.equals(this.type, smsTemplateCreateReq.type) && + Objects.equals(this.name, smsTemplateCreateReq.name) && + Objects.equals(this.textPlain, smsTemplateCreateReq.textPlain) && + Objects.equals(this.isDefault, smsTemplateCreateReq.isDefault) && + Objects.equals(this.requestID, smsTemplateCreateReq.requestID) && + Objects.equals(this.clientInfo, smsTemplateCreateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(type, name, textPlain, isDefault, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SmsTemplateCreateReq {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" textPlain: ").append(toIndentedString(textPlain)).append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("name"); + openapiFields.add("textPlain"); + openapiFields.add("isDefault"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("textPlain"); + openapiRequiredFields.add("isDefault"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SmsTemplateCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SmsTemplateCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SmsTemplateCreateReq is not found in the empty JSON string", SmsTemplateCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SmsTemplateCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsTemplateCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SmsTemplateCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("textPlain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `textPlain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("textPlain").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SmsTemplateCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SmsTemplateCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SmsTemplateCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SmsTemplateCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SmsTemplateCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SmsTemplateCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of SmsTemplateCreateReq + * @throws IOException if the JSON string is invalid with respect to SmsTemplateCreateReq + */ + public static SmsTemplateCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SmsTemplateCreateReq.class); + } + + /** + * Convert an instance of SmsTemplateCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SmsTemplateCreateRsp.java b/src/main/java/com/corbado/generated/model/SmsTemplateCreateRsp.java new file mode 100644 index 0000000..69a578f --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SmsTemplateCreateRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.SmsTemplateCreateRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SmsTemplateCreateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SmsTemplateCreateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private SmsTemplateCreateRspAllOfData data; + + public SmsTemplateCreateRsp() { + } + + public SmsTemplateCreateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public SmsTemplateCreateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public SmsTemplateCreateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public SmsTemplateCreateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public SmsTemplateCreateRsp data(SmsTemplateCreateRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public SmsTemplateCreateRspAllOfData getData() { + return data; + } + + public void setData(SmsTemplateCreateRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsTemplateCreateRsp smsTemplateCreateRsp = (SmsTemplateCreateRsp) o; + return Objects.equals(this.httpStatusCode, smsTemplateCreateRsp.httpStatusCode) && + Objects.equals(this.message, smsTemplateCreateRsp.message) && + Objects.equals(this.requestData, smsTemplateCreateRsp.requestData) && + Objects.equals(this.runtime, smsTemplateCreateRsp.runtime) && + Objects.equals(this.data, smsTemplateCreateRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SmsTemplateCreateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SmsTemplateCreateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SmsTemplateCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SmsTemplateCreateRsp is not found in the empty JSON string", SmsTemplateCreateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SmsTemplateCreateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsTemplateCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SmsTemplateCreateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + SmsTemplateCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SmsTemplateCreateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SmsTemplateCreateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SmsTemplateCreateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SmsTemplateCreateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SmsTemplateCreateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SmsTemplateCreateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of SmsTemplateCreateRsp + * @throws IOException if the JSON string is invalid with respect to SmsTemplateCreateRsp + */ + public static SmsTemplateCreateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SmsTemplateCreateRsp.class); + } + + /** + * Convert an instance of SmsTemplateCreateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SmsTemplateCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/SmsTemplateCreateRspAllOfData.java new file mode 100644 index 0000000..d1061f5 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SmsTemplateCreateRspAllOfData.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SmsTemplateCreateRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SmsTemplateCreateRspAllOfData { + public static final String SERIALIZED_NAME_SMS_TEMPLATE_I_D = "smsTemplateID"; + @SerializedName(SERIALIZED_NAME_SMS_TEMPLATE_I_D) + private String smsTemplateID; + + public SmsTemplateCreateRspAllOfData() { + } + + public SmsTemplateCreateRspAllOfData smsTemplateID(String smsTemplateID) { + this.smsTemplateID = smsTemplateID; + return this; + } + + /** + * Get smsTemplateID + * @return smsTemplateID + **/ + @javax.annotation.Nonnull + public String getSmsTemplateID() { + return smsTemplateID; + } + + public void setSmsTemplateID(String smsTemplateID) { + this.smsTemplateID = smsTemplateID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsTemplateCreateRspAllOfData smsTemplateCreateRspAllOfData = (SmsTemplateCreateRspAllOfData) o; + return Objects.equals(this.smsTemplateID, smsTemplateCreateRspAllOfData.smsTemplateID); + } + + @Override + public int hashCode() { + return Objects.hash(smsTemplateID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SmsTemplateCreateRspAllOfData {\n"); + sb.append(" smsTemplateID: ").append(toIndentedString(smsTemplateID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("smsTemplateID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("smsTemplateID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SmsTemplateCreateRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SmsTemplateCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SmsTemplateCreateRspAllOfData is not found in the empty JSON string", SmsTemplateCreateRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SmsTemplateCreateRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsTemplateCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SmsTemplateCreateRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("smsTemplateID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `smsTemplateID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smsTemplateID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SmsTemplateCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SmsTemplateCreateRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SmsTemplateCreateRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SmsTemplateCreateRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SmsTemplateCreateRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SmsTemplateCreateRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SmsTemplateCreateRspAllOfData + * @throws IOException if the JSON string is invalid with respect to SmsTemplateCreateRspAllOfData + */ + public static SmsTemplateCreateRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SmsTemplateCreateRspAllOfData.class); + } + + /** + * Convert an instance of SmsTemplateCreateRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SmsTemplateDeleteReq.java b/src/main/java/com/corbado/generated/model/SmsTemplateDeleteReq.java new file mode 100644 index 0000000..35320a7 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SmsTemplateDeleteReq.java @@ -0,0 +1,237 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SmsTemplateDeleteReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class SmsTemplateDeleteReq { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public SmsTemplateDeleteReq() { + } + + public SmsTemplateDeleteReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public SmsTemplateDeleteReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsTemplateDeleteReq smsTemplateDeleteReq = (SmsTemplateDeleteReq) o; + return Objects.equals(this.requestID, smsTemplateDeleteReq.requestID) && + Objects.equals(this.clientInfo, smsTemplateDeleteReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SmsTemplateDeleteReq {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SmsTemplateDeleteReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SmsTemplateDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SmsTemplateDeleteReq is not found in the empty JSON string", SmsTemplateDeleteReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SmsTemplateDeleteReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsTemplateDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SmsTemplateDeleteReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SmsTemplateDeleteReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SmsTemplateDeleteReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SmsTemplateDeleteReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SmsTemplateDeleteReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SmsTemplateDeleteReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of SmsTemplateDeleteReq + * @throws IOException if the JSON string is invalid with respect to SmsTemplateDeleteReq + */ + public static SmsTemplateDeleteReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SmsTemplateDeleteReq.class); + } + + /** + * Convert an instance of SmsTemplateDeleteReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SocialProviderType.java b/src/main/java/com/corbado/generated/model/SocialProviderType.java new file mode 100644 index 0000000..0ccbd1d --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SocialProviderType.java @@ -0,0 +1,80 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets socialProviderType + */ +@JsonAdapter(SocialProviderType.Adapter.class) +public enum SocialProviderType { + + GOOGLE("google"), + + MICROSOFT("microsoft"), + + GITHUB("github"); + + private String value; + + SocialProviderType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SocialProviderType fromValue(String value) { + for (SocialProviderType b : SocialProviderType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SocialProviderType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SocialProviderType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SocialProviderType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SocialProviderType.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/Status.java b/src/main/java/com/corbado/generated/model/Status.java new file mode 100644 index 0000000..e54facc --- /dev/null +++ b/src/main/java/com/corbado/generated/model/Status.java @@ -0,0 +1,80 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Generic status that can describe Corbado entities + */ +@JsonAdapter(Status.Adapter.class) +public enum Status { + + ACTIVE("active"), + + PENDING("pending"), + + DELETED("deleted"); + + private String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Status fromValue(String value) { + for (Status b : Status.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Status enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Status read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Status.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + Status.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingBackupState.java b/src/main/java/com/corbado/generated/model/TrackingBackupState.java new file mode 100644 index 0000000..dc6fb7f --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingBackupState.java @@ -0,0 +1,238 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingBackupState + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingBackupState { + public static final String SERIALIZED_NAME_BACKED_UP = "backedUp"; + @SerializedName(SERIALIZED_NAME_BACKED_UP) + private Integer backedUp; + + public static final String SERIALIZED_NAME_NOT_BACKED_UP = "notBackedUp"; + @SerializedName(SERIALIZED_NAME_NOT_BACKED_UP) + private Integer notBackedUp; + + public TrackingBackupState() { + } + + public TrackingBackupState backedUp(Integer backedUp) { + this.backedUp = backedUp; + return this; + } + + /** + * Get backedUp + * @return backedUp + **/ + @javax.annotation.Nonnull + public Integer getBackedUp() { + return backedUp; + } + + public void setBackedUp(Integer backedUp) { + this.backedUp = backedUp; + } + + + public TrackingBackupState notBackedUp(Integer notBackedUp) { + this.notBackedUp = notBackedUp; + return this; + } + + /** + * Get notBackedUp + * @return notBackedUp + **/ + @javax.annotation.Nonnull + public Integer getNotBackedUp() { + return notBackedUp; + } + + public void setNotBackedUp(Integer notBackedUp) { + this.notBackedUp = notBackedUp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingBackupState trackingBackupState = (TrackingBackupState) o; + return Objects.equals(this.backedUp, trackingBackupState.backedUp) && + Objects.equals(this.notBackedUp, trackingBackupState.notBackedUp); + } + + @Override + public int hashCode() { + return Objects.hash(backedUp, notBackedUp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingBackupState {\n"); + sb.append(" backedUp: ").append(toIndentedString(backedUp)).append("\n"); + sb.append(" notBackedUp: ").append(toIndentedString(notBackedUp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("backedUp"); + openapiFields.add("notBackedUp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("backedUp"); + openapiRequiredFields.add("notBackedUp"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingBackupState + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingBackupState.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBackupState is not found in the empty JSON string", TrackingBackupState.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingBackupState.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBackupState` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingBackupState.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingBackupState.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingBackupState' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingBackupState.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingBackupState value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingBackupState read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingBackupState given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingBackupState + * @throws IOException if the JSON string is invalid with respect to TrackingBackupState + */ + public static TrackingBackupState fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingBackupState.class); + } + + /** + * Convert an instance of TrackingBackupState to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingBackupStateGetRsp.java b/src/main/java/com/corbado/generated/model/TrackingBackupStateGetRsp.java new file mode 100644 index 0000000..7d2a07d --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingBackupStateGetRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.TrackingBackupState; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingBackupStateGetRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingBackupStateGetRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private TrackingBackupState data; + + public TrackingBackupStateGetRsp() { + } + + public TrackingBackupStateGetRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public TrackingBackupStateGetRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public TrackingBackupStateGetRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public TrackingBackupStateGetRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public TrackingBackupStateGetRsp data(TrackingBackupState data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public TrackingBackupState getData() { + return data; + } + + public void setData(TrackingBackupState data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingBackupStateGetRsp trackingBackupStateGetRsp = (TrackingBackupStateGetRsp) o; + return Objects.equals(this.httpStatusCode, trackingBackupStateGetRsp.httpStatusCode) && + Objects.equals(this.message, trackingBackupStateGetRsp.message) && + Objects.equals(this.requestData, trackingBackupStateGetRsp.requestData) && + Objects.equals(this.runtime, trackingBackupStateGetRsp.runtime) && + Objects.equals(this.data, trackingBackupStateGetRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingBackupStateGetRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingBackupStateGetRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingBackupStateGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBackupStateGetRsp is not found in the empty JSON string", TrackingBackupStateGetRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingBackupStateGetRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBackupStateGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingBackupStateGetRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + TrackingBackupState.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingBackupStateGetRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingBackupStateGetRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingBackupStateGetRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingBackupStateGetRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingBackupStateGetRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingBackupStateGetRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingBackupStateGetRsp + * @throws IOException if the JSON string is invalid with respect to TrackingBackupStateGetRsp + */ + public static TrackingBackupStateGetRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingBackupStateGetRsp.class); + } + + /** + * Convert an instance of TrackingBackupStateGetRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStats.java b/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStats.java new file mode 100644 index 0000000..d417acf --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStats.java @@ -0,0 +1,382 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingBrowserDetailedStats + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingBrowserDetailedStats { + public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; + @SerializedName(SERIALIZED_NAME_TIME_POINT) + private String timePoint; + + public static final String SERIALIZED_NAME_BROWSER_NAME = "browserName"; + @SerializedName(SERIALIZED_NAME_BROWSER_NAME) + private String browserName; + + public static final String SERIALIZED_NAME_BROWSER_VERSION = "browserVersion"; + @SerializedName(SERIALIZED_NAME_BROWSER_VERSION) + private String browserVersion; + + public static final String SERIALIZED_NAME_CNT = "cnt"; + @SerializedName(SERIALIZED_NAME_CNT) + private Integer cnt; + + public static final String SERIALIZED_NAME_WEBAUTHN = "webauthn"; + @SerializedName(SERIALIZED_NAME_WEBAUTHN) + private Integer webauthn; + + public static final String SERIALIZED_NAME_PLATFORM = "platform"; + @SerializedName(SERIALIZED_NAME_PLATFORM) + private Integer platform; + + public static final String SERIALIZED_NAME_CONDITIONAL_UI = "conditional_ui"; + @SerializedName(SERIALIZED_NAME_CONDITIONAL_UI) + private Integer conditionalUi; + + public TrackingBrowserDetailedStats() { + } + + public TrackingBrowserDetailedStats timePoint(String timePoint) { + this.timePoint = timePoint; + return this; + } + + /** + * Get timePoint + * @return timePoint + **/ + @javax.annotation.Nonnull + public String getTimePoint() { + return timePoint; + } + + public void setTimePoint(String timePoint) { + this.timePoint = timePoint; + } + + + public TrackingBrowserDetailedStats browserName(String browserName) { + this.browserName = browserName; + return this; + } + + /** + * Get browserName + * @return browserName + **/ + @javax.annotation.Nonnull + public String getBrowserName() { + return browserName; + } + + public void setBrowserName(String browserName) { + this.browserName = browserName; + } + + + public TrackingBrowserDetailedStats browserVersion(String browserVersion) { + this.browserVersion = browserVersion; + return this; + } + + /** + * Get browserVersion + * @return browserVersion + **/ + @javax.annotation.Nonnull + public String getBrowserVersion() { + return browserVersion; + } + + public void setBrowserVersion(String browserVersion) { + this.browserVersion = browserVersion; + } + + + public TrackingBrowserDetailedStats cnt(Integer cnt) { + this.cnt = cnt; + return this; + } + + /** + * Get cnt + * @return cnt + **/ + @javax.annotation.Nonnull + public Integer getCnt() { + return cnt; + } + + public void setCnt(Integer cnt) { + this.cnt = cnt; + } + + + public TrackingBrowserDetailedStats webauthn(Integer webauthn) { + this.webauthn = webauthn; + return this; + } + + /** + * Get webauthn + * @return webauthn + **/ + @javax.annotation.Nonnull + public Integer getWebauthn() { + return webauthn; + } + + public void setWebauthn(Integer webauthn) { + this.webauthn = webauthn; + } + + + public TrackingBrowserDetailedStats platform(Integer platform) { + this.platform = platform; + return this; + } + + /** + * Get platform + * @return platform + **/ + @javax.annotation.Nonnull + public Integer getPlatform() { + return platform; + } + + public void setPlatform(Integer platform) { + this.platform = platform; + } + + + public TrackingBrowserDetailedStats conditionalUi(Integer conditionalUi) { + this.conditionalUi = conditionalUi; + return this; + } + + /** + * Get conditionalUi + * @return conditionalUi + **/ + @javax.annotation.Nonnull + public Integer getConditionalUi() { + return conditionalUi; + } + + public void setConditionalUi(Integer conditionalUi) { + this.conditionalUi = conditionalUi; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingBrowserDetailedStats trackingBrowserDetailedStats = (TrackingBrowserDetailedStats) o; + return Objects.equals(this.timePoint, trackingBrowserDetailedStats.timePoint) && + Objects.equals(this.browserName, trackingBrowserDetailedStats.browserName) && + Objects.equals(this.browserVersion, trackingBrowserDetailedStats.browserVersion) && + Objects.equals(this.cnt, trackingBrowserDetailedStats.cnt) && + Objects.equals(this.webauthn, trackingBrowserDetailedStats.webauthn) && + Objects.equals(this.platform, trackingBrowserDetailedStats.platform) && + Objects.equals(this.conditionalUi, trackingBrowserDetailedStats.conditionalUi); + } + + @Override + public int hashCode() { + return Objects.hash(timePoint, browserName, browserVersion, cnt, webauthn, platform, conditionalUi); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingBrowserDetailedStats {\n"); + sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); + sb.append(" browserName: ").append(toIndentedString(browserName)).append("\n"); + sb.append(" browserVersion: ").append(toIndentedString(browserVersion)).append("\n"); + sb.append(" cnt: ").append(toIndentedString(cnt)).append("\n"); + sb.append(" webauthn: ").append(toIndentedString(webauthn)).append("\n"); + sb.append(" platform: ").append(toIndentedString(platform)).append("\n"); + sb.append(" conditionalUi: ").append(toIndentedString(conditionalUi)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("timePoint"); + openapiFields.add("browserName"); + openapiFields.add("browserVersion"); + openapiFields.add("cnt"); + openapiFields.add("webauthn"); + openapiFields.add("platform"); + openapiFields.add("conditional_ui"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("timePoint"); + openapiRequiredFields.add("browserName"); + openapiRequiredFields.add("browserVersion"); + openapiRequiredFields.add("cnt"); + openapiRequiredFields.add("webauthn"); + openapiRequiredFields.add("platform"); + openapiRequiredFields.add("conditional_ui"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingBrowserDetailedStats + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingBrowserDetailedStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBrowserDetailedStats is not found in the empty JSON string", TrackingBrowserDetailedStats.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingBrowserDetailedStats.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBrowserDetailedStats` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingBrowserDetailedStats.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("timePoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); + } + if (!jsonObj.get("browserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `browserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("browserName").toString())); + } + if (!jsonObj.get("browserVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `browserVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("browserVersion").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingBrowserDetailedStats.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingBrowserDetailedStats' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingBrowserDetailedStats.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingBrowserDetailedStats value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingBrowserDetailedStats read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingBrowserDetailedStats given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingBrowserDetailedStats + * @throws IOException if the JSON string is invalid with respect to TrackingBrowserDetailedStats + */ + public static TrackingBrowserDetailedStats fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingBrowserDetailedStats.class); + } + + /** + * Convert an instance of TrackingBrowserDetailedStats to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRsp.java b/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRsp.java new file mode 100644 index 0000000..36faa42 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.TrackingBrowserDetailedStatsListRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingBrowserDetailedStatsListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingBrowserDetailedStatsListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private TrackingBrowserDetailedStatsListRspAllOfData data; + + public TrackingBrowserDetailedStatsListRsp() { + } + + public TrackingBrowserDetailedStatsListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public TrackingBrowserDetailedStatsListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public TrackingBrowserDetailedStatsListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public TrackingBrowserDetailedStatsListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public TrackingBrowserDetailedStatsListRsp data(TrackingBrowserDetailedStatsListRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public TrackingBrowserDetailedStatsListRspAllOfData getData() { + return data; + } + + public void setData(TrackingBrowserDetailedStatsListRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingBrowserDetailedStatsListRsp trackingBrowserDetailedStatsListRsp = (TrackingBrowserDetailedStatsListRsp) o; + return Objects.equals(this.httpStatusCode, trackingBrowserDetailedStatsListRsp.httpStatusCode) && + Objects.equals(this.message, trackingBrowserDetailedStatsListRsp.message) && + Objects.equals(this.requestData, trackingBrowserDetailedStatsListRsp.requestData) && + Objects.equals(this.runtime, trackingBrowserDetailedStatsListRsp.runtime) && + Objects.equals(this.data, trackingBrowserDetailedStatsListRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingBrowserDetailedStatsListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingBrowserDetailedStatsListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingBrowserDetailedStatsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBrowserDetailedStatsListRsp is not found in the empty JSON string", TrackingBrowserDetailedStatsListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingBrowserDetailedStatsListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBrowserDetailedStatsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingBrowserDetailedStatsListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + TrackingBrowserDetailedStatsListRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingBrowserDetailedStatsListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingBrowserDetailedStatsListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingBrowserDetailedStatsListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingBrowserDetailedStatsListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingBrowserDetailedStatsListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingBrowserDetailedStatsListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingBrowserDetailedStatsListRsp + * @throws IOException if the JSON string is invalid with respect to TrackingBrowserDetailedStatsListRsp + */ + public static TrackingBrowserDetailedStatsListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingBrowserDetailedStatsListRsp.class); + } + + /** + * Convert an instance of TrackingBrowserDetailedStatsListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRspAllOfData.java new file mode 100644 index 0000000..48746a4 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRspAllOfData.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.TrackingBrowserDetailedStats; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingBrowserDetailedStatsListRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingBrowserDetailedStatsListRspAllOfData { + public static final String SERIALIZED_NAME_STATS = "stats"; + @SerializedName(SERIALIZED_NAME_STATS) + private List stats = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public TrackingBrowserDetailedStatsListRspAllOfData() { + } + + public TrackingBrowserDetailedStatsListRspAllOfData stats(List stats) { + this.stats = stats; + return this; + } + + public TrackingBrowserDetailedStatsListRspAllOfData addStatsItem(TrackingBrowserDetailedStats statsItem) { + if (this.stats == null) { + this.stats = new ArrayList<>(); + } + this.stats.add(statsItem); + return this; + } + + /** + * Get stats + * @return stats + **/ + @javax.annotation.Nonnull + public List getStats() { + return stats; + } + + public void setStats(List stats) { + this.stats = stats; + } + + + public TrackingBrowserDetailedStatsListRspAllOfData paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingBrowserDetailedStatsListRspAllOfData trackingBrowserDetailedStatsListRspAllOfData = (TrackingBrowserDetailedStatsListRspAllOfData) o; + return Objects.equals(this.stats, trackingBrowserDetailedStatsListRspAllOfData.stats) && + Objects.equals(this.paging, trackingBrowserDetailedStatsListRspAllOfData.paging); + } + + @Override + public int hashCode() { + return Objects.hash(stats, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingBrowserDetailedStatsListRspAllOfData {\n"); + sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stats"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("stats"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingBrowserDetailedStatsListRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingBrowserDetailedStatsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBrowserDetailedStatsListRspAllOfData is not found in the empty JSON string", TrackingBrowserDetailedStatsListRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingBrowserDetailedStatsListRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBrowserDetailedStatsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingBrowserDetailedStatsListRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("stats").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); + } + + JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); + // validate the required field `stats` (array) + for (int i = 0; i < jsonArraystats.size(); i++) { + TrackingBrowserDetailedStats.validateJsonElement(jsonArraystats.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingBrowserDetailedStatsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingBrowserDetailedStatsListRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingBrowserDetailedStatsListRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingBrowserDetailedStatsListRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingBrowserDetailedStatsListRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingBrowserDetailedStatsListRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingBrowserDetailedStatsListRspAllOfData + * @throws IOException if the JSON string is invalid with respect to TrackingBrowserDetailedStatsListRspAllOfData + */ + public static TrackingBrowserDetailedStatsListRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingBrowserDetailedStatsListRspAllOfData.class); + } + + /** + * Convert an instance of TrackingBrowserDetailedStatsListRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingBrowserStats.java b/src/main/java/com/corbado/generated/model/TrackingBrowserStats.java new file mode 100644 index 0000000..323265e --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingBrowserStats.java @@ -0,0 +1,349 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingBrowserStats + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingBrowserStats { + public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; + @SerializedName(SERIALIZED_NAME_TIME_POINT) + private String timePoint; + + public static final String SERIALIZED_NAME_CHROME = "chrome"; + @SerializedName(SERIALIZED_NAME_CHROME) + private Integer chrome; + + public static final String SERIALIZED_NAME_SAFARI = "safari"; + @SerializedName(SERIALIZED_NAME_SAFARI) + private Integer safari; + + public static final String SERIALIZED_NAME_EDGE = "edge"; + @SerializedName(SERIALIZED_NAME_EDGE) + private Integer edge; + + public static final String SERIALIZED_NAME_FIREFOX = "firefox"; + @SerializedName(SERIALIZED_NAME_FIREFOX) + private Integer firefox; + + public static final String SERIALIZED_NAME_OTHER = "other"; + @SerializedName(SERIALIZED_NAME_OTHER) + private Integer other; + + public TrackingBrowserStats() { + } + + public TrackingBrowserStats timePoint(String timePoint) { + this.timePoint = timePoint; + return this; + } + + /** + * Get timePoint + * @return timePoint + **/ + @javax.annotation.Nonnull + public String getTimePoint() { + return timePoint; + } + + public void setTimePoint(String timePoint) { + this.timePoint = timePoint; + } + + + public TrackingBrowserStats chrome(Integer chrome) { + this.chrome = chrome; + return this; + } + + /** + * Get chrome + * @return chrome + **/ + @javax.annotation.Nonnull + public Integer getChrome() { + return chrome; + } + + public void setChrome(Integer chrome) { + this.chrome = chrome; + } + + + public TrackingBrowserStats safari(Integer safari) { + this.safari = safari; + return this; + } + + /** + * Get safari + * @return safari + **/ + @javax.annotation.Nonnull + public Integer getSafari() { + return safari; + } + + public void setSafari(Integer safari) { + this.safari = safari; + } + + + public TrackingBrowserStats edge(Integer edge) { + this.edge = edge; + return this; + } + + /** + * Get edge + * @return edge + **/ + @javax.annotation.Nonnull + public Integer getEdge() { + return edge; + } + + public void setEdge(Integer edge) { + this.edge = edge; + } + + + public TrackingBrowserStats firefox(Integer firefox) { + this.firefox = firefox; + return this; + } + + /** + * Get firefox + * @return firefox + **/ + @javax.annotation.Nonnull + public Integer getFirefox() { + return firefox; + } + + public void setFirefox(Integer firefox) { + this.firefox = firefox; + } + + + public TrackingBrowserStats other(Integer other) { + this.other = other; + return this; + } + + /** + * Get other + * @return other + **/ + @javax.annotation.Nonnull + public Integer getOther() { + return other; + } + + public void setOther(Integer other) { + this.other = other; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingBrowserStats trackingBrowserStats = (TrackingBrowserStats) o; + return Objects.equals(this.timePoint, trackingBrowserStats.timePoint) && + Objects.equals(this.chrome, trackingBrowserStats.chrome) && + Objects.equals(this.safari, trackingBrowserStats.safari) && + Objects.equals(this.edge, trackingBrowserStats.edge) && + Objects.equals(this.firefox, trackingBrowserStats.firefox) && + Objects.equals(this.other, trackingBrowserStats.other); + } + + @Override + public int hashCode() { + return Objects.hash(timePoint, chrome, safari, edge, firefox, other); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingBrowserStats {\n"); + sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); + sb.append(" chrome: ").append(toIndentedString(chrome)).append("\n"); + sb.append(" safari: ").append(toIndentedString(safari)).append("\n"); + sb.append(" edge: ").append(toIndentedString(edge)).append("\n"); + sb.append(" firefox: ").append(toIndentedString(firefox)).append("\n"); + sb.append(" other: ").append(toIndentedString(other)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("timePoint"); + openapiFields.add("chrome"); + openapiFields.add("safari"); + openapiFields.add("edge"); + openapiFields.add("firefox"); + openapiFields.add("other"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("timePoint"); + openapiRequiredFields.add("chrome"); + openapiRequiredFields.add("safari"); + openapiRequiredFields.add("edge"); + openapiRequiredFields.add("firefox"); + openapiRequiredFields.add("other"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingBrowserStats + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingBrowserStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBrowserStats is not found in the empty JSON string", TrackingBrowserStats.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingBrowserStats.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBrowserStats` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingBrowserStats.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("timePoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingBrowserStats.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingBrowserStats' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingBrowserStats.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingBrowserStats value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingBrowserStats read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingBrowserStats given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingBrowserStats + * @throws IOException if the JSON string is invalid with respect to TrackingBrowserStats + */ + public static TrackingBrowserStats fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingBrowserStats.class); + } + + /** + * Convert an instance of TrackingBrowserStats to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRsp.java b/src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRsp.java new file mode 100644 index 0000000..f0fd562 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.TrackingBrowserStatsListRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingBrowserStatsListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingBrowserStatsListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private TrackingBrowserStatsListRspAllOfData data; + + public TrackingBrowserStatsListRsp() { + } + + public TrackingBrowserStatsListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public TrackingBrowserStatsListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public TrackingBrowserStatsListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public TrackingBrowserStatsListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public TrackingBrowserStatsListRsp data(TrackingBrowserStatsListRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public TrackingBrowserStatsListRspAllOfData getData() { + return data; + } + + public void setData(TrackingBrowserStatsListRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingBrowserStatsListRsp trackingBrowserStatsListRsp = (TrackingBrowserStatsListRsp) o; + return Objects.equals(this.httpStatusCode, trackingBrowserStatsListRsp.httpStatusCode) && + Objects.equals(this.message, trackingBrowserStatsListRsp.message) && + Objects.equals(this.requestData, trackingBrowserStatsListRsp.requestData) && + Objects.equals(this.runtime, trackingBrowserStatsListRsp.runtime) && + Objects.equals(this.data, trackingBrowserStatsListRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingBrowserStatsListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingBrowserStatsListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingBrowserStatsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBrowserStatsListRsp is not found in the empty JSON string", TrackingBrowserStatsListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingBrowserStatsListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBrowserStatsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingBrowserStatsListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + TrackingBrowserStatsListRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingBrowserStatsListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingBrowserStatsListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingBrowserStatsListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingBrowserStatsListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingBrowserStatsListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingBrowserStatsListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingBrowserStatsListRsp + * @throws IOException if the JSON string is invalid with respect to TrackingBrowserStatsListRsp + */ + public static TrackingBrowserStatsListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingBrowserStatsListRsp.class); + } + + /** + * Convert an instance of TrackingBrowserStatsListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRspAllOfData.java new file mode 100644 index 0000000..08fb21c --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRspAllOfData.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.TrackingBrowserStats; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingBrowserStatsListRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingBrowserStatsListRspAllOfData { + public static final String SERIALIZED_NAME_STATS = "stats"; + @SerializedName(SERIALIZED_NAME_STATS) + private List stats = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public TrackingBrowserStatsListRspAllOfData() { + } + + public TrackingBrowserStatsListRspAllOfData stats(List stats) { + this.stats = stats; + return this; + } + + public TrackingBrowserStatsListRspAllOfData addStatsItem(TrackingBrowserStats statsItem) { + if (this.stats == null) { + this.stats = new ArrayList<>(); + } + this.stats.add(statsItem); + return this; + } + + /** + * Get stats + * @return stats + **/ + @javax.annotation.Nonnull + public List getStats() { + return stats; + } + + public void setStats(List stats) { + this.stats = stats; + } + + + public TrackingBrowserStatsListRspAllOfData paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingBrowserStatsListRspAllOfData trackingBrowserStatsListRspAllOfData = (TrackingBrowserStatsListRspAllOfData) o; + return Objects.equals(this.stats, trackingBrowserStatsListRspAllOfData.stats) && + Objects.equals(this.paging, trackingBrowserStatsListRspAllOfData.paging); + } + + @Override + public int hashCode() { + return Objects.hash(stats, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingBrowserStatsListRspAllOfData {\n"); + sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stats"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("stats"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingBrowserStatsListRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingBrowserStatsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBrowserStatsListRspAllOfData is not found in the empty JSON string", TrackingBrowserStatsListRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingBrowserStatsListRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBrowserStatsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingBrowserStatsListRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("stats").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); + } + + JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); + // validate the required field `stats` (array) + for (int i = 0; i < jsonArraystats.size(); i++) { + TrackingBrowserStats.validateJsonElement(jsonArraystats.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingBrowserStatsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingBrowserStatsListRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingBrowserStatsListRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingBrowserStatsListRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingBrowserStatsListRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingBrowserStatsListRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingBrowserStatsListRspAllOfData + * @throws IOException if the JSON string is invalid with respect to TrackingBrowserStatsListRspAllOfData + */ + public static TrackingBrowserStatsListRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingBrowserStatsListRspAllOfData.class); + } + + /** + * Convert an instance of TrackingBrowserStatsListRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingDetailedStats.java b/src/main/java/com/corbado/generated/model/TrackingDetailedStats.java new file mode 100644 index 0000000..a4f0b12 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingDetailedStats.java @@ -0,0 +1,322 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingDetailedStats + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingDetailedStats { + public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; + @SerializedName(SERIALIZED_NAME_TIME_POINT) + private String timePoint; + + public static final String SERIALIZED_NAME_VISITS = "visits"; + @SerializedName(SERIALIZED_NAME_VISITS) + private Integer visits; + + public static final String SERIALIZED_NAME_WEBAUTHN = "webauthn"; + @SerializedName(SERIALIZED_NAME_WEBAUTHN) + private Integer webauthn; + + public static final String SERIALIZED_NAME_PLATFORM = "platform"; + @SerializedName(SERIALIZED_NAME_PLATFORM) + private Integer platform; + + public static final String SERIALIZED_NAME_CONDITIONAL_UI = "conditionalUi"; + @SerializedName(SERIALIZED_NAME_CONDITIONAL_UI) + private Integer conditionalUi; + + public TrackingDetailedStats() { + } + + public TrackingDetailedStats timePoint(String timePoint) { + this.timePoint = timePoint; + return this; + } + + /** + * Get timePoint + * @return timePoint + **/ + @javax.annotation.Nonnull + public String getTimePoint() { + return timePoint; + } + + public void setTimePoint(String timePoint) { + this.timePoint = timePoint; + } + + + public TrackingDetailedStats visits(Integer visits) { + this.visits = visits; + return this; + } + + /** + * Get visits + * @return visits + **/ + @javax.annotation.Nonnull + public Integer getVisits() { + return visits; + } + + public void setVisits(Integer visits) { + this.visits = visits; + } + + + public TrackingDetailedStats webauthn(Integer webauthn) { + this.webauthn = webauthn; + return this; + } + + /** + * Get webauthn + * @return webauthn + **/ + @javax.annotation.Nonnull + public Integer getWebauthn() { + return webauthn; + } + + public void setWebauthn(Integer webauthn) { + this.webauthn = webauthn; + } + + + public TrackingDetailedStats platform(Integer platform) { + this.platform = platform; + return this; + } + + /** + * Get platform + * @return platform + **/ + @javax.annotation.Nonnull + public Integer getPlatform() { + return platform; + } + + public void setPlatform(Integer platform) { + this.platform = platform; + } + + + public TrackingDetailedStats conditionalUi(Integer conditionalUi) { + this.conditionalUi = conditionalUi; + return this; + } + + /** + * Get conditionalUi + * @return conditionalUi + **/ + @javax.annotation.Nonnull + public Integer getConditionalUi() { + return conditionalUi; + } + + public void setConditionalUi(Integer conditionalUi) { + this.conditionalUi = conditionalUi; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingDetailedStats trackingDetailedStats = (TrackingDetailedStats) o; + return Objects.equals(this.timePoint, trackingDetailedStats.timePoint) && + Objects.equals(this.visits, trackingDetailedStats.visits) && + Objects.equals(this.webauthn, trackingDetailedStats.webauthn) && + Objects.equals(this.platform, trackingDetailedStats.platform) && + Objects.equals(this.conditionalUi, trackingDetailedStats.conditionalUi); + } + + @Override + public int hashCode() { + return Objects.hash(timePoint, visits, webauthn, platform, conditionalUi); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingDetailedStats {\n"); + sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); + sb.append(" visits: ").append(toIndentedString(visits)).append("\n"); + sb.append(" webauthn: ").append(toIndentedString(webauthn)).append("\n"); + sb.append(" platform: ").append(toIndentedString(platform)).append("\n"); + sb.append(" conditionalUi: ").append(toIndentedString(conditionalUi)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("timePoint"); + openapiFields.add("visits"); + openapiFields.add("webauthn"); + openapiFields.add("platform"); + openapiFields.add("conditionalUi"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("timePoint"); + openapiRequiredFields.add("visits"); + openapiRequiredFields.add("webauthn"); + openapiRequiredFields.add("platform"); + openapiRequiredFields.add("conditionalUi"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingDetailedStats + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingDetailedStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingDetailedStats is not found in the empty JSON string", TrackingDetailedStats.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingDetailedStats.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingDetailedStats` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingDetailedStats.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("timePoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingDetailedStats.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingDetailedStats' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingDetailedStats.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingDetailedStats value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingDetailedStats read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingDetailedStats given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingDetailedStats + * @throws IOException if the JSON string is invalid with respect to TrackingDetailedStats + */ + public static TrackingDetailedStats fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingDetailedStats.class); + } + + /** + * Convert an instance of TrackingDetailedStats to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRsp.java b/src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRsp.java new file mode 100644 index 0000000..e6c02b6 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.TrackingDetailedStatsListRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingDetailedStatsListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingDetailedStatsListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private TrackingDetailedStatsListRspAllOfData data; + + public TrackingDetailedStatsListRsp() { + } + + public TrackingDetailedStatsListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public TrackingDetailedStatsListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public TrackingDetailedStatsListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public TrackingDetailedStatsListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public TrackingDetailedStatsListRsp data(TrackingDetailedStatsListRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public TrackingDetailedStatsListRspAllOfData getData() { + return data; + } + + public void setData(TrackingDetailedStatsListRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingDetailedStatsListRsp trackingDetailedStatsListRsp = (TrackingDetailedStatsListRsp) o; + return Objects.equals(this.httpStatusCode, trackingDetailedStatsListRsp.httpStatusCode) && + Objects.equals(this.message, trackingDetailedStatsListRsp.message) && + Objects.equals(this.requestData, trackingDetailedStatsListRsp.requestData) && + Objects.equals(this.runtime, trackingDetailedStatsListRsp.runtime) && + Objects.equals(this.data, trackingDetailedStatsListRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingDetailedStatsListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingDetailedStatsListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingDetailedStatsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingDetailedStatsListRsp is not found in the empty JSON string", TrackingDetailedStatsListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingDetailedStatsListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingDetailedStatsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingDetailedStatsListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + TrackingDetailedStatsListRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingDetailedStatsListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingDetailedStatsListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingDetailedStatsListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingDetailedStatsListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingDetailedStatsListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingDetailedStatsListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingDetailedStatsListRsp + * @throws IOException if the JSON string is invalid with respect to TrackingDetailedStatsListRsp + */ + public static TrackingDetailedStatsListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingDetailedStatsListRsp.class); + } + + /** + * Convert an instance of TrackingDetailedStatsListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRspAllOfData.java new file mode 100644 index 0000000..f37f929 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRspAllOfData.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.TrackingDetailedStats; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingDetailedStatsListRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingDetailedStatsListRspAllOfData { + public static final String SERIALIZED_NAME_STATS = "stats"; + @SerializedName(SERIALIZED_NAME_STATS) + private List stats = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public TrackingDetailedStatsListRspAllOfData() { + } + + public TrackingDetailedStatsListRspAllOfData stats(List stats) { + this.stats = stats; + return this; + } + + public TrackingDetailedStatsListRspAllOfData addStatsItem(TrackingDetailedStats statsItem) { + if (this.stats == null) { + this.stats = new ArrayList<>(); + } + this.stats.add(statsItem); + return this; + } + + /** + * Get stats + * @return stats + **/ + @javax.annotation.Nonnull + public List getStats() { + return stats; + } + + public void setStats(List stats) { + this.stats = stats; + } + + + public TrackingDetailedStatsListRspAllOfData paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingDetailedStatsListRspAllOfData trackingDetailedStatsListRspAllOfData = (TrackingDetailedStatsListRspAllOfData) o; + return Objects.equals(this.stats, trackingDetailedStatsListRspAllOfData.stats) && + Objects.equals(this.paging, trackingDetailedStatsListRspAllOfData.paging); + } + + @Override + public int hashCode() { + return Objects.hash(stats, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingDetailedStatsListRspAllOfData {\n"); + sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stats"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("stats"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingDetailedStatsListRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingDetailedStatsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingDetailedStatsListRspAllOfData is not found in the empty JSON string", TrackingDetailedStatsListRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingDetailedStatsListRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingDetailedStatsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingDetailedStatsListRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("stats").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); + } + + JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); + // validate the required field `stats` (array) + for (int i = 0; i < jsonArraystats.size(); i++) { + TrackingDetailedStats.validateJsonElement(jsonArraystats.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingDetailedStatsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingDetailedStatsListRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingDetailedStatsListRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingDetailedStatsListRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingDetailedStatsListRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingDetailedStatsListRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingDetailedStatsListRspAllOfData + * @throws IOException if the JSON string is invalid with respect to TrackingDetailedStatsListRspAllOfData + */ + public static TrackingDetailedStatsListRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingDetailedStatsListRspAllOfData.class); + } + + /** + * Convert an instance of TrackingDetailedStatsListRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingEnums.java b/src/main/java/com/corbado/generated/model/TrackingEnums.java new file mode 100644 index 0000000..abcd4dc --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingEnums.java @@ -0,0 +1,309 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingEnums + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingEnums { + public static final String SERIALIZED_NAME_BROWSER_NAMES = "browserNames"; + @SerializedName(SERIALIZED_NAME_BROWSER_NAMES) + private List browserNames = new ArrayList<>(); + + public static final String SERIALIZED_NAME_OS_NAMES = "osNames"; + @SerializedName(SERIALIZED_NAME_OS_NAMES) + private List osNames = new ArrayList<>(); + + public static final String SERIALIZED_NAME_OS_PLATFORMS = "osPlatforms"; + @SerializedName(SERIALIZED_NAME_OS_PLATFORMS) + private List osPlatforms = new ArrayList<>(); + + public TrackingEnums() { + } + + public TrackingEnums browserNames(List browserNames) { + this.browserNames = browserNames; + return this; + } + + public TrackingEnums addBrowserNamesItem(String browserNamesItem) { + if (this.browserNames == null) { + this.browserNames = new ArrayList<>(); + } + this.browserNames.add(browserNamesItem); + return this; + } + + /** + * Get browserNames + * @return browserNames + **/ + @javax.annotation.Nonnull + public List getBrowserNames() { + return browserNames; + } + + public void setBrowserNames(List browserNames) { + this.browserNames = browserNames; + } + + + public TrackingEnums osNames(List osNames) { + this.osNames = osNames; + return this; + } + + public TrackingEnums addOsNamesItem(String osNamesItem) { + if (this.osNames == null) { + this.osNames = new ArrayList<>(); + } + this.osNames.add(osNamesItem); + return this; + } + + /** + * Get osNames + * @return osNames + **/ + @javax.annotation.Nonnull + public List getOsNames() { + return osNames; + } + + public void setOsNames(List osNames) { + this.osNames = osNames; + } + + + public TrackingEnums osPlatforms(List osPlatforms) { + this.osPlatforms = osPlatforms; + return this; + } + + public TrackingEnums addOsPlatformsItem(String osPlatformsItem) { + if (this.osPlatforms == null) { + this.osPlatforms = new ArrayList<>(); + } + this.osPlatforms.add(osPlatformsItem); + return this; + } + + /** + * Get osPlatforms + * @return osPlatforms + **/ + @javax.annotation.Nonnull + public List getOsPlatforms() { + return osPlatforms; + } + + public void setOsPlatforms(List osPlatforms) { + this.osPlatforms = osPlatforms; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingEnums trackingEnums = (TrackingEnums) o; + return Objects.equals(this.browserNames, trackingEnums.browserNames) && + Objects.equals(this.osNames, trackingEnums.osNames) && + Objects.equals(this.osPlatforms, trackingEnums.osPlatforms); + } + + @Override + public int hashCode() { + return Objects.hash(browserNames, osNames, osPlatforms); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingEnums {\n"); + sb.append(" browserNames: ").append(toIndentedString(browserNames)).append("\n"); + sb.append(" osNames: ").append(toIndentedString(osNames)).append("\n"); + sb.append(" osPlatforms: ").append(toIndentedString(osPlatforms)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("browserNames"); + openapiFields.add("osNames"); + openapiFields.add("osPlatforms"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("browserNames"); + openapiRequiredFields.add("osNames"); + openapiRequiredFields.add("osPlatforms"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingEnums + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingEnums.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingEnums is not found in the empty JSON string", TrackingEnums.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingEnums.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingEnums` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingEnums.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("browserNames") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("browserNames").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `browserNames` to be an array in the JSON string but got `%s`", jsonObj.get("browserNames").toString())); + } + // ensure the required json array is present + if (jsonObj.get("osNames") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("osNames").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `osNames` to be an array in the JSON string but got `%s`", jsonObj.get("osNames").toString())); + } + // ensure the required json array is present + if (jsonObj.get("osPlatforms") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("osPlatforms").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `osPlatforms` to be an array in the JSON string but got `%s`", jsonObj.get("osPlatforms").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingEnums.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingEnums' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingEnums.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingEnums value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingEnums read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingEnums given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingEnums + * @throws IOException if the JSON string is invalid with respect to TrackingEnums + */ + public static TrackingEnums fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingEnums.class); + } + + /** + * Convert an instance of TrackingEnums to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingEnumsGetRsp.java b/src/main/java/com/corbado/generated/model/TrackingEnumsGetRsp.java new file mode 100644 index 0000000..67ed7bc --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingEnumsGetRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.TrackingEnums; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingEnumsGetRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingEnumsGetRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private TrackingEnums data; + + public TrackingEnumsGetRsp() { + } + + public TrackingEnumsGetRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public TrackingEnumsGetRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public TrackingEnumsGetRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public TrackingEnumsGetRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public TrackingEnumsGetRsp data(TrackingEnums data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public TrackingEnums getData() { + return data; + } + + public void setData(TrackingEnums data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingEnumsGetRsp trackingEnumsGetRsp = (TrackingEnumsGetRsp) o; + return Objects.equals(this.httpStatusCode, trackingEnumsGetRsp.httpStatusCode) && + Objects.equals(this.message, trackingEnumsGetRsp.message) && + Objects.equals(this.requestData, trackingEnumsGetRsp.requestData) && + Objects.equals(this.runtime, trackingEnumsGetRsp.runtime) && + Objects.equals(this.data, trackingEnumsGetRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingEnumsGetRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingEnumsGetRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingEnumsGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingEnumsGetRsp is not found in the empty JSON string", TrackingEnumsGetRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingEnumsGetRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingEnumsGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingEnumsGetRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + TrackingEnums.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingEnumsGetRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingEnumsGetRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingEnumsGetRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingEnumsGetRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingEnumsGetRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingEnumsGetRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingEnumsGetRsp + * @throws IOException if the JSON string is invalid with respect to TrackingEnumsGetRsp + */ + public static TrackingEnumsGetRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingEnumsGetRsp.class); + } + + /** + * Convert an instance of TrackingEnumsGetRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingOSDetailedStats.java b/src/main/java/com/corbado/generated/model/TrackingOSDetailedStats.java new file mode 100644 index 0000000..bff01b6 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingOSDetailedStats.java @@ -0,0 +1,468 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingOSDetailedStats + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingOSDetailedStats { + public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; + @SerializedName(SERIALIZED_NAME_TIME_POINT) + private String timePoint; + + public static final String SERIALIZED_NAME_OS_NAME = "osName"; + @SerializedName(SERIALIZED_NAME_OS_NAME) + private String osName; + + public static final String SERIALIZED_NAME_OS_VERSION = "osVersion"; + @SerializedName(SERIALIZED_NAME_OS_VERSION) + private String osVersion; + + /** + * Gets or Sets osPlatform + */ + @JsonAdapter(OsPlatformEnum.Adapter.class) + public enum OsPlatformEnum { + DESKTOP("desktop"), + + MOBILE("mobile"), + + UNKNOWN("unknown"); + + private String value; + + OsPlatformEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OsPlatformEnum fromValue(String value) { + for (OsPlatformEnum b : OsPlatformEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OsPlatformEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OsPlatformEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OsPlatformEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + OsPlatformEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_OS_PLATFORM = "osPlatform"; + @SerializedName(SERIALIZED_NAME_OS_PLATFORM) + private OsPlatformEnum osPlatform; + + public static final String SERIALIZED_NAME_CNT = "cnt"; + @SerializedName(SERIALIZED_NAME_CNT) + private Integer cnt; + + public static final String SERIALIZED_NAME_WEBAUTHN = "webauthn"; + @SerializedName(SERIALIZED_NAME_WEBAUTHN) + private Integer webauthn; + + public static final String SERIALIZED_NAME_PLATFORM = "platform"; + @SerializedName(SERIALIZED_NAME_PLATFORM) + private Integer platform; + + public static final String SERIALIZED_NAME_CONDITIONAL_UI = "conditional_ui"; + @SerializedName(SERIALIZED_NAME_CONDITIONAL_UI) + private Integer conditionalUi; + + public TrackingOSDetailedStats() { + } + + public TrackingOSDetailedStats timePoint(String timePoint) { + this.timePoint = timePoint; + return this; + } + + /** + * Get timePoint + * @return timePoint + **/ + @javax.annotation.Nonnull + public String getTimePoint() { + return timePoint; + } + + public void setTimePoint(String timePoint) { + this.timePoint = timePoint; + } + + + public TrackingOSDetailedStats osName(String osName) { + this.osName = osName; + return this; + } + + /** + * Get osName + * @return osName + **/ + @javax.annotation.Nonnull + public String getOsName() { + return osName; + } + + public void setOsName(String osName) { + this.osName = osName; + } + + + public TrackingOSDetailedStats osVersion(String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * Get osVersion + * @return osVersion + **/ + @javax.annotation.Nonnull + public String getOsVersion() { + return osVersion; + } + + public void setOsVersion(String osVersion) { + this.osVersion = osVersion; + } + + + public TrackingOSDetailedStats osPlatform(OsPlatformEnum osPlatform) { + this.osPlatform = osPlatform; + return this; + } + + /** + * Get osPlatform + * @return osPlatform + **/ + @javax.annotation.Nonnull + public OsPlatformEnum getOsPlatform() { + return osPlatform; + } + + public void setOsPlatform(OsPlatformEnum osPlatform) { + this.osPlatform = osPlatform; + } + + + public TrackingOSDetailedStats cnt(Integer cnt) { + this.cnt = cnt; + return this; + } + + /** + * Get cnt + * @return cnt + **/ + @javax.annotation.Nonnull + public Integer getCnt() { + return cnt; + } + + public void setCnt(Integer cnt) { + this.cnt = cnt; + } + + + public TrackingOSDetailedStats webauthn(Integer webauthn) { + this.webauthn = webauthn; + return this; + } + + /** + * Get webauthn + * @return webauthn + **/ + @javax.annotation.Nonnull + public Integer getWebauthn() { + return webauthn; + } + + public void setWebauthn(Integer webauthn) { + this.webauthn = webauthn; + } + + + public TrackingOSDetailedStats platform(Integer platform) { + this.platform = platform; + return this; + } + + /** + * Get platform + * @return platform + **/ + @javax.annotation.Nonnull + public Integer getPlatform() { + return platform; + } + + public void setPlatform(Integer platform) { + this.platform = platform; + } + + + public TrackingOSDetailedStats conditionalUi(Integer conditionalUi) { + this.conditionalUi = conditionalUi; + return this; + } + + /** + * Get conditionalUi + * @return conditionalUi + **/ + @javax.annotation.Nonnull + public Integer getConditionalUi() { + return conditionalUi; + } + + public void setConditionalUi(Integer conditionalUi) { + this.conditionalUi = conditionalUi; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingOSDetailedStats trackingOSDetailedStats = (TrackingOSDetailedStats) o; + return Objects.equals(this.timePoint, trackingOSDetailedStats.timePoint) && + Objects.equals(this.osName, trackingOSDetailedStats.osName) && + Objects.equals(this.osVersion, trackingOSDetailedStats.osVersion) && + Objects.equals(this.osPlatform, trackingOSDetailedStats.osPlatform) && + Objects.equals(this.cnt, trackingOSDetailedStats.cnt) && + Objects.equals(this.webauthn, trackingOSDetailedStats.webauthn) && + Objects.equals(this.platform, trackingOSDetailedStats.platform) && + Objects.equals(this.conditionalUi, trackingOSDetailedStats.conditionalUi); + } + + @Override + public int hashCode() { + return Objects.hash(timePoint, osName, osVersion, osPlatform, cnt, webauthn, platform, conditionalUi); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingOSDetailedStats {\n"); + sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); + sb.append(" osName: ").append(toIndentedString(osName)).append("\n"); + sb.append(" osVersion: ").append(toIndentedString(osVersion)).append("\n"); + sb.append(" osPlatform: ").append(toIndentedString(osPlatform)).append("\n"); + sb.append(" cnt: ").append(toIndentedString(cnt)).append("\n"); + sb.append(" webauthn: ").append(toIndentedString(webauthn)).append("\n"); + sb.append(" platform: ").append(toIndentedString(platform)).append("\n"); + sb.append(" conditionalUi: ").append(toIndentedString(conditionalUi)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("timePoint"); + openapiFields.add("osName"); + openapiFields.add("osVersion"); + openapiFields.add("osPlatform"); + openapiFields.add("cnt"); + openapiFields.add("webauthn"); + openapiFields.add("platform"); + openapiFields.add("conditional_ui"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("timePoint"); + openapiRequiredFields.add("osName"); + openapiRequiredFields.add("osVersion"); + openapiRequiredFields.add("osPlatform"); + openapiRequiredFields.add("cnt"); + openapiRequiredFields.add("webauthn"); + openapiRequiredFields.add("platform"); + openapiRequiredFields.add("conditional_ui"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingOSDetailedStats + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingOSDetailedStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingOSDetailedStats is not found in the empty JSON string", TrackingOSDetailedStats.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingOSDetailedStats.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingOSDetailedStats` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingOSDetailedStats.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("timePoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); + } + if (!jsonObj.get("osName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `osName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osName").toString())); + } + if (!jsonObj.get("osVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `osVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osVersion").toString())); + } + if (!jsonObj.get("osPlatform").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `osPlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osPlatform").toString())); + } + // validate the required field `osPlatform` + OsPlatformEnum.validateJsonElement(jsonObj.get("osPlatform")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingOSDetailedStats.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingOSDetailedStats' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingOSDetailedStats.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingOSDetailedStats value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingOSDetailedStats read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingOSDetailedStats given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingOSDetailedStats + * @throws IOException if the JSON string is invalid with respect to TrackingOSDetailedStats + */ + public static TrackingOSDetailedStats fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingOSDetailedStats.class); + } + + /** + * Convert an instance of TrackingOSDetailedStats to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRsp.java b/src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRsp.java new file mode 100644 index 0000000..07e94f9 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.TrackingOSDetailedStatsListRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingOSDetailedStatsListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingOSDetailedStatsListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private TrackingOSDetailedStatsListRspAllOfData data; + + public TrackingOSDetailedStatsListRsp() { + } + + public TrackingOSDetailedStatsListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public TrackingOSDetailedStatsListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public TrackingOSDetailedStatsListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public TrackingOSDetailedStatsListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public TrackingOSDetailedStatsListRsp data(TrackingOSDetailedStatsListRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public TrackingOSDetailedStatsListRspAllOfData getData() { + return data; + } + + public void setData(TrackingOSDetailedStatsListRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingOSDetailedStatsListRsp trackingOSDetailedStatsListRsp = (TrackingOSDetailedStatsListRsp) o; + return Objects.equals(this.httpStatusCode, trackingOSDetailedStatsListRsp.httpStatusCode) && + Objects.equals(this.message, trackingOSDetailedStatsListRsp.message) && + Objects.equals(this.requestData, trackingOSDetailedStatsListRsp.requestData) && + Objects.equals(this.runtime, trackingOSDetailedStatsListRsp.runtime) && + Objects.equals(this.data, trackingOSDetailedStatsListRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingOSDetailedStatsListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingOSDetailedStatsListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingOSDetailedStatsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingOSDetailedStatsListRsp is not found in the empty JSON string", TrackingOSDetailedStatsListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingOSDetailedStatsListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingOSDetailedStatsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingOSDetailedStatsListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + TrackingOSDetailedStatsListRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingOSDetailedStatsListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingOSDetailedStatsListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingOSDetailedStatsListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingOSDetailedStatsListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingOSDetailedStatsListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingOSDetailedStatsListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingOSDetailedStatsListRsp + * @throws IOException if the JSON string is invalid with respect to TrackingOSDetailedStatsListRsp + */ + public static TrackingOSDetailedStatsListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingOSDetailedStatsListRsp.class); + } + + /** + * Convert an instance of TrackingOSDetailedStatsListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRspAllOfData.java new file mode 100644 index 0000000..67225db --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRspAllOfData.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.TrackingOSDetailedStats; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingOSDetailedStatsListRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingOSDetailedStatsListRspAllOfData { + public static final String SERIALIZED_NAME_STATS = "stats"; + @SerializedName(SERIALIZED_NAME_STATS) + private List stats = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public TrackingOSDetailedStatsListRspAllOfData() { + } + + public TrackingOSDetailedStatsListRspAllOfData stats(List stats) { + this.stats = stats; + return this; + } + + public TrackingOSDetailedStatsListRspAllOfData addStatsItem(TrackingOSDetailedStats statsItem) { + if (this.stats == null) { + this.stats = new ArrayList<>(); + } + this.stats.add(statsItem); + return this; + } + + /** + * Get stats + * @return stats + **/ + @javax.annotation.Nonnull + public List getStats() { + return stats; + } + + public void setStats(List stats) { + this.stats = stats; + } + + + public TrackingOSDetailedStatsListRspAllOfData paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingOSDetailedStatsListRspAllOfData trackingOSDetailedStatsListRspAllOfData = (TrackingOSDetailedStatsListRspAllOfData) o; + return Objects.equals(this.stats, trackingOSDetailedStatsListRspAllOfData.stats) && + Objects.equals(this.paging, trackingOSDetailedStatsListRspAllOfData.paging); + } + + @Override + public int hashCode() { + return Objects.hash(stats, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingOSDetailedStatsListRspAllOfData {\n"); + sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stats"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("stats"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingOSDetailedStatsListRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingOSDetailedStatsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingOSDetailedStatsListRspAllOfData is not found in the empty JSON string", TrackingOSDetailedStatsListRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingOSDetailedStatsListRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingOSDetailedStatsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingOSDetailedStatsListRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("stats").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); + } + + JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); + // validate the required field `stats` (array) + for (int i = 0; i < jsonArraystats.size(); i++) { + TrackingOSDetailedStats.validateJsonElement(jsonArraystats.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingOSDetailedStatsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingOSDetailedStatsListRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingOSDetailedStatsListRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingOSDetailedStatsListRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingOSDetailedStatsListRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingOSDetailedStatsListRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingOSDetailedStatsListRspAllOfData + * @throws IOException if the JSON string is invalid with respect to TrackingOSDetailedStatsListRspAllOfData + */ + public static TrackingOSDetailedStatsListRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingOSDetailedStatsListRspAllOfData.class); + } + + /** + * Convert an instance of TrackingOSDetailedStatsListRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingOSStats.java b/src/main/java/com/corbado/generated/model/TrackingOSStats.java new file mode 100644 index 0000000..532a673 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingOSStats.java @@ -0,0 +1,349 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingOSStats + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingOSStats { + public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; + @SerializedName(SERIALIZED_NAME_TIME_POINT) + private String timePoint; + + public static final String SERIALIZED_NAME_MACOS = "macos"; + @SerializedName(SERIALIZED_NAME_MACOS) + private Integer macos; + + public static final String SERIALIZED_NAME_WINDOWS = "windows"; + @SerializedName(SERIALIZED_NAME_WINDOWS) + private Integer windows; + + public static final String SERIALIZED_NAME_IOS = "ios"; + @SerializedName(SERIALIZED_NAME_IOS) + private Integer ios; + + public static final String SERIALIZED_NAME_ANDROID = "android"; + @SerializedName(SERIALIZED_NAME_ANDROID) + private Integer android; + + public static final String SERIALIZED_NAME_OTHER = "other"; + @SerializedName(SERIALIZED_NAME_OTHER) + private Integer other; + + public TrackingOSStats() { + } + + public TrackingOSStats timePoint(String timePoint) { + this.timePoint = timePoint; + return this; + } + + /** + * Get timePoint + * @return timePoint + **/ + @javax.annotation.Nonnull + public String getTimePoint() { + return timePoint; + } + + public void setTimePoint(String timePoint) { + this.timePoint = timePoint; + } + + + public TrackingOSStats macos(Integer macos) { + this.macos = macos; + return this; + } + + /** + * Get macos + * @return macos + **/ + @javax.annotation.Nonnull + public Integer getMacos() { + return macos; + } + + public void setMacos(Integer macos) { + this.macos = macos; + } + + + public TrackingOSStats windows(Integer windows) { + this.windows = windows; + return this; + } + + /** + * Get windows + * @return windows + **/ + @javax.annotation.Nonnull + public Integer getWindows() { + return windows; + } + + public void setWindows(Integer windows) { + this.windows = windows; + } + + + public TrackingOSStats ios(Integer ios) { + this.ios = ios; + return this; + } + + /** + * Get ios + * @return ios + **/ + @javax.annotation.Nonnull + public Integer getIos() { + return ios; + } + + public void setIos(Integer ios) { + this.ios = ios; + } + + + public TrackingOSStats android(Integer android) { + this.android = android; + return this; + } + + /** + * Get android + * @return android + **/ + @javax.annotation.Nonnull + public Integer getAndroid() { + return android; + } + + public void setAndroid(Integer android) { + this.android = android; + } + + + public TrackingOSStats other(Integer other) { + this.other = other; + return this; + } + + /** + * Get other + * @return other + **/ + @javax.annotation.Nonnull + public Integer getOther() { + return other; + } + + public void setOther(Integer other) { + this.other = other; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingOSStats trackingOSStats = (TrackingOSStats) o; + return Objects.equals(this.timePoint, trackingOSStats.timePoint) && + Objects.equals(this.macos, trackingOSStats.macos) && + Objects.equals(this.windows, trackingOSStats.windows) && + Objects.equals(this.ios, trackingOSStats.ios) && + Objects.equals(this.android, trackingOSStats.android) && + Objects.equals(this.other, trackingOSStats.other); + } + + @Override + public int hashCode() { + return Objects.hash(timePoint, macos, windows, ios, android, other); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingOSStats {\n"); + sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); + sb.append(" macos: ").append(toIndentedString(macos)).append("\n"); + sb.append(" windows: ").append(toIndentedString(windows)).append("\n"); + sb.append(" ios: ").append(toIndentedString(ios)).append("\n"); + sb.append(" android: ").append(toIndentedString(android)).append("\n"); + sb.append(" other: ").append(toIndentedString(other)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("timePoint"); + openapiFields.add("macos"); + openapiFields.add("windows"); + openapiFields.add("ios"); + openapiFields.add("android"); + openapiFields.add("other"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("timePoint"); + openapiRequiredFields.add("macos"); + openapiRequiredFields.add("windows"); + openapiRequiredFields.add("ios"); + openapiRequiredFields.add("android"); + openapiRequiredFields.add("other"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingOSStats + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingOSStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingOSStats is not found in the empty JSON string", TrackingOSStats.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingOSStats.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingOSStats` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingOSStats.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("timePoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingOSStats.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingOSStats' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingOSStats.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingOSStats value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingOSStats read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingOSStats given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingOSStats + * @throws IOException if the JSON string is invalid with respect to TrackingOSStats + */ + public static TrackingOSStats fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingOSStats.class); + } + + /** + * Convert an instance of TrackingOSStats to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingOSStatsListRsp.java b/src/main/java/com/corbado/generated/model/TrackingOSStatsListRsp.java new file mode 100644 index 0000000..51f781f --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingOSStatsListRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.TrackingOSStatsListRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingOSStatsListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingOSStatsListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private TrackingOSStatsListRspAllOfData data; + + public TrackingOSStatsListRsp() { + } + + public TrackingOSStatsListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public TrackingOSStatsListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public TrackingOSStatsListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public TrackingOSStatsListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public TrackingOSStatsListRsp data(TrackingOSStatsListRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public TrackingOSStatsListRspAllOfData getData() { + return data; + } + + public void setData(TrackingOSStatsListRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingOSStatsListRsp trackingOSStatsListRsp = (TrackingOSStatsListRsp) o; + return Objects.equals(this.httpStatusCode, trackingOSStatsListRsp.httpStatusCode) && + Objects.equals(this.message, trackingOSStatsListRsp.message) && + Objects.equals(this.requestData, trackingOSStatsListRsp.requestData) && + Objects.equals(this.runtime, trackingOSStatsListRsp.runtime) && + Objects.equals(this.data, trackingOSStatsListRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingOSStatsListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingOSStatsListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingOSStatsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingOSStatsListRsp is not found in the empty JSON string", TrackingOSStatsListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingOSStatsListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingOSStatsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingOSStatsListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + TrackingOSStatsListRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingOSStatsListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingOSStatsListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingOSStatsListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingOSStatsListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingOSStatsListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingOSStatsListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingOSStatsListRsp + * @throws IOException if the JSON string is invalid with respect to TrackingOSStatsListRsp + */ + public static TrackingOSStatsListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingOSStatsListRsp.class); + } + + /** + * Convert an instance of TrackingOSStatsListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingOSStatsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/TrackingOSStatsListRspAllOfData.java new file mode 100644 index 0000000..dd5c1cc --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingOSStatsListRspAllOfData.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.TrackingOSStats; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingOSStatsListRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingOSStatsListRspAllOfData { + public static final String SERIALIZED_NAME_STATS = "stats"; + @SerializedName(SERIALIZED_NAME_STATS) + private List stats = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public TrackingOSStatsListRspAllOfData() { + } + + public TrackingOSStatsListRspAllOfData stats(List stats) { + this.stats = stats; + return this; + } + + public TrackingOSStatsListRspAllOfData addStatsItem(TrackingOSStats statsItem) { + if (this.stats == null) { + this.stats = new ArrayList<>(); + } + this.stats.add(statsItem); + return this; + } + + /** + * Get stats + * @return stats + **/ + @javax.annotation.Nonnull + public List getStats() { + return stats; + } + + public void setStats(List stats) { + this.stats = stats; + } + + + public TrackingOSStatsListRspAllOfData paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingOSStatsListRspAllOfData trackingOSStatsListRspAllOfData = (TrackingOSStatsListRspAllOfData) o; + return Objects.equals(this.stats, trackingOSStatsListRspAllOfData.stats) && + Objects.equals(this.paging, trackingOSStatsListRspAllOfData.paging); + } + + @Override + public int hashCode() { + return Objects.hash(stats, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingOSStatsListRspAllOfData {\n"); + sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stats"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("stats"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingOSStatsListRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingOSStatsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingOSStatsListRspAllOfData is not found in the empty JSON string", TrackingOSStatsListRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingOSStatsListRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingOSStatsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingOSStatsListRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("stats").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); + } + + JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); + // validate the required field `stats` (array) + for (int i = 0; i < jsonArraystats.size(); i++) { + TrackingOSStats.validateJsonElement(jsonArraystats.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingOSStatsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingOSStatsListRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingOSStatsListRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingOSStatsListRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingOSStatsListRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingOSStatsListRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingOSStatsListRspAllOfData + * @throws IOException if the JSON string is invalid with respect to TrackingOSStatsListRspAllOfData + */ + public static TrackingOSStatsListRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingOSStatsListRspAllOfData.class); + } + + /** + * Convert an instance of TrackingOSStatsListRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingRawListRow.java b/src/main/java/com/corbado/generated/model/TrackingRawListRow.java new file mode 100644 index 0000000..ced1658 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingRawListRow.java @@ -0,0 +1,355 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingRawListRow + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingRawListRow { + public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; + @SerializedName(SERIALIZED_NAME_TIME_POINT) + private String timePoint; + + public static final String SERIALIZED_NAME_HAS_WEBAUTHN = "hasWebauthn"; + @SerializedName(SERIALIZED_NAME_HAS_WEBAUTHN) + private Boolean hasWebauthn; + + public static final String SERIALIZED_NAME_HAS_PLATFORM_AUTH = "hasPlatformAuth"; + @SerializedName(SERIALIZED_NAME_HAS_PLATFORM_AUTH) + private Boolean hasPlatformAuth; + + public static final String SERIALIZED_NAME_HAS_CONDITIONAL_UI = "hasConditionalUi"; + @SerializedName(SERIALIZED_NAME_HAS_CONDITIONAL_UI) + private Boolean hasConditionalUi; + + public static final String SERIALIZED_NAME_OS_ID = "osId"; + @SerializedName(SERIALIZED_NAME_OS_ID) + private String osId; + + public static final String SERIALIZED_NAME_BROWSER_ID = "browserId"; + @SerializedName(SERIALIZED_NAME_BROWSER_ID) + private String browserId; + + public TrackingRawListRow() { + } + + public TrackingRawListRow timePoint(String timePoint) { + this.timePoint = timePoint; + return this; + } + + /** + * Get timePoint + * @return timePoint + **/ + @javax.annotation.Nonnull + public String getTimePoint() { + return timePoint; + } + + public void setTimePoint(String timePoint) { + this.timePoint = timePoint; + } + + + public TrackingRawListRow hasWebauthn(Boolean hasWebauthn) { + this.hasWebauthn = hasWebauthn; + return this; + } + + /** + * Get hasWebauthn + * @return hasWebauthn + **/ + @javax.annotation.Nonnull + public Boolean getHasWebauthn() { + return hasWebauthn; + } + + public void setHasWebauthn(Boolean hasWebauthn) { + this.hasWebauthn = hasWebauthn; + } + + + public TrackingRawListRow hasPlatformAuth(Boolean hasPlatformAuth) { + this.hasPlatformAuth = hasPlatformAuth; + return this; + } + + /** + * Get hasPlatformAuth + * @return hasPlatformAuth + **/ + @javax.annotation.Nonnull + public Boolean getHasPlatformAuth() { + return hasPlatformAuth; + } + + public void setHasPlatformAuth(Boolean hasPlatformAuth) { + this.hasPlatformAuth = hasPlatformAuth; + } + + + public TrackingRawListRow hasConditionalUi(Boolean hasConditionalUi) { + this.hasConditionalUi = hasConditionalUi; + return this; + } + + /** + * Get hasConditionalUi + * @return hasConditionalUi + **/ + @javax.annotation.Nonnull + public Boolean getHasConditionalUi() { + return hasConditionalUi; + } + + public void setHasConditionalUi(Boolean hasConditionalUi) { + this.hasConditionalUi = hasConditionalUi; + } + + + public TrackingRawListRow osId(String osId) { + this.osId = osId; + return this; + } + + /** + * Get osId + * @return osId + **/ + @javax.annotation.Nonnull + public String getOsId() { + return osId; + } + + public void setOsId(String osId) { + this.osId = osId; + } + + + public TrackingRawListRow browserId(String browserId) { + this.browserId = browserId; + return this; + } + + /** + * Get browserId + * @return browserId + **/ + @javax.annotation.Nonnull + public String getBrowserId() { + return browserId; + } + + public void setBrowserId(String browserId) { + this.browserId = browserId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingRawListRow trackingRawListRow = (TrackingRawListRow) o; + return Objects.equals(this.timePoint, trackingRawListRow.timePoint) && + Objects.equals(this.hasWebauthn, trackingRawListRow.hasWebauthn) && + Objects.equals(this.hasPlatformAuth, trackingRawListRow.hasPlatformAuth) && + Objects.equals(this.hasConditionalUi, trackingRawListRow.hasConditionalUi) && + Objects.equals(this.osId, trackingRawListRow.osId) && + Objects.equals(this.browserId, trackingRawListRow.browserId); + } + + @Override + public int hashCode() { + return Objects.hash(timePoint, hasWebauthn, hasPlatformAuth, hasConditionalUi, osId, browserId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingRawListRow {\n"); + sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); + sb.append(" hasWebauthn: ").append(toIndentedString(hasWebauthn)).append("\n"); + sb.append(" hasPlatformAuth: ").append(toIndentedString(hasPlatformAuth)).append("\n"); + sb.append(" hasConditionalUi: ").append(toIndentedString(hasConditionalUi)).append("\n"); + sb.append(" osId: ").append(toIndentedString(osId)).append("\n"); + sb.append(" browserId: ").append(toIndentedString(browserId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("timePoint"); + openapiFields.add("hasWebauthn"); + openapiFields.add("hasPlatformAuth"); + openapiFields.add("hasConditionalUi"); + openapiFields.add("osId"); + openapiFields.add("browserId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("timePoint"); + openapiRequiredFields.add("hasWebauthn"); + openapiRequiredFields.add("hasPlatformAuth"); + openapiRequiredFields.add("hasConditionalUi"); + openapiRequiredFields.add("osId"); + openapiRequiredFields.add("browserId"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingRawListRow + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingRawListRow.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingRawListRow is not found in the empty JSON string", TrackingRawListRow.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingRawListRow.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingRawListRow` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingRawListRow.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("timePoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); + } + if (!jsonObj.get("osId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `osId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osId").toString())); + } + if (!jsonObj.get("browserId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `browserId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("browserId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingRawListRow.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingRawListRow' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingRawListRow.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingRawListRow value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingRawListRow read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingRawListRow given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingRawListRow + * @throws IOException if the JSON string is invalid with respect to TrackingRawListRow + */ + public static TrackingRawListRow fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingRawListRow.class); + } + + /** + * Convert an instance of TrackingRawListRow to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingRawListRsp.java b/src/main/java/com/corbado/generated/model/TrackingRawListRsp.java new file mode 100644 index 0000000..996f66a --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingRawListRsp.java @@ -0,0 +1,378 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.TrackingRawListRow; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingRawListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingRawListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_ROWS = "rows"; + @SerializedName(SERIALIZED_NAME_ROWS) + private List rows = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public TrackingRawListRsp() { + } + + public TrackingRawListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public TrackingRawListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public TrackingRawListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public TrackingRawListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public TrackingRawListRsp rows(List rows) { + this.rows = rows; + return this; + } + + public TrackingRawListRsp addRowsItem(TrackingRawListRow rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * @return rows + **/ + @javax.annotation.Nonnull + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + + public TrackingRawListRsp paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingRawListRsp trackingRawListRsp = (TrackingRawListRsp) o; + return Objects.equals(this.httpStatusCode, trackingRawListRsp.httpStatusCode) && + Objects.equals(this.message, trackingRawListRsp.message) && + Objects.equals(this.requestData, trackingRawListRsp.requestData) && + Objects.equals(this.runtime, trackingRawListRsp.runtime) && + Objects.equals(this.rows, trackingRawListRsp.rows) && + Objects.equals(this.paging, trackingRawListRsp.paging); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, rows, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingRawListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("rows"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("rows"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingRawListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingRawListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingRawListRsp is not found in the empty JSON string", TrackingRawListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingRawListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingRawListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingRawListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rows` to be an array in the JSON string but got `%s`", jsonObj.get("rows").toString())); + } + + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + // validate the required field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + TrackingRawListRow.validateJsonElement(jsonArrayrows.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingRawListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingRawListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingRawListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingRawListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingRawListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingRawListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingRawListRsp + * @throws IOException if the JSON string is invalid with respect to TrackingRawListRsp + */ + public static TrackingRawListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingRawListRsp.class); + } + + /** + * Convert an instance of TrackingRawListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingStats.java b/src/main/java/com/corbado/generated/model/TrackingStats.java new file mode 100644 index 0000000..e5b4505 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingStats.java @@ -0,0 +1,322 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingStats + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingStats { + public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; + @SerializedName(SERIALIZED_NAME_TIME_POINT) + private String timePoint; + + public static final String SERIALIZED_NAME_AGGREGATE_VISITS = "aggregateVisits"; + @SerializedName(SERIALIZED_NAME_AGGREGATE_VISITS) + private Integer aggregateVisits; + + public static final String SERIALIZED_NAME_AGGREGATE_WEBAUTHN = "aggregateWebauthn"; + @SerializedName(SERIALIZED_NAME_AGGREGATE_WEBAUTHN) + private Integer aggregateWebauthn; + + public static final String SERIALIZED_NAME_AGGREGATE_PLATFORM = "aggregatePlatform"; + @SerializedName(SERIALIZED_NAME_AGGREGATE_PLATFORM) + private Integer aggregatePlatform; + + public static final String SERIALIZED_NAME_AGGREGATE_CONDITIONAL_UI = "aggregateConditionalUi"; + @SerializedName(SERIALIZED_NAME_AGGREGATE_CONDITIONAL_UI) + private Integer aggregateConditionalUi; + + public TrackingStats() { + } + + public TrackingStats timePoint(String timePoint) { + this.timePoint = timePoint; + return this; + } + + /** + * Get timePoint + * @return timePoint + **/ + @javax.annotation.Nonnull + public String getTimePoint() { + return timePoint; + } + + public void setTimePoint(String timePoint) { + this.timePoint = timePoint; + } + + + public TrackingStats aggregateVisits(Integer aggregateVisits) { + this.aggregateVisits = aggregateVisits; + return this; + } + + /** + * Get aggregateVisits + * @return aggregateVisits + **/ + @javax.annotation.Nonnull + public Integer getAggregateVisits() { + return aggregateVisits; + } + + public void setAggregateVisits(Integer aggregateVisits) { + this.aggregateVisits = aggregateVisits; + } + + + public TrackingStats aggregateWebauthn(Integer aggregateWebauthn) { + this.aggregateWebauthn = aggregateWebauthn; + return this; + } + + /** + * Get aggregateWebauthn + * @return aggregateWebauthn + **/ + @javax.annotation.Nonnull + public Integer getAggregateWebauthn() { + return aggregateWebauthn; + } + + public void setAggregateWebauthn(Integer aggregateWebauthn) { + this.aggregateWebauthn = aggregateWebauthn; + } + + + public TrackingStats aggregatePlatform(Integer aggregatePlatform) { + this.aggregatePlatform = aggregatePlatform; + return this; + } + + /** + * Get aggregatePlatform + * @return aggregatePlatform + **/ + @javax.annotation.Nonnull + public Integer getAggregatePlatform() { + return aggregatePlatform; + } + + public void setAggregatePlatform(Integer aggregatePlatform) { + this.aggregatePlatform = aggregatePlatform; + } + + + public TrackingStats aggregateConditionalUi(Integer aggregateConditionalUi) { + this.aggregateConditionalUi = aggregateConditionalUi; + return this; + } + + /** + * Get aggregateConditionalUi + * @return aggregateConditionalUi + **/ + @javax.annotation.Nonnull + public Integer getAggregateConditionalUi() { + return aggregateConditionalUi; + } + + public void setAggregateConditionalUi(Integer aggregateConditionalUi) { + this.aggregateConditionalUi = aggregateConditionalUi; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingStats trackingStats = (TrackingStats) o; + return Objects.equals(this.timePoint, trackingStats.timePoint) && + Objects.equals(this.aggregateVisits, trackingStats.aggregateVisits) && + Objects.equals(this.aggregateWebauthn, trackingStats.aggregateWebauthn) && + Objects.equals(this.aggregatePlatform, trackingStats.aggregatePlatform) && + Objects.equals(this.aggregateConditionalUi, trackingStats.aggregateConditionalUi); + } + + @Override + public int hashCode() { + return Objects.hash(timePoint, aggregateVisits, aggregateWebauthn, aggregatePlatform, aggregateConditionalUi); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingStats {\n"); + sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); + sb.append(" aggregateVisits: ").append(toIndentedString(aggregateVisits)).append("\n"); + sb.append(" aggregateWebauthn: ").append(toIndentedString(aggregateWebauthn)).append("\n"); + sb.append(" aggregatePlatform: ").append(toIndentedString(aggregatePlatform)).append("\n"); + sb.append(" aggregateConditionalUi: ").append(toIndentedString(aggregateConditionalUi)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("timePoint"); + openapiFields.add("aggregateVisits"); + openapiFields.add("aggregateWebauthn"); + openapiFields.add("aggregatePlatform"); + openapiFields.add("aggregateConditionalUi"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("timePoint"); + openapiRequiredFields.add("aggregateVisits"); + openapiRequiredFields.add("aggregateWebauthn"); + openapiRequiredFields.add("aggregatePlatform"); + openapiRequiredFields.add("aggregateConditionalUi"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingStats + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingStats is not found in the empty JSON string", TrackingStats.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingStats.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingStats` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingStats.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("timePoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingStats.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingStats' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingStats.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingStats value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingStats read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingStats given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingStats + * @throws IOException if the JSON string is invalid with respect to TrackingStats + */ + public static TrackingStats fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingStats.class); + } + + /** + * Convert an instance of TrackingStats to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingStatsListRsp.java b/src/main/java/com/corbado/generated/model/TrackingStatsListRsp.java new file mode 100644 index 0000000..54fca16 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingStatsListRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.TrackingStatsListRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingStatsListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingStatsListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private TrackingStatsListRspAllOfData data; + + public TrackingStatsListRsp() { + } + + public TrackingStatsListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public TrackingStatsListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public TrackingStatsListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public TrackingStatsListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public TrackingStatsListRsp data(TrackingStatsListRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public TrackingStatsListRspAllOfData getData() { + return data; + } + + public void setData(TrackingStatsListRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingStatsListRsp trackingStatsListRsp = (TrackingStatsListRsp) o; + return Objects.equals(this.httpStatusCode, trackingStatsListRsp.httpStatusCode) && + Objects.equals(this.message, trackingStatsListRsp.message) && + Objects.equals(this.requestData, trackingStatsListRsp.requestData) && + Objects.equals(this.runtime, trackingStatsListRsp.runtime) && + Objects.equals(this.data, trackingStatsListRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingStatsListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingStatsListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingStatsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingStatsListRsp is not found in the empty JSON string", TrackingStatsListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingStatsListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingStatsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingStatsListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + TrackingStatsListRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingStatsListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingStatsListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingStatsListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingStatsListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingStatsListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingStatsListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingStatsListRsp + * @throws IOException if the JSON string is invalid with respect to TrackingStatsListRsp + */ + public static TrackingStatsListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingStatsListRsp.class); + } + + /** + * Convert an instance of TrackingStatsListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/TrackingStatsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/TrackingStatsListRspAllOfData.java new file mode 100644 index 0000000..d3917c9 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/TrackingStatsListRspAllOfData.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.TrackingStats; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * TrackingStatsListRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class TrackingStatsListRspAllOfData { + public static final String SERIALIZED_NAME_STATS = "stats"; + @SerializedName(SERIALIZED_NAME_STATS) + private List stats = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public TrackingStatsListRspAllOfData() { + } + + public TrackingStatsListRspAllOfData stats(List stats) { + this.stats = stats; + return this; + } + + public TrackingStatsListRspAllOfData addStatsItem(TrackingStats statsItem) { + if (this.stats == null) { + this.stats = new ArrayList<>(); + } + this.stats.add(statsItem); + return this; + } + + /** + * Get stats + * @return stats + **/ + @javax.annotation.Nonnull + public List getStats() { + return stats; + } + + public void setStats(List stats) { + this.stats = stats; + } + + + public TrackingStatsListRspAllOfData paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackingStatsListRspAllOfData trackingStatsListRspAllOfData = (TrackingStatsListRspAllOfData) o; + return Objects.equals(this.stats, trackingStatsListRspAllOfData.stats) && + Objects.equals(this.paging, trackingStatsListRspAllOfData.paging); + } + + @Override + public int hashCode() { + return Objects.hash(stats, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackingStatsListRspAllOfData {\n"); + sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stats"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("stats"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TrackingStatsListRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TrackingStatsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingStatsListRspAllOfData is not found in the empty JSON string", TrackingStatsListRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!TrackingStatsListRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingStatsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackingStatsListRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("stats").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); + } + + JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); + // validate the required field `stats` (array) + for (int i = 0; i < jsonArraystats.size(); i++) { + TrackingStats.validateJsonElement(jsonArraystats.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackingStatsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackingStatsListRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackingStatsListRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackingStatsListRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackingStatsListRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackingStatsListRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackingStatsListRspAllOfData + * @throws IOException if the JSON string is invalid with respect to TrackingStatsListRspAllOfData + */ + public static TrackingStatsListRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackingStatsListRspAllOfData.class); + } + + /** + * Convert an instance of TrackingStatsListRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/User.java b/src/main/java/com/corbado/generated/model/User.java new file mode 100644 index 0000000..b16922e --- /dev/null +++ b/src/main/java/com/corbado/generated/model/User.java @@ -0,0 +1,364 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * User entry + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class User { + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + private String ID; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; + @SerializedName(SERIALIZED_NAME_FULL_NAME) + private String fullName; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public User() { + } + + public User ID(String ID) { + this.ID = ID; + return this; + } + + /** + * ID of the user + * @return ID + **/ + @javax.annotation.Nonnull + public String getID() { + return ID; + } + + public void setID(String ID) { + this.ID = ID; + } + + + public User name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public User fullName(String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + **/ + @javax.annotation.Nonnull + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + public User created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public User updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + public User status(String status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.ID, user.ID) && + Objects.equals(this.name, user.name) && + Objects.equals(this.fullName, user.fullName) && + Objects.equals(this.created, user.created) && + Objects.equals(this.updated, user.updated) && + Objects.equals(this.status, user.status); + } + + @Override + public int hashCode() { + return Objects.hash(ID, name, fullName, created, updated, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ID"); + openapiFields.add("name"); + openapiFields.add("fullName"); + openapiFields.add("created"); + openapiFields.add("updated"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ID"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("fullName"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to User + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!User.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in User is not found in the empty JSON string", User.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!User.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : User.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("fullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!User.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'User' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(User.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, User value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public User read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of User given an JSON string + * + * @param jsonString JSON string + * @return An instance of User + * @throws IOException if the JSON string is invalid with respect to User + */ + public static User fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, User.class); + } + + /** + * Convert an instance of User to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserAuthLog.java b/src/main/java/com/corbado/generated/model/UserAuthLog.java new file mode 100644 index 0000000..13aea1d --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserAuthLog.java @@ -0,0 +1,364 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserAuthLog + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserAuthLog { + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_USER_NAME = "userName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + private String userName; + + public static final String SERIALIZED_NAME_METHOD = "method"; + @SerializedName(SERIALIZED_NAME_METHOD) + private String method; + + public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; + @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + private String eventType; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public UserAuthLog() { + } + + public UserAuthLog userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + **/ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public UserAuthLog userName(String userName) { + this.userName = userName; + return this; + } + + /** + * Get userName + * @return userName + **/ + @javax.annotation.Nonnull + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + + public UserAuthLog method(String method) { + this.method = method; + return this; + } + + /** + * Get method + * @return method + **/ + @javax.annotation.Nonnull + public String getMethod() { + return method; + } + + public void setMethod(String method) { + this.method = method; + } + + + public UserAuthLog eventType(String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + **/ + @javax.annotation.Nonnull + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + + public UserAuthLog status(String status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + + public UserAuthLog created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserAuthLog userAuthLog = (UserAuthLog) o; + return Objects.equals(this.userID, userAuthLog.userID) && + Objects.equals(this.userName, userAuthLog.userName) && + Objects.equals(this.method, userAuthLog.method) && + Objects.equals(this.eventType, userAuthLog.eventType) && + Objects.equals(this.status, userAuthLog.status) && + Objects.equals(this.created, userAuthLog.created); + } + + @Override + public int hashCode() { + return Objects.hash(userID, userName, method, eventType, status, created); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserAuthLog {\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userID"); + openapiFields.add("userName"); + openapiFields.add("method"); + openapiFields.add("eventType"); + openapiFields.add("status"); + openapiFields.add("created"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("userName"); + openapiRequiredFields.add("method"); + openapiRequiredFields.add("eventType"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("created"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserAuthLog + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserAuthLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserAuthLog is not found in the empty JSON string", UserAuthLog.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserAuthLog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserAuthLog` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserAuthLog.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("userName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userName").toString())); + } + if (!jsonObj.get("method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); + } + if (!jsonObj.get("eventType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `eventType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventType").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserAuthLog.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserAuthLog' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserAuthLog.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserAuthLog value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserAuthLog read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserAuthLog given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserAuthLog + * @throws IOException if the JSON string is invalid with respect to UserAuthLog + */ + public static UserAuthLog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserAuthLog.class); + } + + /** + * Convert an instance of UserAuthLog to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserAuthLogListRsp.java b/src/main/java/com/corbado/generated/model/UserAuthLogListRsp.java new file mode 100644 index 0000000..1446e90 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserAuthLogListRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.UserAuthLogListRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserAuthLogListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserAuthLogListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private UserAuthLogListRspAllOfData data; + + public UserAuthLogListRsp() { + } + + public UserAuthLogListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public UserAuthLogListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public UserAuthLogListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public UserAuthLogListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public UserAuthLogListRsp data(UserAuthLogListRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public UserAuthLogListRspAllOfData getData() { + return data; + } + + public void setData(UserAuthLogListRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserAuthLogListRsp userAuthLogListRsp = (UserAuthLogListRsp) o; + return Objects.equals(this.httpStatusCode, userAuthLogListRsp.httpStatusCode) && + Objects.equals(this.message, userAuthLogListRsp.message) && + Objects.equals(this.requestData, userAuthLogListRsp.requestData) && + Objects.equals(this.runtime, userAuthLogListRsp.runtime) && + Objects.equals(this.data, userAuthLogListRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserAuthLogListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserAuthLogListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserAuthLogListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserAuthLogListRsp is not found in the empty JSON string", UserAuthLogListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserAuthLogListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserAuthLogListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserAuthLogListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + UserAuthLogListRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserAuthLogListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserAuthLogListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserAuthLogListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserAuthLogListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserAuthLogListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserAuthLogListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserAuthLogListRsp + * @throws IOException if the JSON string is invalid with respect to UserAuthLogListRsp + */ + public static UserAuthLogListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserAuthLogListRsp.class); + } + + /** + * Convert an instance of UserAuthLogListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserAuthLogListRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserAuthLogListRspAllOfData.java new file mode 100644 index 0000000..2393102 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserAuthLogListRspAllOfData.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.UserAuthLog; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserAuthLogListRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserAuthLogListRspAllOfData { + public static final String SERIALIZED_NAME_ROWS = "rows"; + @SerializedName(SERIALIZED_NAME_ROWS) + private List rows = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public UserAuthLogListRspAllOfData() { + } + + public UserAuthLogListRspAllOfData rows(List rows) { + this.rows = rows; + return this; + } + + public UserAuthLogListRspAllOfData addRowsItem(UserAuthLog rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * @return rows + **/ + @javax.annotation.Nonnull + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + + public UserAuthLogListRspAllOfData paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserAuthLogListRspAllOfData userAuthLogListRspAllOfData = (UserAuthLogListRspAllOfData) o; + return Objects.equals(this.rows, userAuthLogListRspAllOfData.rows) && + Objects.equals(this.paging, userAuthLogListRspAllOfData.paging); + } + + @Override + public int hashCode() { + return Objects.hash(rows, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserAuthLogListRspAllOfData {\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rows"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("rows"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserAuthLogListRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserAuthLogListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserAuthLogListRspAllOfData is not found in the empty JSON string", UserAuthLogListRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserAuthLogListRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserAuthLogListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserAuthLogListRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rows` to be an array in the JSON string but got `%s`", jsonObj.get("rows").toString())); + } + + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + // validate the required field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + UserAuthLog.validateJsonElement(jsonArrayrows.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserAuthLogListRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserAuthLogListRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserAuthLogListRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserAuthLogListRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserAuthLogListRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserAuthLogListRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserAuthLogListRspAllOfData + * @throws IOException if the JSON string is invalid with respect to UserAuthLogListRspAllOfData + */ + public static UserAuthLogListRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserAuthLogListRspAllOfData.class); + } + + /** + * Convert an instance of UserAuthLogListRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserCreateReq.java b/src/main/java/com/corbado/generated/model/UserCreateReq.java new file mode 100644 index 0000000..52f0391 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserCreateReq.java @@ -0,0 +1,361 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserCreateReq { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; + @SerializedName(SERIALIZED_NAME_FULL_NAME) + private String fullName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) + private String phoneNumber; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public UserCreateReq() { + } + + public UserCreateReq name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public UserCreateReq fullName(String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + **/ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + public UserCreateReq email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public UserCreateReq phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get phoneNumber + * @return phoneNumber + **/ + @javax.annotation.Nullable + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + + public UserCreateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public UserCreateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserCreateReq userCreateReq = (UserCreateReq) o; + return Objects.equals(this.name, userCreateReq.name) && + Objects.equals(this.fullName, userCreateReq.fullName) && + Objects.equals(this.email, userCreateReq.email) && + Objects.equals(this.phoneNumber, userCreateReq.phoneNumber) && + Objects.equals(this.requestID, userCreateReq.requestID) && + Objects.equals(this.clientInfo, userCreateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(name, fullName, email, phoneNumber, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserCreateReq {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("fullName"); + openapiFields.add("email"); + openapiFields.add("phoneNumber"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserCreateReq is not found in the empty JSON string", UserCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("phoneNumber") != null && !jsonObj.get("phoneNumber").isJsonNull()) && !jsonObj.get("phoneNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCreateReq + * @throws IOException if the JSON string is invalid with respect to UserCreateReq + */ + public static UserCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserCreateReq.class); + } + + /** + * Convert an instance of UserCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserCreateRsp.java b/src/main/java/com/corbado/generated/model/UserCreateRsp.java new file mode 100644 index 0000000..b59ed5e --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserCreateRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.UserCreateRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserCreateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserCreateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private UserCreateRspAllOfData data; + + public UserCreateRsp() { + } + + public UserCreateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public UserCreateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public UserCreateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public UserCreateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public UserCreateRsp data(UserCreateRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public UserCreateRspAllOfData getData() { + return data; + } + + public void setData(UserCreateRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserCreateRsp userCreateRsp = (UserCreateRsp) o; + return Objects.equals(this.httpStatusCode, userCreateRsp.httpStatusCode) && + Objects.equals(this.message, userCreateRsp.message) && + Objects.equals(this.requestData, userCreateRsp.requestData) && + Objects.equals(this.runtime, userCreateRsp.runtime) && + Objects.equals(this.data, userCreateRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserCreateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserCreateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserCreateRsp is not found in the empty JSON string", UserCreateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserCreateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserCreateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + UserCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserCreateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserCreateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserCreateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserCreateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserCreateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserCreateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCreateRsp + * @throws IOException if the JSON string is invalid with respect to UserCreateRsp + */ + public static UserCreateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserCreateRsp.class); + } + + /** + * Convert an instance of UserCreateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserCreateRspAllOfData.java new file mode 100644 index 0000000..de46f56 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserCreateRspAllOfData.java @@ -0,0 +1,274 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserCreateRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserCreateRspAllOfData { + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_EMAIL_I_D = "emailID"; + @SerializedName(SERIALIZED_NAME_EMAIL_I_D) + private String emailID; + + public static final String SERIALIZED_NAME_PHONE_NUMBER_I_D = "phoneNumberID"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER_I_D) + private String phoneNumberID; + + public UserCreateRspAllOfData() { + } + + public UserCreateRspAllOfData userID(String userID) { + this.userID = userID; + return this; + } + + /** + * Get userID + * @return userID + **/ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public UserCreateRspAllOfData emailID(String emailID) { + this.emailID = emailID; + return this; + } + + /** + * Get emailID + * @return emailID + **/ + @javax.annotation.Nonnull + public String getEmailID() { + return emailID; + } + + public void setEmailID(String emailID) { + this.emailID = emailID; + } + + + public UserCreateRspAllOfData phoneNumberID(String phoneNumberID) { + this.phoneNumberID = phoneNumberID; + return this; + } + + /** + * Get phoneNumberID + * @return phoneNumberID + **/ + @javax.annotation.Nonnull + public String getPhoneNumberID() { + return phoneNumberID; + } + + public void setPhoneNumberID(String phoneNumberID) { + this.phoneNumberID = phoneNumberID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserCreateRspAllOfData userCreateRspAllOfData = (UserCreateRspAllOfData) o; + return Objects.equals(this.userID, userCreateRspAllOfData.userID) && + Objects.equals(this.emailID, userCreateRspAllOfData.emailID) && + Objects.equals(this.phoneNumberID, userCreateRspAllOfData.phoneNumberID); + } + + @Override + public int hashCode() { + return Objects.hash(userID, emailID, phoneNumberID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserCreateRspAllOfData {\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" emailID: ").append(toIndentedString(emailID)).append("\n"); + sb.append(" phoneNumberID: ").append(toIndentedString(phoneNumberID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userID"); + openapiFields.add("emailID"); + openapiFields.add("phoneNumberID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("emailID"); + openapiRequiredFields.add("phoneNumberID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserCreateRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserCreateRspAllOfData is not found in the empty JSON string", UserCreateRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserCreateRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserCreateRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("emailID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `emailID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailID").toString())); + } + if (!jsonObj.get("phoneNumberID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phoneNumberID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumberID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserCreateRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserCreateRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserCreateRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserCreateRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserCreateRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCreateRspAllOfData + * @throws IOException if the JSON string is invalid with respect to UserCreateRspAllOfData + */ + public static UserCreateRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserCreateRspAllOfData.class); + } + + /** + * Convert an instance of UserCreateRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateReq.java b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateReq.java new file mode 100644 index 0000000..3740a3d --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateReq.java @@ -0,0 +1,303 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserCustomLoginIdentifierCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserCustomLoginIdentifierCreateReq { + public static final String SERIALIZED_NAME_CUSTOM_LOGIN_IDENTIFIER = "customLoginIdentifier"; + @SerializedName(SERIALIZED_NAME_CUSTOM_LOGIN_IDENTIFIER) + private String customLoginIdentifier; + + public static final String SERIALIZED_NAME_ADDITIONAL_DATA = "additionalData"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_DATA) + private String additionalData; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public UserCustomLoginIdentifierCreateReq() { + } + + public UserCustomLoginIdentifierCreateReq customLoginIdentifier(String customLoginIdentifier) { + this.customLoginIdentifier = customLoginIdentifier; + return this; + } + + /** + * Get customLoginIdentifier + * @return customLoginIdentifier + **/ + @javax.annotation.Nonnull + public String getCustomLoginIdentifier() { + return customLoginIdentifier; + } + + public void setCustomLoginIdentifier(String customLoginIdentifier) { + this.customLoginIdentifier = customLoginIdentifier; + } + + + public UserCustomLoginIdentifierCreateReq additionalData(String additionalData) { + this.additionalData = additionalData; + return this; + } + + /** + * Get additionalData + * @return additionalData + **/ + @javax.annotation.Nullable + public String getAdditionalData() { + return additionalData; + } + + public void setAdditionalData(String additionalData) { + this.additionalData = additionalData; + } + + + public UserCustomLoginIdentifierCreateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public UserCustomLoginIdentifierCreateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserCustomLoginIdentifierCreateReq userCustomLoginIdentifierCreateReq = (UserCustomLoginIdentifierCreateReq) o; + return Objects.equals(this.customLoginIdentifier, userCustomLoginIdentifierCreateReq.customLoginIdentifier) && + Objects.equals(this.additionalData, userCustomLoginIdentifierCreateReq.additionalData) && + Objects.equals(this.requestID, userCustomLoginIdentifierCreateReq.requestID) && + Objects.equals(this.clientInfo, userCustomLoginIdentifierCreateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(customLoginIdentifier, additionalData, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserCustomLoginIdentifierCreateReq {\n"); + sb.append(" customLoginIdentifier: ").append(toIndentedString(customLoginIdentifier)).append("\n"); + sb.append(" additionalData: ").append(toIndentedString(additionalData)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("customLoginIdentifier"); + openapiFields.add("additionalData"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("customLoginIdentifier"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserCustomLoginIdentifierCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserCustomLoginIdentifierCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserCustomLoginIdentifierCreateReq is not found in the empty JSON string", UserCustomLoginIdentifierCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserCustomLoginIdentifierCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCustomLoginIdentifierCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserCustomLoginIdentifierCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("customLoginIdentifier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customLoginIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customLoginIdentifier").toString())); + } + if ((jsonObj.get("additionalData") != null && !jsonObj.get("additionalData").isJsonNull()) && !jsonObj.get("additionalData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `additionalData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalData").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserCustomLoginIdentifierCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserCustomLoginIdentifierCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserCustomLoginIdentifierCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserCustomLoginIdentifierCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserCustomLoginIdentifierCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserCustomLoginIdentifierCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCustomLoginIdentifierCreateReq + * @throws IOException if the JSON string is invalid with respect to UserCustomLoginIdentifierCreateReq + */ + public static UserCustomLoginIdentifierCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserCustomLoginIdentifierCreateReq.class); + } + + /** + * Convert an instance of UserCustomLoginIdentifierCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRsp.java b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRsp.java new file mode 100644 index 0000000..e689e53 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.UserCustomLoginIdentifierCreateRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserCustomLoginIdentifierCreateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserCustomLoginIdentifierCreateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private UserCustomLoginIdentifierCreateRspAllOfData data; + + public UserCustomLoginIdentifierCreateRsp() { + } + + public UserCustomLoginIdentifierCreateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public UserCustomLoginIdentifierCreateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public UserCustomLoginIdentifierCreateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public UserCustomLoginIdentifierCreateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public UserCustomLoginIdentifierCreateRsp data(UserCustomLoginIdentifierCreateRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public UserCustomLoginIdentifierCreateRspAllOfData getData() { + return data; + } + + public void setData(UserCustomLoginIdentifierCreateRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserCustomLoginIdentifierCreateRsp userCustomLoginIdentifierCreateRsp = (UserCustomLoginIdentifierCreateRsp) o; + return Objects.equals(this.httpStatusCode, userCustomLoginIdentifierCreateRsp.httpStatusCode) && + Objects.equals(this.message, userCustomLoginIdentifierCreateRsp.message) && + Objects.equals(this.requestData, userCustomLoginIdentifierCreateRsp.requestData) && + Objects.equals(this.runtime, userCustomLoginIdentifierCreateRsp.runtime) && + Objects.equals(this.data, userCustomLoginIdentifierCreateRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserCustomLoginIdentifierCreateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserCustomLoginIdentifierCreateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserCustomLoginIdentifierCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserCustomLoginIdentifierCreateRsp is not found in the empty JSON string", UserCustomLoginIdentifierCreateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserCustomLoginIdentifierCreateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCustomLoginIdentifierCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserCustomLoginIdentifierCreateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + UserCustomLoginIdentifierCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserCustomLoginIdentifierCreateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserCustomLoginIdentifierCreateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserCustomLoginIdentifierCreateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserCustomLoginIdentifierCreateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserCustomLoginIdentifierCreateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserCustomLoginIdentifierCreateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCustomLoginIdentifierCreateRsp + * @throws IOException if the JSON string is invalid with respect to UserCustomLoginIdentifierCreateRsp + */ + public static UserCustomLoginIdentifierCreateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserCustomLoginIdentifierCreateRsp.class); + } + + /** + * Convert an instance of UserCustomLoginIdentifierCreateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRspAllOfData.java new file mode 100644 index 0000000..afe651a --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRspAllOfData.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserCustomLoginIdentifierCreateRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserCustomLoginIdentifierCreateRspAllOfData { + public static final String SERIALIZED_NAME_CUSTOM_LOGIN_IDENTIFIER_I_D = "customLoginIdentifierID"; + @SerializedName(SERIALIZED_NAME_CUSTOM_LOGIN_IDENTIFIER_I_D) + private String customLoginIdentifierID; + + public UserCustomLoginIdentifierCreateRspAllOfData() { + } + + public UserCustomLoginIdentifierCreateRspAllOfData customLoginIdentifierID(String customLoginIdentifierID) { + this.customLoginIdentifierID = customLoginIdentifierID; + return this; + } + + /** + * Get customLoginIdentifierID + * @return customLoginIdentifierID + **/ + @javax.annotation.Nonnull + public String getCustomLoginIdentifierID() { + return customLoginIdentifierID; + } + + public void setCustomLoginIdentifierID(String customLoginIdentifierID) { + this.customLoginIdentifierID = customLoginIdentifierID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserCustomLoginIdentifierCreateRspAllOfData userCustomLoginIdentifierCreateRspAllOfData = (UserCustomLoginIdentifierCreateRspAllOfData) o; + return Objects.equals(this.customLoginIdentifierID, userCustomLoginIdentifierCreateRspAllOfData.customLoginIdentifierID); + } + + @Override + public int hashCode() { + return Objects.hash(customLoginIdentifierID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserCustomLoginIdentifierCreateRspAllOfData {\n"); + sb.append(" customLoginIdentifierID: ").append(toIndentedString(customLoginIdentifierID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("customLoginIdentifierID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("customLoginIdentifierID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserCustomLoginIdentifierCreateRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserCustomLoginIdentifierCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserCustomLoginIdentifierCreateRspAllOfData is not found in the empty JSON string", UserCustomLoginIdentifierCreateRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserCustomLoginIdentifierCreateRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCustomLoginIdentifierCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserCustomLoginIdentifierCreateRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("customLoginIdentifierID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customLoginIdentifierID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customLoginIdentifierID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserCustomLoginIdentifierCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserCustomLoginIdentifierCreateRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserCustomLoginIdentifierCreateRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserCustomLoginIdentifierCreateRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserCustomLoginIdentifierCreateRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserCustomLoginIdentifierCreateRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCustomLoginIdentifierCreateRspAllOfData + * @throws IOException if the JSON string is invalid with respect to UserCustomLoginIdentifierCreateRspAllOfData + */ + public static UserCustomLoginIdentifierCreateRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserCustomLoginIdentifierCreateRspAllOfData.class); + } + + /** + * Convert an instance of UserCustomLoginIdentifierCreateRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierDeleteReq.java b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierDeleteReq.java new file mode 100644 index 0000000..8a6431c --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierDeleteReq.java @@ -0,0 +1,237 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserCustomLoginIdentifierDeleteReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserCustomLoginIdentifierDeleteReq { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public UserCustomLoginIdentifierDeleteReq() { + } + + public UserCustomLoginIdentifierDeleteReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public UserCustomLoginIdentifierDeleteReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserCustomLoginIdentifierDeleteReq userCustomLoginIdentifierDeleteReq = (UserCustomLoginIdentifierDeleteReq) o; + return Objects.equals(this.requestID, userCustomLoginIdentifierDeleteReq.requestID) && + Objects.equals(this.clientInfo, userCustomLoginIdentifierDeleteReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserCustomLoginIdentifierDeleteReq {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserCustomLoginIdentifierDeleteReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserCustomLoginIdentifierDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserCustomLoginIdentifierDeleteReq is not found in the empty JSON string", UserCustomLoginIdentifierDeleteReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserCustomLoginIdentifierDeleteReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCustomLoginIdentifierDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserCustomLoginIdentifierDeleteReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserCustomLoginIdentifierDeleteReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserCustomLoginIdentifierDeleteReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserCustomLoginIdentifierDeleteReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserCustomLoginIdentifierDeleteReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserCustomLoginIdentifierDeleteReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCustomLoginIdentifierDeleteReq + * @throws IOException if the JSON string is invalid with respect to UserCustomLoginIdentifierDeleteReq + */ + public static UserCustomLoginIdentifierDeleteReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserCustomLoginIdentifierDeleteReq.class); + } + + /** + * Convert an instance of UserCustomLoginIdentifierDeleteReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRsp.java b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRsp.java new file mode 100644 index 0000000..d70a853 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.UserCustomLoginIdentifierGetRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserCustomLoginIdentifierGetRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserCustomLoginIdentifierGetRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private UserCustomLoginIdentifierGetRspAllOfData data; + + public UserCustomLoginIdentifierGetRsp() { + } + + public UserCustomLoginIdentifierGetRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public UserCustomLoginIdentifierGetRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public UserCustomLoginIdentifierGetRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public UserCustomLoginIdentifierGetRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public UserCustomLoginIdentifierGetRsp data(UserCustomLoginIdentifierGetRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public UserCustomLoginIdentifierGetRspAllOfData getData() { + return data; + } + + public void setData(UserCustomLoginIdentifierGetRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserCustomLoginIdentifierGetRsp userCustomLoginIdentifierGetRsp = (UserCustomLoginIdentifierGetRsp) o; + return Objects.equals(this.httpStatusCode, userCustomLoginIdentifierGetRsp.httpStatusCode) && + Objects.equals(this.message, userCustomLoginIdentifierGetRsp.message) && + Objects.equals(this.requestData, userCustomLoginIdentifierGetRsp.requestData) && + Objects.equals(this.runtime, userCustomLoginIdentifierGetRsp.runtime) && + Objects.equals(this.data, userCustomLoginIdentifierGetRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserCustomLoginIdentifierGetRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserCustomLoginIdentifierGetRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserCustomLoginIdentifierGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserCustomLoginIdentifierGetRsp is not found in the empty JSON string", UserCustomLoginIdentifierGetRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserCustomLoginIdentifierGetRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCustomLoginIdentifierGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserCustomLoginIdentifierGetRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + UserCustomLoginIdentifierGetRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserCustomLoginIdentifierGetRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserCustomLoginIdentifierGetRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserCustomLoginIdentifierGetRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserCustomLoginIdentifierGetRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserCustomLoginIdentifierGetRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserCustomLoginIdentifierGetRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCustomLoginIdentifierGetRsp + * @throws IOException if the JSON string is invalid with respect to UserCustomLoginIdentifierGetRsp + */ + public static UserCustomLoginIdentifierGetRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserCustomLoginIdentifierGetRsp.class); + } + + /** + * Convert an instance of UserCustomLoginIdentifierGetRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRspAllOfData.java new file mode 100644 index 0000000..38e53c7 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRspAllOfData.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.CustomLoginIdentifier; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserCustomLoginIdentifierGetRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserCustomLoginIdentifierGetRspAllOfData { + public static final String SERIALIZED_NAME_CUSTOM_LOGIN_IDENTIFIER = "customLoginIdentifier"; + @SerializedName(SERIALIZED_NAME_CUSTOM_LOGIN_IDENTIFIER) + private CustomLoginIdentifier customLoginIdentifier; + + public UserCustomLoginIdentifierGetRspAllOfData() { + } + + public UserCustomLoginIdentifierGetRspAllOfData customLoginIdentifier(CustomLoginIdentifier customLoginIdentifier) { + this.customLoginIdentifier = customLoginIdentifier; + return this; + } + + /** + * Get customLoginIdentifier + * @return customLoginIdentifier + **/ + @javax.annotation.Nonnull + public CustomLoginIdentifier getCustomLoginIdentifier() { + return customLoginIdentifier; + } + + public void setCustomLoginIdentifier(CustomLoginIdentifier customLoginIdentifier) { + this.customLoginIdentifier = customLoginIdentifier; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserCustomLoginIdentifierGetRspAllOfData userCustomLoginIdentifierGetRspAllOfData = (UserCustomLoginIdentifierGetRspAllOfData) o; + return Objects.equals(this.customLoginIdentifier, userCustomLoginIdentifierGetRspAllOfData.customLoginIdentifier); + } + + @Override + public int hashCode() { + return Objects.hash(customLoginIdentifier); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserCustomLoginIdentifierGetRspAllOfData {\n"); + sb.append(" customLoginIdentifier: ").append(toIndentedString(customLoginIdentifier)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("customLoginIdentifier"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("customLoginIdentifier"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserCustomLoginIdentifierGetRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserCustomLoginIdentifierGetRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserCustomLoginIdentifierGetRspAllOfData is not found in the empty JSON string", UserCustomLoginIdentifierGetRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserCustomLoginIdentifierGetRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCustomLoginIdentifierGetRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserCustomLoginIdentifierGetRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `customLoginIdentifier` + CustomLoginIdentifier.validateJsonElement(jsonObj.get("customLoginIdentifier")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserCustomLoginIdentifierGetRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserCustomLoginIdentifierGetRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserCustomLoginIdentifierGetRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserCustomLoginIdentifierGetRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserCustomLoginIdentifierGetRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserCustomLoginIdentifierGetRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCustomLoginIdentifierGetRspAllOfData + * @throws IOException if the JSON string is invalid with respect to UserCustomLoginIdentifierGetRspAllOfData + */ + public static UserCustomLoginIdentifierGetRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserCustomLoginIdentifierGetRspAllOfData.class); + } + + /** + * Convert an instance of UserCustomLoginIdentifierGetRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserDeleteReq.java b/src/main/java/com/corbado/generated/model/UserDeleteReq.java new file mode 100644 index 0000000..d5c3975 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserDeleteReq.java @@ -0,0 +1,237 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserDeleteReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserDeleteReq { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public UserDeleteReq() { + } + + public UserDeleteReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public UserDeleteReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserDeleteReq userDeleteReq = (UserDeleteReq) o; + return Objects.equals(this.requestID, userDeleteReq.requestID) && + Objects.equals(this.clientInfo, userDeleteReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserDeleteReq {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserDeleteReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserDeleteReq is not found in the empty JSON string", UserDeleteReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserDeleteReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserDeleteReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserDeleteReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserDeleteReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserDeleteReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserDeleteReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserDeleteReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserDeleteReq + * @throws IOException if the JSON string is invalid with respect to UserDeleteReq + */ + public static UserDeleteReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserDeleteReq.class); + } + + /** + * Convert an instance of UserDeleteReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserDevice.java b/src/main/java/com/corbado/generated/model/UserDevice.java new file mode 100644 index 0000000..6ce1af3 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserDevice.java @@ -0,0 +1,454 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserDevice + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserDevice { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_FINGERPRINT = "fingerprint"; + @SerializedName(SERIALIZED_NAME_FINGERPRINT) + private String fingerprint; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_DEVICE = "device"; + @SerializedName(SERIALIZED_NAME_DEVICE) + private String device; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_BROWSER_NAME = "browserName"; + @SerializedName(SERIALIZED_NAME_BROWSER_NAME) + private String browserName; + + public static final String SERIALIZED_NAME_BROWSER_VERSION = "browserVersion"; + @SerializedName(SERIALIZED_NAME_BROWSER_VERSION) + private String browserVersion; + + public static final String SERIALIZED_NAME_OS_NAME = "osName"; + @SerializedName(SERIALIZED_NAME_OS_NAME) + private String osName; + + public static final String SERIALIZED_NAME_OS_VERSION = "osVersion"; + @SerializedName(SERIALIZED_NAME_OS_VERSION) + private String osVersion; + + public UserDevice() { + } + + public UserDevice name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public UserDevice fingerprint(String fingerprint) { + this.fingerprint = fingerprint; + return this; + } + + /** + * Get fingerprint + * @return fingerprint + **/ + @javax.annotation.Nonnull + public String getFingerprint() { + return fingerprint; + } + + public void setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + } + + + public UserDevice status(String status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + + public UserDevice device(String device) { + this.device = device; + return this; + } + + /** + * Get device + * @return device + **/ + @javax.annotation.Nonnull + public String getDevice() { + return device; + } + + public void setDevice(String device) { + this.device = device; + } + + + public UserDevice created(String created) { + this.created = created; + return this; + } + + /** + * Get created + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public UserDevice browserName(String browserName) { + this.browserName = browserName; + return this; + } + + /** + * Get browserName + * @return browserName + **/ + @javax.annotation.Nonnull + public String getBrowserName() { + return browserName; + } + + public void setBrowserName(String browserName) { + this.browserName = browserName; + } + + + public UserDevice browserVersion(String browserVersion) { + this.browserVersion = browserVersion; + return this; + } + + /** + * Get browserVersion + * @return browserVersion + **/ + @javax.annotation.Nonnull + public String getBrowserVersion() { + return browserVersion; + } + + public void setBrowserVersion(String browserVersion) { + this.browserVersion = browserVersion; + } + + + public UserDevice osName(String osName) { + this.osName = osName; + return this; + } + + /** + * Get osName + * @return osName + **/ + @javax.annotation.Nonnull + public String getOsName() { + return osName; + } + + public void setOsName(String osName) { + this.osName = osName; + } + + + public UserDevice osVersion(String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * Get osVersion + * @return osVersion + **/ + @javax.annotation.Nonnull + public String getOsVersion() { + return osVersion; + } + + public void setOsVersion(String osVersion) { + this.osVersion = osVersion; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserDevice userDevice = (UserDevice) o; + return Objects.equals(this.name, userDevice.name) && + Objects.equals(this.fingerprint, userDevice.fingerprint) && + Objects.equals(this.status, userDevice.status) && + Objects.equals(this.device, userDevice.device) && + Objects.equals(this.created, userDevice.created) && + Objects.equals(this.browserName, userDevice.browserName) && + Objects.equals(this.browserVersion, userDevice.browserVersion) && + Objects.equals(this.osName, userDevice.osName) && + Objects.equals(this.osVersion, userDevice.osVersion); + } + + @Override + public int hashCode() { + return Objects.hash(name, fingerprint, status, device, created, browserName, browserVersion, osName, osVersion); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserDevice {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" device: ").append(toIndentedString(device)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" browserName: ").append(toIndentedString(browserName)).append("\n"); + sb.append(" browserVersion: ").append(toIndentedString(browserVersion)).append("\n"); + sb.append(" osName: ").append(toIndentedString(osName)).append("\n"); + sb.append(" osVersion: ").append(toIndentedString(osVersion)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("fingerprint"); + openapiFields.add("status"); + openapiFields.add("device"); + openapiFields.add("created"); + openapiFields.add("browserName"); + openapiFields.add("browserVersion"); + openapiFields.add("osName"); + openapiFields.add("osVersion"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("fingerprint"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("device"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("browserName"); + openapiRequiredFields.add("browserVersion"); + openapiRequiredFields.add("osName"); + openapiRequiredFields.add("osVersion"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserDevice + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserDevice.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserDevice is not found in the empty JSON string", UserDevice.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserDevice.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserDevice` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserDevice.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("fingerprint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fingerprint").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if (!jsonObj.get("device").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `device` to be a primitive type in the JSON string but got `%s`", jsonObj.get("device").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("browserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `browserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("browserName").toString())); + } + if (!jsonObj.get("browserVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `browserVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("browserVersion").toString())); + } + if (!jsonObj.get("osName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `osName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osName").toString())); + } + if (!jsonObj.get("osVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `osVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osVersion").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserDevice.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserDevice' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserDevice.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserDevice value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserDevice read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserDevice given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserDevice + * @throws IOException if the JSON string is invalid with respect to UserDevice + */ + public static UserDevice fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserDevice.class); + } + + /** + * Convert an instance of UserDevice to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserDeviceListRsp.java b/src/main/java/com/corbado/generated/model/UserDeviceListRsp.java new file mode 100644 index 0000000..4a10311 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserDeviceListRsp.java @@ -0,0 +1,378 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.UserDevice; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserDeviceListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserDeviceListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DEVICES = "devices"; + @SerializedName(SERIALIZED_NAME_DEVICES) + private List devices = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public UserDeviceListRsp() { + } + + public UserDeviceListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public UserDeviceListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public UserDeviceListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public UserDeviceListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public UserDeviceListRsp devices(List devices) { + this.devices = devices; + return this; + } + + public UserDeviceListRsp addDevicesItem(UserDevice devicesItem) { + if (this.devices == null) { + this.devices = new ArrayList<>(); + } + this.devices.add(devicesItem); + return this; + } + + /** + * Get devices + * @return devices + **/ + @javax.annotation.Nonnull + public List getDevices() { + return devices; + } + + public void setDevices(List devices) { + this.devices = devices; + } + + + public UserDeviceListRsp paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserDeviceListRsp userDeviceListRsp = (UserDeviceListRsp) o; + return Objects.equals(this.httpStatusCode, userDeviceListRsp.httpStatusCode) && + Objects.equals(this.message, userDeviceListRsp.message) && + Objects.equals(this.requestData, userDeviceListRsp.requestData) && + Objects.equals(this.runtime, userDeviceListRsp.runtime) && + Objects.equals(this.devices, userDeviceListRsp.devices) && + Objects.equals(this.paging, userDeviceListRsp.paging); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, devices, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserDeviceListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" devices: ").append(toIndentedString(devices)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("devices"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("devices"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserDeviceListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserDeviceListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserDeviceListRsp is not found in the empty JSON string", UserDeviceListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserDeviceListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserDeviceListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserDeviceListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // ensure the json data is an array + if (!jsonObj.get("devices").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `devices` to be an array in the JSON string but got `%s`", jsonObj.get("devices").toString())); + } + + JsonArray jsonArraydevices = jsonObj.getAsJsonArray("devices"); + // validate the required field `devices` (array) + for (int i = 0; i < jsonArraydevices.size(); i++) { + UserDevice.validateJsonElement(jsonArraydevices.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserDeviceListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserDeviceListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserDeviceListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserDeviceListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserDeviceListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserDeviceListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserDeviceListRsp + * @throws IOException if the JSON string is invalid with respect to UserDeviceListRsp + */ + public static UserDeviceListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserDeviceListRsp.class); + } + + /** + * Convert an instance of UserDeviceListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserEmail.java b/src/main/java/com/corbado/generated/model/UserEmail.java new file mode 100644 index 0000000..966f1a3 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserEmail.java @@ -0,0 +1,334 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Status; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * User's email + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserEmail { + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + private String ID; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Status status; + + public UserEmail() { + } + + public UserEmail ID(String ID) { + this.ID = ID; + return this; + } + + /** + * generic ID + * @return ID + **/ + @javax.annotation.Nonnull + public String getID() { + return ID; + } + + public void setID(String ID) { + this.ID = ID; + } + + + public UserEmail email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public UserEmail created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public UserEmail updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + public UserEmail status(Status status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Status getStatus() { + return status; + } + + public void setStatus(Status status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserEmail userEmail = (UserEmail) o; + return Objects.equals(this.ID, userEmail.ID) && + Objects.equals(this.email, userEmail.email) && + Objects.equals(this.created, userEmail.created) && + Objects.equals(this.updated, userEmail.updated) && + Objects.equals(this.status, userEmail.status); + } + + @Override + public int hashCode() { + return Objects.hash(ID, email, created, updated, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserEmail {\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ID"); + openapiFields.add("email"); + openapiFields.add("created"); + openapiFields.add("updated"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ID"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserEmail + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserEmail.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserEmail is not found in the empty JSON string", UserEmail.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserEmail.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserEmail` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserEmail.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + // validate the required field `status` + Status.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserEmail.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserEmail' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserEmail.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserEmail value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserEmail read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserEmail given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserEmail + * @throws IOException if the JSON string is invalid with respect to UserEmail + */ + public static UserEmail fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserEmail.class); + } + + /** + * Convert an instance of UserEmail to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserEmailCreateReq.java b/src/main/java/com/corbado/generated/model/UserEmailCreateReq.java new file mode 100644 index 0000000..220de9d --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserEmailCreateReq.java @@ -0,0 +1,274 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserEmailCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserEmailCreateReq { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public UserEmailCreateReq() { + } + + public UserEmailCreateReq email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public UserEmailCreateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public UserEmailCreateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserEmailCreateReq userEmailCreateReq = (UserEmailCreateReq) o; + return Objects.equals(this.email, userEmailCreateReq.email) && + Objects.equals(this.requestID, userEmailCreateReq.requestID) && + Objects.equals(this.clientInfo, userEmailCreateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(email, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserEmailCreateReq {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("email"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("email"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserEmailCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserEmailCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserEmailCreateReq is not found in the empty JSON string", UserEmailCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserEmailCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserEmailCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserEmailCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserEmailCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserEmailCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserEmailCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserEmailCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserEmailCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserEmailCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserEmailCreateReq + * @throws IOException if the JSON string is invalid with respect to UserEmailCreateReq + */ + public static UserEmailCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserEmailCreateReq.class); + } + + /** + * Convert an instance of UserEmailCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserEmailCreateRsp.java b/src/main/java/com/corbado/generated/model/UserEmailCreateRsp.java new file mode 100644 index 0000000..3318f0e --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserEmailCreateRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.UserEmailCreateRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserEmailCreateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserEmailCreateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private UserEmailCreateRspAllOfData data; + + public UserEmailCreateRsp() { + } + + public UserEmailCreateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public UserEmailCreateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public UserEmailCreateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public UserEmailCreateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public UserEmailCreateRsp data(UserEmailCreateRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public UserEmailCreateRspAllOfData getData() { + return data; + } + + public void setData(UserEmailCreateRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserEmailCreateRsp userEmailCreateRsp = (UserEmailCreateRsp) o; + return Objects.equals(this.httpStatusCode, userEmailCreateRsp.httpStatusCode) && + Objects.equals(this.message, userEmailCreateRsp.message) && + Objects.equals(this.requestData, userEmailCreateRsp.requestData) && + Objects.equals(this.runtime, userEmailCreateRsp.runtime) && + Objects.equals(this.data, userEmailCreateRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserEmailCreateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserEmailCreateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserEmailCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserEmailCreateRsp is not found in the empty JSON string", UserEmailCreateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserEmailCreateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserEmailCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserEmailCreateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + UserEmailCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserEmailCreateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserEmailCreateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserEmailCreateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserEmailCreateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserEmailCreateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserEmailCreateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserEmailCreateRsp + * @throws IOException if the JSON string is invalid with respect to UserEmailCreateRsp + */ + public static UserEmailCreateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserEmailCreateRsp.class); + } + + /** + * Convert an instance of UserEmailCreateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserEmailCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserEmailCreateRspAllOfData.java new file mode 100644 index 0000000..317dc9f --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserEmailCreateRspAllOfData.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserEmailCreateRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserEmailCreateRspAllOfData { + public static final String SERIALIZED_NAME_EMAIL_I_D = "emailID"; + @SerializedName(SERIALIZED_NAME_EMAIL_I_D) + private String emailID; + + public UserEmailCreateRspAllOfData() { + } + + public UserEmailCreateRspAllOfData emailID(String emailID) { + this.emailID = emailID; + return this; + } + + /** + * Get emailID + * @return emailID + **/ + @javax.annotation.Nonnull + public String getEmailID() { + return emailID; + } + + public void setEmailID(String emailID) { + this.emailID = emailID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserEmailCreateRspAllOfData userEmailCreateRspAllOfData = (UserEmailCreateRspAllOfData) o; + return Objects.equals(this.emailID, userEmailCreateRspAllOfData.emailID); + } + + @Override + public int hashCode() { + return Objects.hash(emailID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserEmailCreateRspAllOfData {\n"); + sb.append(" emailID: ").append(toIndentedString(emailID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("emailID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("emailID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserEmailCreateRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserEmailCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserEmailCreateRspAllOfData is not found in the empty JSON string", UserEmailCreateRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserEmailCreateRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserEmailCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserEmailCreateRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("emailID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `emailID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserEmailCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserEmailCreateRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserEmailCreateRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserEmailCreateRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserEmailCreateRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserEmailCreateRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserEmailCreateRspAllOfData + * @throws IOException if the JSON string is invalid with respect to UserEmailCreateRspAllOfData + */ + public static UserEmailCreateRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserEmailCreateRspAllOfData.class); + } + + /** + * Convert an instance of UserEmailCreateRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserEmailDeleteReq.java b/src/main/java/com/corbado/generated/model/UserEmailDeleteReq.java new file mode 100644 index 0000000..e5b4047 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserEmailDeleteReq.java @@ -0,0 +1,237 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserEmailDeleteReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserEmailDeleteReq { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public UserEmailDeleteReq() { + } + + public UserEmailDeleteReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public UserEmailDeleteReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserEmailDeleteReq userEmailDeleteReq = (UserEmailDeleteReq) o; + return Objects.equals(this.requestID, userEmailDeleteReq.requestID) && + Objects.equals(this.clientInfo, userEmailDeleteReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserEmailDeleteReq {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserEmailDeleteReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserEmailDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserEmailDeleteReq is not found in the empty JSON string", UserEmailDeleteReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserEmailDeleteReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserEmailDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserEmailDeleteReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserEmailDeleteReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserEmailDeleteReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserEmailDeleteReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserEmailDeleteReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserEmailDeleteReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserEmailDeleteReq + * @throws IOException if the JSON string is invalid with respect to UserEmailDeleteReq + */ + public static UserEmailDeleteReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserEmailDeleteReq.class); + } + + /** + * Convert an instance of UserEmailDeleteReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserEmailGetRsp.java b/src/main/java/com/corbado/generated/model/UserEmailGetRsp.java new file mode 100644 index 0000000..3e25513 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserEmailGetRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.UserEmailGetRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserEmailGetRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserEmailGetRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private UserEmailGetRspAllOfData data; + + public UserEmailGetRsp() { + } + + public UserEmailGetRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public UserEmailGetRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public UserEmailGetRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public UserEmailGetRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public UserEmailGetRsp data(UserEmailGetRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public UserEmailGetRspAllOfData getData() { + return data; + } + + public void setData(UserEmailGetRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserEmailGetRsp userEmailGetRsp = (UserEmailGetRsp) o; + return Objects.equals(this.httpStatusCode, userEmailGetRsp.httpStatusCode) && + Objects.equals(this.message, userEmailGetRsp.message) && + Objects.equals(this.requestData, userEmailGetRsp.requestData) && + Objects.equals(this.runtime, userEmailGetRsp.runtime) && + Objects.equals(this.data, userEmailGetRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserEmailGetRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserEmailGetRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserEmailGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserEmailGetRsp is not found in the empty JSON string", UserEmailGetRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserEmailGetRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserEmailGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserEmailGetRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + UserEmailGetRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserEmailGetRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserEmailGetRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserEmailGetRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserEmailGetRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserEmailGetRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserEmailGetRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserEmailGetRsp + * @throws IOException if the JSON string is invalid with respect to UserEmailGetRsp + */ + public static UserEmailGetRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserEmailGetRsp.class); + } + + /** + * Convert an instance of UserEmailGetRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserEmailGetRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserEmailGetRspAllOfData.java new file mode 100644 index 0000000..2639a4b --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserEmailGetRspAllOfData.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Email; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserEmailGetRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserEmailGetRspAllOfData { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private Email email; + + public UserEmailGetRspAllOfData() { + } + + public UserEmailGetRspAllOfData email(Email email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @javax.annotation.Nonnull + public Email getEmail() { + return email; + } + + public void setEmail(Email email) { + this.email = email; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserEmailGetRspAllOfData userEmailGetRspAllOfData = (UserEmailGetRspAllOfData) o; + return Objects.equals(this.email, userEmailGetRspAllOfData.email); + } + + @Override + public int hashCode() { + return Objects.hash(email); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserEmailGetRspAllOfData {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("email"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserEmailGetRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserEmailGetRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserEmailGetRspAllOfData is not found in the empty JSON string", UserEmailGetRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserEmailGetRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserEmailGetRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserEmailGetRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `email` + Email.validateJsonElement(jsonObj.get("email")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserEmailGetRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserEmailGetRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserEmailGetRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserEmailGetRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserEmailGetRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserEmailGetRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserEmailGetRspAllOfData + * @throws IOException if the JSON string is invalid with respect to UserEmailGetRspAllOfData + */ + public static UserEmailGetRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserEmailGetRspAllOfData.class); + } + + /** + * Convert an instance of UserEmailGetRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserExistsReq.java b/src/main/java/com/corbado/generated/model/UserExistsReq.java new file mode 100644 index 0000000..99f53eb --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserExistsReq.java @@ -0,0 +1,304 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.corbado.generated.model.LoginIdentifierType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserExistsReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserExistsReq { + public static final String SERIALIZED_NAME_LOGIN_IDENTIFIER = "loginIdentifier"; + @SerializedName(SERIALIZED_NAME_LOGIN_IDENTIFIER) + private String loginIdentifier; + + public static final String SERIALIZED_NAME_LOGIN_IDENTIFIER_TYPE = "loginIdentifierType"; + @SerializedName(SERIALIZED_NAME_LOGIN_IDENTIFIER_TYPE) + private LoginIdentifierType loginIdentifierType; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public UserExistsReq() { + } + + public UserExistsReq loginIdentifier(String loginIdentifier) { + this.loginIdentifier = loginIdentifier; + return this; + } + + /** + * Get loginIdentifier + * @return loginIdentifier + **/ + @javax.annotation.Nonnull + public String getLoginIdentifier() { + return loginIdentifier; + } + + public void setLoginIdentifier(String loginIdentifier) { + this.loginIdentifier = loginIdentifier; + } + + + public UserExistsReq loginIdentifierType(LoginIdentifierType loginIdentifierType) { + this.loginIdentifierType = loginIdentifierType; + return this; + } + + /** + * Get loginIdentifierType + * @return loginIdentifierType + **/ + @javax.annotation.Nonnull + public LoginIdentifierType getLoginIdentifierType() { + return loginIdentifierType; + } + + public void setLoginIdentifierType(LoginIdentifierType loginIdentifierType) { + this.loginIdentifierType = loginIdentifierType; + } + + + public UserExistsReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public UserExistsReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserExistsReq userExistsReq = (UserExistsReq) o; + return Objects.equals(this.loginIdentifier, userExistsReq.loginIdentifier) && + Objects.equals(this.loginIdentifierType, userExistsReq.loginIdentifierType) && + Objects.equals(this.requestID, userExistsReq.requestID) && + Objects.equals(this.clientInfo, userExistsReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(loginIdentifier, loginIdentifierType, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserExistsReq {\n"); + sb.append(" loginIdentifier: ").append(toIndentedString(loginIdentifier)).append("\n"); + sb.append(" loginIdentifierType: ").append(toIndentedString(loginIdentifierType)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("loginIdentifier"); + openapiFields.add("loginIdentifierType"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("loginIdentifier"); + openapiRequiredFields.add("loginIdentifierType"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserExistsReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserExistsReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserExistsReq is not found in the empty JSON string", UserExistsReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserExistsReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserExistsReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserExistsReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("loginIdentifier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loginIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginIdentifier").toString())); + } + // validate the required field `loginIdentifierType` + LoginIdentifierType.validateJsonElement(jsonObj.get("loginIdentifierType")); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserExistsReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserExistsReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserExistsReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserExistsReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserExistsReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserExistsReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserExistsReq + * @throws IOException if the JSON string is invalid with respect to UserExistsReq + */ + public static UserExistsReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserExistsReq.class); + } + + /** + * Convert an instance of UserExistsReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserExistsRsp.java b/src/main/java/com/corbado/generated/model/UserExistsRsp.java new file mode 100644 index 0000000..a7d9548 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserExistsRsp.java @@ -0,0 +1,327 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserExistsRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserExistsRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_EXISTS = "exists"; + @SerializedName(SERIALIZED_NAME_EXISTS) + private Boolean exists; + + public UserExistsRsp() { + } + + public UserExistsRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public UserExistsRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public UserExistsRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public UserExistsRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public UserExistsRsp exists(Boolean exists) { + this.exists = exists; + return this; + } + + /** + * Get exists + * @return exists + **/ + @javax.annotation.Nonnull + public Boolean getExists() { + return exists; + } + + public void setExists(Boolean exists) { + this.exists = exists; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserExistsRsp userExistsRsp = (UserExistsRsp) o; + return Objects.equals(this.httpStatusCode, userExistsRsp.httpStatusCode) && + Objects.equals(this.message, userExistsRsp.message) && + Objects.equals(this.requestData, userExistsRsp.requestData) && + Objects.equals(this.runtime, userExistsRsp.runtime) && + Objects.equals(this.exists, userExistsRsp.exists); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, exists); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserExistsRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" exists: ").append(toIndentedString(exists)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("exists"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("exists"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserExistsRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserExistsRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserExistsRsp is not found in the empty JSON string", UserExistsRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserExistsRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserExistsRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserExistsRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserExistsRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserExistsRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserExistsRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserExistsRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserExistsRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserExistsRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserExistsRsp + * @throws IOException if the JSON string is invalid with respect to UserExistsRsp + */ + public static UserExistsRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserExistsRsp.class); + } + + /** + * Convert an instance of UserExistsRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserGetRsp.java b/src/main/java/com/corbado/generated/model/UserGetRsp.java new file mode 100644 index 0000000..fa6d3cc --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserGetRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.FullUser; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserGetRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserGetRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private FullUser data; + + public UserGetRsp() { + } + + public UserGetRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public UserGetRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public UserGetRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public UserGetRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public UserGetRsp data(FullUser data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public FullUser getData() { + return data; + } + + public void setData(FullUser data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserGetRsp userGetRsp = (UserGetRsp) o; + return Objects.equals(this.httpStatusCode, userGetRsp.httpStatusCode) && + Objects.equals(this.message, userGetRsp.message) && + Objects.equals(this.requestData, userGetRsp.requestData) && + Objects.equals(this.runtime, userGetRsp.runtime) && + Objects.equals(this.data, userGetRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserGetRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserGetRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserGetRsp is not found in the empty JSON string", UserGetRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserGetRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserGetRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + FullUser.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserGetRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserGetRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserGetRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserGetRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserGetRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserGetRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserGetRsp + * @throws IOException if the JSON string is invalid with respect to UserGetRsp + */ + public static UserGetRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserGetRsp.class); + } + + /** + * Convert an instance of UserGetRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserListRsp.java b/src/main/java/com/corbado/generated/model/UserListRsp.java new file mode 100644 index 0000000..a8ad760 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserListRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.UserListRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private UserListRspAllOfData data; + + public UserListRsp() { + } + + public UserListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public UserListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public UserListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public UserListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public UserListRsp data(UserListRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public UserListRspAllOfData getData() { + return data; + } + + public void setData(UserListRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserListRsp userListRsp = (UserListRsp) o; + return Objects.equals(this.httpStatusCode, userListRsp.httpStatusCode) && + Objects.equals(this.message, userListRsp.message) && + Objects.equals(this.requestData, userListRsp.requestData) && + Objects.equals(this.runtime, userListRsp.runtime) && + Objects.equals(this.data, userListRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserListRsp is not found in the empty JSON string", UserListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + UserListRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserListRsp + * @throws IOException if the JSON string is invalid with respect to UserListRsp + */ + public static UserListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserListRsp.class); + } + + /** + * Convert an instance of UserListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserListRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserListRspAllOfData.java new file mode 100644 index 0000000..560f5db --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserListRspAllOfData.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.FullUser; +import com.corbado.generated.model.Paging; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserListRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserListRspAllOfData { + public static final String SERIALIZED_NAME_USERS = "users"; + @SerializedName(SERIALIZED_NAME_USERS) + private List users = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public UserListRspAllOfData() { + } + + public UserListRspAllOfData users(List users) { + this.users = users; + return this; + } + + public UserListRspAllOfData addUsersItem(FullUser usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + return this; + } + + /** + * Get users + * @return users + **/ + @javax.annotation.Nonnull + public List getUsers() { + return users; + } + + public void setUsers(List users) { + this.users = users; + } + + + public UserListRspAllOfData paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserListRspAllOfData userListRspAllOfData = (UserListRspAllOfData) o; + return Objects.equals(this.users, userListRspAllOfData.users) && + Objects.equals(this.paging, userListRspAllOfData.paging); + } + + @Override + public int hashCode() { + return Objects.hash(users, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserListRspAllOfData {\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("users"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("users"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserListRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserListRspAllOfData is not found in the empty JSON string", UserListRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserListRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserListRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("users").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `users` to be an array in the JSON string but got `%s`", jsonObj.get("users").toString())); + } + + JsonArray jsonArrayusers = jsonObj.getAsJsonArray("users"); + // validate the required field `users` (array) + for (int i = 0; i < jsonArrayusers.size(); i++) { + FullUser.validateJsonElement(jsonArrayusers.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserListRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserListRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserListRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserListRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserListRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserListRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserListRspAllOfData + * @throws IOException if the JSON string is invalid with respect to UserListRspAllOfData + */ + public static UserListRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserListRspAllOfData.class); + } + + /** + * Convert an instance of UserListRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserPhoneNumber.java b/src/main/java/com/corbado/generated/model/UserPhoneNumber.java new file mode 100644 index 0000000..d60154a --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserPhoneNumber.java @@ -0,0 +1,334 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Status; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * User's phone number + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserPhoneNumber { + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + private String ID; + + public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) + private String phoneNumber; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Status status; + + public UserPhoneNumber() { + } + + public UserPhoneNumber ID(String ID) { + this.ID = ID; + return this; + } + + /** + * generic ID + * @return ID + **/ + @javax.annotation.Nonnull + public String getID() { + return ID; + } + + public void setID(String ID) { + this.ID = ID; + } + + + public UserPhoneNumber phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get phoneNumber + * @return phoneNumber + **/ + @javax.annotation.Nonnull + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + + public UserPhoneNumber created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public UserPhoneNumber updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + public UserPhoneNumber status(Status status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Status getStatus() { + return status; + } + + public void setStatus(Status status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserPhoneNumber userPhoneNumber = (UserPhoneNumber) o; + return Objects.equals(this.ID, userPhoneNumber.ID) && + Objects.equals(this.phoneNumber, userPhoneNumber.phoneNumber) && + Objects.equals(this.created, userPhoneNumber.created) && + Objects.equals(this.updated, userPhoneNumber.updated) && + Objects.equals(this.status, userPhoneNumber.status); + } + + @Override + public int hashCode() { + return Objects.hash(ID, phoneNumber, created, updated, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserPhoneNumber {\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ID"); + openapiFields.add("phoneNumber"); + openapiFields.add("created"); + openapiFields.add("updated"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ID"); + openapiRequiredFields.add("phoneNumber"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserPhoneNumber + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserPhoneNumber.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserPhoneNumber is not found in the empty JSON string", UserPhoneNumber.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserPhoneNumber.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserPhoneNumber` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserPhoneNumber.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (!jsonObj.get("phoneNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + // validate the required field `status` + Status.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserPhoneNumber.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserPhoneNumber' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserPhoneNumber.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserPhoneNumber value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserPhoneNumber read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserPhoneNumber given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserPhoneNumber + * @throws IOException if the JSON string is invalid with respect to UserPhoneNumber + */ + public static UserPhoneNumber fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserPhoneNumber.class); + } + + /** + * Convert an instance of UserPhoneNumber to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateReq.java b/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateReq.java new file mode 100644 index 0000000..a7a4b89 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateReq.java @@ -0,0 +1,274 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserPhoneNumberCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserPhoneNumberCreateReq { + public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) + private String phoneNumber; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public UserPhoneNumberCreateReq() { + } + + public UserPhoneNumberCreateReq phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get phoneNumber + * @return phoneNumber + **/ + @javax.annotation.Nonnull + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + + public UserPhoneNumberCreateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public UserPhoneNumberCreateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserPhoneNumberCreateReq userPhoneNumberCreateReq = (UserPhoneNumberCreateReq) o; + return Objects.equals(this.phoneNumber, userPhoneNumberCreateReq.phoneNumber) && + Objects.equals(this.requestID, userPhoneNumberCreateReq.requestID) && + Objects.equals(this.clientInfo, userPhoneNumberCreateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(phoneNumber, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserPhoneNumberCreateReq {\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("phoneNumber"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("phoneNumber"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserPhoneNumberCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserPhoneNumberCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserPhoneNumberCreateReq is not found in the empty JSON string", UserPhoneNumberCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserPhoneNumberCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserPhoneNumberCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserPhoneNumberCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("phoneNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserPhoneNumberCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserPhoneNumberCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserPhoneNumberCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserPhoneNumberCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserPhoneNumberCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserPhoneNumberCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserPhoneNumberCreateReq + * @throws IOException if the JSON string is invalid with respect to UserPhoneNumberCreateReq + */ + public static UserPhoneNumberCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserPhoneNumberCreateReq.class); + } + + /** + * Convert an instance of UserPhoneNumberCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRsp.java b/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRsp.java new file mode 100644 index 0000000..4ce19a6 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.UserPhoneNumberCreateRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserPhoneNumberCreateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserPhoneNumberCreateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private UserPhoneNumberCreateRspAllOfData data; + + public UserPhoneNumberCreateRsp() { + } + + public UserPhoneNumberCreateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public UserPhoneNumberCreateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public UserPhoneNumberCreateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public UserPhoneNumberCreateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public UserPhoneNumberCreateRsp data(UserPhoneNumberCreateRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public UserPhoneNumberCreateRspAllOfData getData() { + return data; + } + + public void setData(UserPhoneNumberCreateRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserPhoneNumberCreateRsp userPhoneNumberCreateRsp = (UserPhoneNumberCreateRsp) o; + return Objects.equals(this.httpStatusCode, userPhoneNumberCreateRsp.httpStatusCode) && + Objects.equals(this.message, userPhoneNumberCreateRsp.message) && + Objects.equals(this.requestData, userPhoneNumberCreateRsp.requestData) && + Objects.equals(this.runtime, userPhoneNumberCreateRsp.runtime) && + Objects.equals(this.data, userPhoneNumberCreateRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserPhoneNumberCreateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserPhoneNumberCreateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserPhoneNumberCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserPhoneNumberCreateRsp is not found in the empty JSON string", UserPhoneNumberCreateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserPhoneNumberCreateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserPhoneNumberCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserPhoneNumberCreateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + UserPhoneNumberCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserPhoneNumberCreateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserPhoneNumberCreateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserPhoneNumberCreateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserPhoneNumberCreateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserPhoneNumberCreateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserPhoneNumberCreateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserPhoneNumberCreateRsp + * @throws IOException if the JSON string is invalid with respect to UserPhoneNumberCreateRsp + */ + public static UserPhoneNumberCreateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserPhoneNumberCreateRsp.class); + } + + /** + * Convert an instance of UserPhoneNumberCreateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRspAllOfData.java new file mode 100644 index 0000000..4388bd9 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRspAllOfData.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserPhoneNumberCreateRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserPhoneNumberCreateRspAllOfData { + public static final String SERIALIZED_NAME_PHONE_NUMBER_I_D = "phoneNumberID"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER_I_D) + private String phoneNumberID; + + public UserPhoneNumberCreateRspAllOfData() { + } + + public UserPhoneNumberCreateRspAllOfData phoneNumberID(String phoneNumberID) { + this.phoneNumberID = phoneNumberID; + return this; + } + + /** + * Get phoneNumberID + * @return phoneNumberID + **/ + @javax.annotation.Nonnull + public String getPhoneNumberID() { + return phoneNumberID; + } + + public void setPhoneNumberID(String phoneNumberID) { + this.phoneNumberID = phoneNumberID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserPhoneNumberCreateRspAllOfData userPhoneNumberCreateRspAllOfData = (UserPhoneNumberCreateRspAllOfData) o; + return Objects.equals(this.phoneNumberID, userPhoneNumberCreateRspAllOfData.phoneNumberID); + } + + @Override + public int hashCode() { + return Objects.hash(phoneNumberID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserPhoneNumberCreateRspAllOfData {\n"); + sb.append(" phoneNumberID: ").append(toIndentedString(phoneNumberID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("phoneNumberID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("phoneNumberID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserPhoneNumberCreateRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserPhoneNumberCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserPhoneNumberCreateRspAllOfData is not found in the empty JSON string", UserPhoneNumberCreateRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserPhoneNumberCreateRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserPhoneNumberCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserPhoneNumberCreateRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("phoneNumberID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phoneNumberID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumberID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserPhoneNumberCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserPhoneNumberCreateRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserPhoneNumberCreateRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserPhoneNumberCreateRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserPhoneNumberCreateRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserPhoneNumberCreateRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserPhoneNumberCreateRspAllOfData + * @throws IOException if the JSON string is invalid with respect to UserPhoneNumberCreateRspAllOfData + */ + public static UserPhoneNumberCreateRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserPhoneNumberCreateRspAllOfData.class); + } + + /** + * Convert an instance of UserPhoneNumberCreateRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserPhoneNumberDeleteReq.java b/src/main/java/com/corbado/generated/model/UserPhoneNumberDeleteReq.java new file mode 100644 index 0000000..a5265bd --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserPhoneNumberDeleteReq.java @@ -0,0 +1,237 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserPhoneNumberDeleteReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserPhoneNumberDeleteReq { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public UserPhoneNumberDeleteReq() { + } + + public UserPhoneNumberDeleteReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public UserPhoneNumberDeleteReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserPhoneNumberDeleteReq userPhoneNumberDeleteReq = (UserPhoneNumberDeleteReq) o; + return Objects.equals(this.requestID, userPhoneNumberDeleteReq.requestID) && + Objects.equals(this.clientInfo, userPhoneNumberDeleteReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserPhoneNumberDeleteReq {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserPhoneNumberDeleteReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserPhoneNumberDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserPhoneNumberDeleteReq is not found in the empty JSON string", UserPhoneNumberDeleteReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserPhoneNumberDeleteReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserPhoneNumberDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserPhoneNumberDeleteReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserPhoneNumberDeleteReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserPhoneNumberDeleteReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserPhoneNumberDeleteReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserPhoneNumberDeleteReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserPhoneNumberDeleteReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserPhoneNumberDeleteReq + * @throws IOException if the JSON string is invalid with respect to UserPhoneNumberDeleteReq + */ + public static UserPhoneNumberDeleteReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserPhoneNumberDeleteReq.class); + } + + /** + * Convert an instance of UserPhoneNumberDeleteReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserPhoneNumberGetRsp.java b/src/main/java/com/corbado/generated/model/UserPhoneNumberGetRsp.java new file mode 100644 index 0000000..eb27924 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserPhoneNumberGetRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.UserPhoneNumberGetRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserPhoneNumberGetRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserPhoneNumberGetRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private UserPhoneNumberGetRspAllOfData data; + + public UserPhoneNumberGetRsp() { + } + + public UserPhoneNumberGetRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public UserPhoneNumberGetRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public UserPhoneNumberGetRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public UserPhoneNumberGetRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public UserPhoneNumberGetRsp data(UserPhoneNumberGetRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public UserPhoneNumberGetRspAllOfData getData() { + return data; + } + + public void setData(UserPhoneNumberGetRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserPhoneNumberGetRsp userPhoneNumberGetRsp = (UserPhoneNumberGetRsp) o; + return Objects.equals(this.httpStatusCode, userPhoneNumberGetRsp.httpStatusCode) && + Objects.equals(this.message, userPhoneNumberGetRsp.message) && + Objects.equals(this.requestData, userPhoneNumberGetRsp.requestData) && + Objects.equals(this.runtime, userPhoneNumberGetRsp.runtime) && + Objects.equals(this.data, userPhoneNumberGetRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserPhoneNumberGetRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserPhoneNumberGetRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserPhoneNumberGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserPhoneNumberGetRsp is not found in the empty JSON string", UserPhoneNumberGetRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserPhoneNumberGetRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserPhoneNumberGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserPhoneNumberGetRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + UserPhoneNumberGetRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserPhoneNumberGetRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserPhoneNumberGetRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserPhoneNumberGetRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserPhoneNumberGetRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserPhoneNumberGetRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserPhoneNumberGetRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserPhoneNumberGetRsp + * @throws IOException if the JSON string is invalid with respect to UserPhoneNumberGetRsp + */ + public static UserPhoneNumberGetRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserPhoneNumberGetRsp.class); + } + + /** + * Convert an instance of UserPhoneNumberGetRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserPhoneNumberGetRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserPhoneNumberGetRspAllOfData.java new file mode 100644 index 0000000..c44d487 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserPhoneNumberGetRspAllOfData.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.PhoneNumber; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserPhoneNumberGetRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserPhoneNumberGetRspAllOfData { + public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) + private PhoneNumber phoneNumber; + + public UserPhoneNumberGetRspAllOfData() { + } + + public UserPhoneNumberGetRspAllOfData phoneNumber(PhoneNumber phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get phoneNumber + * @return phoneNumber + **/ + @javax.annotation.Nonnull + public PhoneNumber getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(PhoneNumber phoneNumber) { + this.phoneNumber = phoneNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserPhoneNumberGetRspAllOfData userPhoneNumberGetRspAllOfData = (UserPhoneNumberGetRspAllOfData) o; + return Objects.equals(this.phoneNumber, userPhoneNumberGetRspAllOfData.phoneNumber); + } + + @Override + public int hashCode() { + return Objects.hash(phoneNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserPhoneNumberGetRspAllOfData {\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("phoneNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("phoneNumber"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserPhoneNumberGetRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserPhoneNumberGetRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserPhoneNumberGetRspAllOfData is not found in the empty JSON string", UserPhoneNumberGetRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserPhoneNumberGetRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserPhoneNumberGetRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserPhoneNumberGetRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `phoneNumber` + PhoneNumber.validateJsonElement(jsonObj.get("phoneNumber")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserPhoneNumberGetRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserPhoneNumberGetRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserPhoneNumberGetRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserPhoneNumberGetRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserPhoneNumberGetRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserPhoneNumberGetRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserPhoneNumberGetRspAllOfData + * @throws IOException if the JSON string is invalid with respect to UserPhoneNumberGetRspAllOfData + */ + public static UserPhoneNumberGetRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserPhoneNumberGetRspAllOfData.class); + } + + /** + * Convert an instance of UserPhoneNumberGetRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserSocialAccount.java b/src/main/java/com/corbado/generated/model/UserSocialAccount.java new file mode 100644 index 0000000..5e945e7 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserSocialAccount.java @@ -0,0 +1,304 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.SocialProviderType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * User's social account + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserSocialAccount { + public static final String SERIALIZED_NAME_PROVIDER_TYPE = "providerType"; + @SerializedName(SERIALIZED_NAME_PROVIDER_TYPE) + private SocialProviderType providerType; + + public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) + private String identifierValue; + + public static final String SERIALIZED_NAME_AVATAR_URL = "avatarUrl"; + @SerializedName(SERIALIZED_NAME_AVATAR_URL) + private String avatarUrl; + + public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; + @SerializedName(SERIALIZED_NAME_FULL_NAME) + private String fullName; + + public UserSocialAccount() { + } + + public UserSocialAccount providerType(SocialProviderType providerType) { + this.providerType = providerType; + return this; + } + + /** + * Get providerType + * @return providerType + **/ + @javax.annotation.Nonnull + public SocialProviderType getProviderType() { + return providerType; + } + + public void setProviderType(SocialProviderType providerType) { + this.providerType = providerType; + } + + + public UserSocialAccount identifierValue(String identifierValue) { + this.identifierValue = identifierValue; + return this; + } + + /** + * Get identifierValue + * @return identifierValue + **/ + @javax.annotation.Nonnull + public String getIdentifierValue() { + return identifierValue; + } + + public void setIdentifierValue(String identifierValue) { + this.identifierValue = identifierValue; + } + + + public UserSocialAccount avatarUrl(String avatarUrl) { + this.avatarUrl = avatarUrl; + return this; + } + + /** + * Get avatarUrl + * @return avatarUrl + **/ + @javax.annotation.Nonnull + public String getAvatarUrl() { + return avatarUrl; + } + + public void setAvatarUrl(String avatarUrl) { + this.avatarUrl = avatarUrl; + } + + + public UserSocialAccount fullName(String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + **/ + @javax.annotation.Nonnull + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserSocialAccount userSocialAccount = (UserSocialAccount) o; + return Objects.equals(this.providerType, userSocialAccount.providerType) && + Objects.equals(this.identifierValue, userSocialAccount.identifierValue) && + Objects.equals(this.avatarUrl, userSocialAccount.avatarUrl) && + Objects.equals(this.fullName, userSocialAccount.fullName); + } + + @Override + public int hashCode() { + return Objects.hash(providerType, identifierValue, avatarUrl, fullName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserSocialAccount {\n"); + sb.append(" providerType: ").append(toIndentedString(providerType)).append("\n"); + sb.append(" identifierValue: ").append(toIndentedString(identifierValue)).append("\n"); + sb.append(" avatarUrl: ").append(toIndentedString(avatarUrl)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("providerType"); + openapiFields.add("identifierValue"); + openapiFields.add("avatarUrl"); + openapiFields.add("fullName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("providerType"); + openapiRequiredFields.add("identifierValue"); + openapiRequiredFields.add("avatarUrl"); + openapiRequiredFields.add("fullName"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserSocialAccount + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserSocialAccount.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserSocialAccount is not found in the empty JSON string", UserSocialAccount.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserSocialAccount.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserSocialAccount` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserSocialAccount.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `providerType` + SocialProviderType.validateJsonElement(jsonObj.get("providerType")); + if (!jsonObj.get("identifierValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identifierValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifierValue").toString())); + } + if (!jsonObj.get("avatarUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `avatarUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avatarUrl").toString())); + } + if (!jsonObj.get("fullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserSocialAccount.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserSocialAccount' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserSocialAccount.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserSocialAccount value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserSocialAccount read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserSocialAccount given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserSocialAccount + * @throws IOException if the JSON string is invalid with respect to UserSocialAccount + */ + public static UserSocialAccount fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserSocialAccount.class); + } + + /** + * Convert an instance of UserSocialAccount to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserStats.java b/src/main/java/com/corbado/generated/model/UserStats.java new file mode 100644 index 0000000..a821fe6 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserStats.java @@ -0,0 +1,430 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserStats + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserStats { + public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; + @SerializedName(SERIALIZED_NAME_TIME_POINT) + private String timePoint; + + public static final String SERIALIZED_NAME_TOTAL_USERS = "totalUsers"; + @SerializedName(SERIALIZED_NAME_TOTAL_USERS) + private Integer totalUsers; + + public static final String SERIALIZED_NAME_SIGN_UPS = "signUps"; + @SerializedName(SERIALIZED_NAME_SIGN_UPS) + private Integer signUps; + + public static final String SERIALIZED_NAME_ACTIVE_USERS = "activeUsers"; + @SerializedName(SERIALIZED_NAME_ACTIVE_USERS) + private Integer activeUsers; + + public static final String SERIALIZED_NAME_COUNT_PASSKEY_LOGIN = "countPasskeyLogin"; + @SerializedName(SERIALIZED_NAME_COUNT_PASSKEY_LOGIN) + private Integer countPasskeyLogin; + + public static final String SERIALIZED_NAME_COUNT_EMAIL_LOGIN = "countEmailLogin"; + @SerializedName(SERIALIZED_NAME_COUNT_EMAIL_LOGIN) + private Integer countEmailLogin; + + public static final String SERIALIZED_NAME_COUNT_PASSWORD_LOGIN = "countPasswordLogin"; + @SerializedName(SERIALIZED_NAME_COUNT_PASSWORD_LOGIN) + private Integer countPasswordLogin; + + public static final String SERIALIZED_NAME_SUCCESSFUL_LOGINS = "successfulLogins"; + @SerializedName(SERIALIZED_NAME_SUCCESSFUL_LOGINS) + private Integer successfulLogins; + + public static final String SERIALIZED_NAME_FAILED_LOGINS = "failedLogins"; + @SerializedName(SERIALIZED_NAME_FAILED_LOGINS) + private Integer failedLogins; + + public UserStats() { + } + + public UserStats timePoint(String timePoint) { + this.timePoint = timePoint; + return this; + } + + /** + * Get timePoint + * @return timePoint + **/ + @javax.annotation.Nonnull + public String getTimePoint() { + return timePoint; + } + + public void setTimePoint(String timePoint) { + this.timePoint = timePoint; + } + + + public UserStats totalUsers(Integer totalUsers) { + this.totalUsers = totalUsers; + return this; + } + + /** + * Get totalUsers + * @return totalUsers + **/ + @javax.annotation.Nonnull + public Integer getTotalUsers() { + return totalUsers; + } + + public void setTotalUsers(Integer totalUsers) { + this.totalUsers = totalUsers; + } + + + public UserStats signUps(Integer signUps) { + this.signUps = signUps; + return this; + } + + /** + * Get signUps + * @return signUps + **/ + @javax.annotation.Nonnull + public Integer getSignUps() { + return signUps; + } + + public void setSignUps(Integer signUps) { + this.signUps = signUps; + } + + + public UserStats activeUsers(Integer activeUsers) { + this.activeUsers = activeUsers; + return this; + } + + /** + * Get activeUsers + * @return activeUsers + **/ + @javax.annotation.Nonnull + public Integer getActiveUsers() { + return activeUsers; + } + + public void setActiveUsers(Integer activeUsers) { + this.activeUsers = activeUsers; + } + + + public UserStats countPasskeyLogin(Integer countPasskeyLogin) { + this.countPasskeyLogin = countPasskeyLogin; + return this; + } + + /** + * Get countPasskeyLogin + * @return countPasskeyLogin + **/ + @javax.annotation.Nonnull + public Integer getCountPasskeyLogin() { + return countPasskeyLogin; + } + + public void setCountPasskeyLogin(Integer countPasskeyLogin) { + this.countPasskeyLogin = countPasskeyLogin; + } + + + public UserStats countEmailLogin(Integer countEmailLogin) { + this.countEmailLogin = countEmailLogin; + return this; + } + + /** + * Get countEmailLogin + * @return countEmailLogin + **/ + @javax.annotation.Nonnull + public Integer getCountEmailLogin() { + return countEmailLogin; + } + + public void setCountEmailLogin(Integer countEmailLogin) { + this.countEmailLogin = countEmailLogin; + } + + + public UserStats countPasswordLogin(Integer countPasswordLogin) { + this.countPasswordLogin = countPasswordLogin; + return this; + } + + /** + * Get countPasswordLogin + * @return countPasswordLogin + **/ + @javax.annotation.Nonnull + public Integer getCountPasswordLogin() { + return countPasswordLogin; + } + + public void setCountPasswordLogin(Integer countPasswordLogin) { + this.countPasswordLogin = countPasswordLogin; + } + + + public UserStats successfulLogins(Integer successfulLogins) { + this.successfulLogins = successfulLogins; + return this; + } + + /** + * Get successfulLogins + * @return successfulLogins + **/ + @javax.annotation.Nonnull + public Integer getSuccessfulLogins() { + return successfulLogins; + } + + public void setSuccessfulLogins(Integer successfulLogins) { + this.successfulLogins = successfulLogins; + } + + + public UserStats failedLogins(Integer failedLogins) { + this.failedLogins = failedLogins; + return this; + } + + /** + * Get failedLogins + * @return failedLogins + **/ + @javax.annotation.Nonnull + public Integer getFailedLogins() { + return failedLogins; + } + + public void setFailedLogins(Integer failedLogins) { + this.failedLogins = failedLogins; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserStats userStats = (UserStats) o; + return Objects.equals(this.timePoint, userStats.timePoint) && + Objects.equals(this.totalUsers, userStats.totalUsers) && + Objects.equals(this.signUps, userStats.signUps) && + Objects.equals(this.activeUsers, userStats.activeUsers) && + Objects.equals(this.countPasskeyLogin, userStats.countPasskeyLogin) && + Objects.equals(this.countEmailLogin, userStats.countEmailLogin) && + Objects.equals(this.countPasswordLogin, userStats.countPasswordLogin) && + Objects.equals(this.successfulLogins, userStats.successfulLogins) && + Objects.equals(this.failedLogins, userStats.failedLogins); + } + + @Override + public int hashCode() { + return Objects.hash(timePoint, totalUsers, signUps, activeUsers, countPasskeyLogin, countEmailLogin, countPasswordLogin, successfulLogins, failedLogins); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserStats {\n"); + sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); + sb.append(" totalUsers: ").append(toIndentedString(totalUsers)).append("\n"); + sb.append(" signUps: ").append(toIndentedString(signUps)).append("\n"); + sb.append(" activeUsers: ").append(toIndentedString(activeUsers)).append("\n"); + sb.append(" countPasskeyLogin: ").append(toIndentedString(countPasskeyLogin)).append("\n"); + sb.append(" countEmailLogin: ").append(toIndentedString(countEmailLogin)).append("\n"); + sb.append(" countPasswordLogin: ").append(toIndentedString(countPasswordLogin)).append("\n"); + sb.append(" successfulLogins: ").append(toIndentedString(successfulLogins)).append("\n"); + sb.append(" failedLogins: ").append(toIndentedString(failedLogins)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("timePoint"); + openapiFields.add("totalUsers"); + openapiFields.add("signUps"); + openapiFields.add("activeUsers"); + openapiFields.add("countPasskeyLogin"); + openapiFields.add("countEmailLogin"); + openapiFields.add("countPasswordLogin"); + openapiFields.add("successfulLogins"); + openapiFields.add("failedLogins"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("timePoint"); + openapiRequiredFields.add("totalUsers"); + openapiRequiredFields.add("signUps"); + openapiRequiredFields.add("activeUsers"); + openapiRequiredFields.add("countPasskeyLogin"); + openapiRequiredFields.add("countEmailLogin"); + openapiRequiredFields.add("countPasswordLogin"); + openapiRequiredFields.add("successfulLogins"); + openapiRequiredFields.add("failedLogins"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserStats + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserStats is not found in the empty JSON string", UserStats.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserStats.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserStats` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserStats.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("timePoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserStats.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserStats' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserStats.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserStats value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserStats read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserStats given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserStats + * @throws IOException if the JSON string is invalid with respect to UserStats + */ + public static UserStats fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserStats.class); + } + + /** + * Convert an instance of UserStats to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserStatsListRsp.java b/src/main/java/com/corbado/generated/model/UserStatsListRsp.java new file mode 100644 index 0000000..c0ab5d5 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserStatsListRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.UserStatsListRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserStatsListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserStatsListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private UserStatsListRspAllOfData data; + + public UserStatsListRsp() { + } + + public UserStatsListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public UserStatsListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public UserStatsListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public UserStatsListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public UserStatsListRsp data(UserStatsListRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public UserStatsListRspAllOfData getData() { + return data; + } + + public void setData(UserStatsListRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserStatsListRsp userStatsListRsp = (UserStatsListRsp) o; + return Objects.equals(this.httpStatusCode, userStatsListRsp.httpStatusCode) && + Objects.equals(this.message, userStatsListRsp.message) && + Objects.equals(this.requestData, userStatsListRsp.requestData) && + Objects.equals(this.runtime, userStatsListRsp.runtime) && + Objects.equals(this.data, userStatsListRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserStatsListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserStatsListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserStatsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserStatsListRsp is not found in the empty JSON string", UserStatsListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserStatsListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserStatsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserStatsListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + UserStatsListRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserStatsListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserStatsListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserStatsListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserStatsListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserStatsListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserStatsListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserStatsListRsp + * @throws IOException if the JSON string is invalid with respect to UserStatsListRsp + */ + public static UserStatsListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserStatsListRsp.class); + } + + /** + * Convert an instance of UserStatsListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserStatsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserStatsListRspAllOfData.java new file mode 100644 index 0000000..fa26939 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserStatsListRspAllOfData.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.UserStats; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserStatsListRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserStatsListRspAllOfData { + public static final String SERIALIZED_NAME_STATS = "stats"; + @SerializedName(SERIALIZED_NAME_STATS) + private List stats = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public UserStatsListRspAllOfData() { + } + + public UserStatsListRspAllOfData stats(List stats) { + this.stats = stats; + return this; + } + + public UserStatsListRspAllOfData addStatsItem(UserStats statsItem) { + if (this.stats == null) { + this.stats = new ArrayList<>(); + } + this.stats.add(statsItem); + return this; + } + + /** + * Get stats + * @return stats + **/ + @javax.annotation.Nonnull + public List getStats() { + return stats; + } + + public void setStats(List stats) { + this.stats = stats; + } + + + public UserStatsListRspAllOfData paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserStatsListRspAllOfData userStatsListRspAllOfData = (UserStatsListRspAllOfData) o; + return Objects.equals(this.stats, userStatsListRspAllOfData.stats) && + Objects.equals(this.paging, userStatsListRspAllOfData.paging); + } + + @Override + public int hashCode() { + return Objects.hash(stats, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserStatsListRspAllOfData {\n"); + sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stats"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("stats"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserStatsListRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserStatsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserStatsListRspAllOfData is not found in the empty JSON string", UserStatsListRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserStatsListRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserStatsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserStatsListRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("stats").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); + } + + JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); + // validate the required field `stats` (array) + for (int i = 0; i < jsonArraystats.size(); i++) { + UserStats.validateJsonElement(jsonArraystats.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserStatsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserStatsListRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserStatsListRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserStatsListRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserStatsListRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserStatsListRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserStatsListRspAllOfData + * @throws IOException if the JSON string is invalid with respect to UserStatsListRspAllOfData + */ + public static UserStatsListRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserStatsListRspAllOfData.class); + } + + /** + * Convert an instance of UserStatsListRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserUpdateReq.java b/src/main/java/com/corbado/generated/model/UserUpdateReq.java new file mode 100644 index 0000000..f4965c4 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserUpdateReq.java @@ -0,0 +1,380 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserUpdateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserUpdateReq { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; + @SerializedName(SERIALIZED_NAME_FULL_NAME) + private String fullName; + + /** + * Gets or Sets status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACTIVE("active"), + + DISABLED("disabled"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public UserUpdateReq() { + } + + public UserUpdateReq name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public UserUpdateReq fullName(String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + **/ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + public UserUpdateReq status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nullable + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public UserUpdateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public UserUpdateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserUpdateReq userUpdateReq = (UserUpdateReq) o; + return Objects.equals(this.name, userUpdateReq.name) && + Objects.equals(this.fullName, userUpdateReq.fullName) && + Objects.equals(this.status, userUpdateReq.status) && + Objects.equals(this.requestID, userUpdateReq.requestID) && + Objects.equals(this.clientInfo, userUpdateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(name, fullName, status, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserUpdateReq {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("fullName"); + openapiFields.add("status"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserUpdateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserUpdateReq is not found in the empty JSON string", UserUpdateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserUpdateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the optional field `status` + if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserUpdateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserUpdateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserUpdateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserUpdateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserUpdateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserUpdateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserUpdateReq + * @throws IOException if the JSON string is invalid with respect to UserUpdateReq + */ + public static UserUpdateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserUpdateReq.class); + } + + /** + * Convert an instance of UserUpdateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserUpdateRsp.java b/src/main/java/com/corbado/generated/model/UserUpdateRsp.java new file mode 100644 index 0000000..8eccc1b --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserUpdateRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.User; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * UserUpdateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserUpdateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private User data; + + public UserUpdateRsp() { + } + + public UserUpdateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public UserUpdateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public UserUpdateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public UserUpdateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public UserUpdateRsp data(User data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public User getData() { + return data; + } + + public void setData(User data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserUpdateRsp userUpdateRsp = (UserUpdateRsp) o; + return Objects.equals(this.httpStatusCode, userUpdateRsp.httpStatusCode) && + Objects.equals(this.message, userUpdateRsp.message) && + Objects.equals(this.requestData, userUpdateRsp.requestData) && + Objects.equals(this.runtime, userUpdateRsp.runtime) && + Objects.equals(this.data, userUpdateRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserUpdateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserUpdateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserUpdateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserUpdateRsp is not found in the empty JSON string", UserUpdateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserUpdateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserUpdateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserUpdateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + User.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserUpdateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserUpdateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserUpdateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserUpdateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserUpdateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserUpdateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserUpdateRsp + * @throws IOException if the JSON string is invalid with respect to UserUpdateRsp + */ + public static UserUpdateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserUpdateRsp.class); + } + + /** + * Convert an instance of UserUpdateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserUsername.java b/src/main/java/com/corbado/generated/model/UserUsername.java new file mode 100644 index 0000000..e7a2aa1 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserUsername.java @@ -0,0 +1,334 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Status; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * User's username + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class UserUsername { + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + private String ID; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Status status; + + public UserUsername() { + } + + public UserUsername ID(String ID) { + this.ID = ID; + return this; + } + + /** + * generic ID + * @return ID + **/ + @javax.annotation.Nonnull + public String getID() { + return ID; + } + + public void setID(String ID) { + this.ID = ID; + } + + + public UserUsername username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + public UserUsername created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public UserUsername updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + public UserUsername status(Status status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Status getStatus() { + return status; + } + + public void setStatus(Status status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserUsername userUsername = (UserUsername) o; + return Objects.equals(this.ID, userUsername.ID) && + Objects.equals(this.username, userUsername.username) && + Objects.equals(this.created, userUsername.created) && + Objects.equals(this.updated, userUsername.updated) && + Objects.equals(this.status, userUsername.status); + } + + @Override + public int hashCode() { + return Objects.hash(ID, username, created, updated, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserUsername {\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ID"); + openapiFields.add("username"); + openapiFields.add("created"); + openapiFields.add("updated"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ID"); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserUsername + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserUsername.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserUsername is not found in the empty JSON string", UserUsername.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserUsername.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserUsername` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserUsername.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("ID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + // validate the required field `status` + Status.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserUsername.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserUsername' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserUsername.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UserUsername value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserUsername read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserUsername given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserUsername + * @throws IOException if the JSON string is invalid with respect to UserUsername + */ + public static UserUsername fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserUsername.class); + } + + /** + * Convert an instance of UserUsername to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ValidateEmailReq.java b/src/main/java/com/corbado/generated/model/ValidateEmailReq.java new file mode 100644 index 0000000..4c5a36e --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ValidateEmailReq.java @@ -0,0 +1,326 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ValidateEmailReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ValidateEmailReq { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_SMTP_CHECK = "smtpCheck"; + @SerializedName(SERIALIZED_NAME_SMTP_CHECK) + private Boolean smtpCheck; + + public static final String SERIALIZED_NAME_SUGGEST_DOMAIN = "suggestDomain"; + @SerializedName(SERIALIZED_NAME_SUGGEST_DOMAIN) + private Boolean suggestDomain; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public ValidateEmailReq() { + } + + public ValidateEmailReq email(String email) { + this.email = email; + return this; + } + + /** + * Email to validate + * @return email + **/ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public ValidateEmailReq smtpCheck(Boolean smtpCheck) { + this.smtpCheck = smtpCheck; + return this; + } + + /** + * perform SMTP check for domain + * @return smtpCheck + **/ + @javax.annotation.Nullable + public Boolean getSmtpCheck() { + return smtpCheck; + } + + public void setSmtpCheck(Boolean smtpCheck) { + this.smtpCheck = smtpCheck; + } + + + public ValidateEmailReq suggestDomain(Boolean suggestDomain) { + this.suggestDomain = suggestDomain; + return this; + } + + /** + * enables domain suggestion for misspelled domains + * @return suggestDomain + **/ + @javax.annotation.Nullable + public Boolean getSuggestDomain() { + return suggestDomain; + } + + public void setSuggestDomain(Boolean suggestDomain) { + this.suggestDomain = suggestDomain; + } + + + public ValidateEmailReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public ValidateEmailReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidateEmailReq validateEmailReq = (ValidateEmailReq) o; + return Objects.equals(this.email, validateEmailReq.email) && + Objects.equals(this.smtpCheck, validateEmailReq.smtpCheck) && + Objects.equals(this.suggestDomain, validateEmailReq.suggestDomain) && + Objects.equals(this.requestID, validateEmailReq.requestID) && + Objects.equals(this.clientInfo, validateEmailReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(email, smtpCheck, suggestDomain, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidateEmailReq {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" smtpCheck: ").append(toIndentedString(smtpCheck)).append("\n"); + sb.append(" suggestDomain: ").append(toIndentedString(suggestDomain)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("email"); + openapiFields.add("smtpCheck"); + openapiFields.add("suggestDomain"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("email"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ValidateEmailReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ValidateEmailReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ValidateEmailReq is not found in the empty JSON string", ValidateEmailReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ValidateEmailReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidateEmailReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ValidateEmailReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ValidateEmailReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ValidateEmailReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ValidateEmailReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ValidateEmailReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ValidateEmailReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ValidateEmailReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of ValidateEmailReq + * @throws IOException if the JSON string is invalid with respect to ValidateEmailReq + */ + public static ValidateEmailReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ValidateEmailReq.class); + } + + /** + * Convert an instance of ValidateEmailReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ValidateEmailRsp.java b/src/main/java/com/corbado/generated/model/ValidateEmailRsp.java new file mode 100644 index 0000000..717ff59 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ValidateEmailRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.EmailValidationResult; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ValidateEmailRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ValidateEmailRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private EmailValidationResult data; + + public ValidateEmailRsp() { + } + + public ValidateEmailRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public ValidateEmailRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public ValidateEmailRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public ValidateEmailRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public ValidateEmailRsp data(EmailValidationResult data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public EmailValidationResult getData() { + return data; + } + + public void setData(EmailValidationResult data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidateEmailRsp validateEmailRsp = (ValidateEmailRsp) o; + return Objects.equals(this.httpStatusCode, validateEmailRsp.httpStatusCode) && + Objects.equals(this.message, validateEmailRsp.message) && + Objects.equals(this.requestData, validateEmailRsp.requestData) && + Objects.equals(this.runtime, validateEmailRsp.runtime) && + Objects.equals(this.data, validateEmailRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidateEmailRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ValidateEmailRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ValidateEmailRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ValidateEmailRsp is not found in the empty JSON string", ValidateEmailRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ValidateEmailRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidateEmailRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ValidateEmailRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + EmailValidationResult.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ValidateEmailRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ValidateEmailRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ValidateEmailRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ValidateEmailRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ValidateEmailRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ValidateEmailRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of ValidateEmailRsp + * @throws IOException if the JSON string is invalid with respect to ValidateEmailRsp + */ + public static ValidateEmailRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ValidateEmailRsp.class); + } + + /** + * Convert an instance of ValidateEmailRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ValidatePhoneNumberReq.java b/src/main/java/com/corbado/generated/model/ValidatePhoneNumberReq.java new file mode 100644 index 0000000..21fbe91 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ValidatePhoneNumberReq.java @@ -0,0 +1,303 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ValidatePhoneNumberReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ValidatePhoneNumberReq { + public static final String SERIALIZED_NAME_REGION_CODE = "regionCode"; + @SerializedName(SERIALIZED_NAME_REGION_CODE) + private String regionCode; + + public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) + private String phoneNumber; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public ValidatePhoneNumberReq() { + } + + public ValidatePhoneNumberReq regionCode(String regionCode) { + this.regionCode = regionCode; + return this; + } + + /** + * ISO country or region code + * @return regionCode + **/ + @javax.annotation.Nullable + public String getRegionCode() { + return regionCode; + } + + public void setRegionCode(String regionCode) { + this.regionCode = regionCode; + } + + + public ValidatePhoneNumberReq phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Phone number to validate + * @return phoneNumber + **/ + @javax.annotation.Nonnull + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + + public ValidatePhoneNumberReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public ValidatePhoneNumberReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidatePhoneNumberReq validatePhoneNumberReq = (ValidatePhoneNumberReq) o; + return Objects.equals(this.regionCode, validatePhoneNumberReq.regionCode) && + Objects.equals(this.phoneNumber, validatePhoneNumberReq.phoneNumber) && + Objects.equals(this.requestID, validatePhoneNumberReq.requestID) && + Objects.equals(this.clientInfo, validatePhoneNumberReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(regionCode, phoneNumber, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidatePhoneNumberReq {\n"); + sb.append(" regionCode: ").append(toIndentedString(regionCode)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("regionCode"); + openapiFields.add("phoneNumber"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("phoneNumber"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ValidatePhoneNumberReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ValidatePhoneNumberReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ValidatePhoneNumberReq is not found in the empty JSON string", ValidatePhoneNumberReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ValidatePhoneNumberReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidatePhoneNumberReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ValidatePhoneNumberReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("regionCode") != null && !jsonObj.get("regionCode").isJsonNull()) && !jsonObj.get("regionCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `regionCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("regionCode").toString())); + } + if (!jsonObj.get("phoneNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ValidatePhoneNumberReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ValidatePhoneNumberReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ValidatePhoneNumberReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ValidatePhoneNumberReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ValidatePhoneNumberReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ValidatePhoneNumberReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of ValidatePhoneNumberReq + * @throws IOException if the JSON string is invalid with respect to ValidatePhoneNumberReq + */ + public static ValidatePhoneNumberReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ValidatePhoneNumberReq.class); + } + + /** + * Convert an instance of ValidatePhoneNumberReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ValidatePhoneNumberRsp.java b/src/main/java/com/corbado/generated/model/ValidatePhoneNumberRsp.java new file mode 100644 index 0000000..c3ad8f6 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ValidatePhoneNumberRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.PhoneNumberValidationResult; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ValidatePhoneNumberRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ValidatePhoneNumberRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private PhoneNumberValidationResult data; + + public ValidatePhoneNumberRsp() { + } + + public ValidatePhoneNumberRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public ValidatePhoneNumberRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public ValidatePhoneNumberRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public ValidatePhoneNumberRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public ValidatePhoneNumberRsp data(PhoneNumberValidationResult data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public PhoneNumberValidationResult getData() { + return data; + } + + public void setData(PhoneNumberValidationResult data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidatePhoneNumberRsp validatePhoneNumberRsp = (ValidatePhoneNumberRsp) o; + return Objects.equals(this.httpStatusCode, validatePhoneNumberRsp.httpStatusCode) && + Objects.equals(this.message, validatePhoneNumberRsp.message) && + Objects.equals(this.requestData, validatePhoneNumberRsp.requestData) && + Objects.equals(this.runtime, validatePhoneNumberRsp.runtime) && + Objects.equals(this.data, validatePhoneNumberRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidatePhoneNumberRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ValidatePhoneNumberRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ValidatePhoneNumberRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ValidatePhoneNumberRsp is not found in the empty JSON string", ValidatePhoneNumberRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ValidatePhoneNumberRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidatePhoneNumberRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ValidatePhoneNumberRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + PhoneNumberValidationResult.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ValidatePhoneNumberRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ValidatePhoneNumberRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ValidatePhoneNumberRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ValidatePhoneNumberRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ValidatePhoneNumberRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ValidatePhoneNumberRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of ValidatePhoneNumberRsp + * @throws IOException if the JSON string is invalid with respect to ValidatePhoneNumberRsp + */ + public static ValidatePhoneNumberRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ValidatePhoneNumberRsp.class); + } + + /** + * Convert an instance of ValidatePhoneNumberRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ValidationEmail.java b/src/main/java/com/corbado/generated/model/ValidationEmail.java new file mode 100644 index 0000000..f8ea36b --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ValidationEmail.java @@ -0,0 +1,355 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ValidationEmail + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ValidationEmail { + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_DOMAIN = "domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + private String domain; + + public static final String SERIALIZED_NAME_REACHABLE = "reachable"; + @SerializedName(SERIALIZED_NAME_REACHABLE) + private String reachable; + + public static final String SERIALIZED_NAME_DISPOSABLE = "disposable"; + @SerializedName(SERIALIZED_NAME_DISPOSABLE) + private Boolean disposable; + + public static final String SERIALIZED_NAME_FREE = "free"; + @SerializedName(SERIALIZED_NAME_FREE) + private Boolean free; + + public static final String SERIALIZED_NAME_HAS_MX_RECORDS = "hasMxRecords"; + @SerializedName(SERIALIZED_NAME_HAS_MX_RECORDS) + private Boolean hasMxRecords; + + public ValidationEmail() { + } + + public ValidationEmail username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + public ValidationEmail domain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get domain + * @return domain + **/ + @javax.annotation.Nonnull + public String getDomain() { + return domain; + } + + public void setDomain(String domain) { + this.domain = domain; + } + + + public ValidationEmail reachable(String reachable) { + this.reachable = reachable; + return this; + } + + /** + * Get reachable + * @return reachable + **/ + @javax.annotation.Nonnull + public String getReachable() { + return reachable; + } + + public void setReachable(String reachable) { + this.reachable = reachable; + } + + + public ValidationEmail disposable(Boolean disposable) { + this.disposable = disposable; + return this; + } + + /** + * Get disposable + * @return disposable + **/ + @javax.annotation.Nonnull + public Boolean getDisposable() { + return disposable; + } + + public void setDisposable(Boolean disposable) { + this.disposable = disposable; + } + + + public ValidationEmail free(Boolean free) { + this.free = free; + return this; + } + + /** + * Get free + * @return free + **/ + @javax.annotation.Nonnull + public Boolean getFree() { + return free; + } + + public void setFree(Boolean free) { + this.free = free; + } + + + public ValidationEmail hasMxRecords(Boolean hasMxRecords) { + this.hasMxRecords = hasMxRecords; + return this; + } + + /** + * Get hasMxRecords + * @return hasMxRecords + **/ + @javax.annotation.Nonnull + public Boolean getHasMxRecords() { + return hasMxRecords; + } + + public void setHasMxRecords(Boolean hasMxRecords) { + this.hasMxRecords = hasMxRecords; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidationEmail validationEmail = (ValidationEmail) o; + return Objects.equals(this.username, validationEmail.username) && + Objects.equals(this.domain, validationEmail.domain) && + Objects.equals(this.reachable, validationEmail.reachable) && + Objects.equals(this.disposable, validationEmail.disposable) && + Objects.equals(this.free, validationEmail.free) && + Objects.equals(this.hasMxRecords, validationEmail.hasMxRecords); + } + + @Override + public int hashCode() { + return Objects.hash(username, domain, reachable, disposable, free, hasMxRecords); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidationEmail {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" reachable: ").append(toIndentedString(reachable)).append("\n"); + sb.append(" disposable: ").append(toIndentedString(disposable)).append("\n"); + sb.append(" free: ").append(toIndentedString(free)).append("\n"); + sb.append(" hasMxRecords: ").append(toIndentedString(hasMxRecords)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("username"); + openapiFields.add("domain"); + openapiFields.add("reachable"); + openapiFields.add("disposable"); + openapiFields.add("free"); + openapiFields.add("hasMxRecords"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("domain"); + openapiRequiredFields.add("reachable"); + openapiRequiredFields.add("disposable"); + openapiRequiredFields.add("free"); + openapiRequiredFields.add("hasMxRecords"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ValidationEmail + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ValidationEmail.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ValidationEmail is not found in the empty JSON string", ValidationEmail.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ValidationEmail.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidationEmail` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ValidationEmail.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domain").toString())); + } + if (!jsonObj.get("reachable").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reachable` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reachable").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ValidationEmail.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ValidationEmail' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ValidationEmail.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ValidationEmail value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ValidationEmail read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ValidationEmail given an JSON string + * + * @param jsonString JSON string + * @return An instance of ValidationEmail + * @throws IOException if the JSON string is invalid with respect to ValidationEmail + */ + public static ValidationEmail fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ValidationEmail.class); + } + + /** + * Convert an instance of ValidationEmail to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ValidationPhoneNumber.java b/src/main/java/com/corbado/generated/model/ValidationPhoneNumber.java new file mode 100644 index 0000000..c214786 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ValidationPhoneNumber.java @@ -0,0 +1,328 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ValidationPhoneNumber + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class ValidationPhoneNumber { + public static final String SERIALIZED_NAME_NATIONAL_NUMBER = "nationalNumber"; + @SerializedName(SERIALIZED_NAME_NATIONAL_NUMBER) + private Integer nationalNumber; + + public static final String SERIALIZED_NAME_COUNTRY_CODE = "countryCode"; + @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) + private Integer countryCode; + + public static final String SERIALIZED_NAME_REGION_CODE = "regionCode"; + @SerializedName(SERIALIZED_NAME_REGION_CODE) + private String regionCode; + + public static final String SERIALIZED_NAME_NATIONAL_FORMATTED = "nationalFormatted"; + @SerializedName(SERIALIZED_NAME_NATIONAL_FORMATTED) + private String nationalFormatted; + + public static final String SERIALIZED_NAME_INTERNATIONAL_FORMATTED = "internationalFormatted"; + @SerializedName(SERIALIZED_NAME_INTERNATIONAL_FORMATTED) + private String internationalFormatted; + + public ValidationPhoneNumber() { + } + + public ValidationPhoneNumber nationalNumber(Integer nationalNumber) { + this.nationalNumber = nationalNumber; + return this; + } + + /** + * Get nationalNumber + * @return nationalNumber + **/ + @javax.annotation.Nonnull + public Integer getNationalNumber() { + return nationalNumber; + } + + public void setNationalNumber(Integer nationalNumber) { + this.nationalNumber = nationalNumber; + } + + + public ValidationPhoneNumber countryCode(Integer countryCode) { + this.countryCode = countryCode; + return this; + } + + /** + * Get countryCode + * @return countryCode + **/ + @javax.annotation.Nonnull + public Integer getCountryCode() { + return countryCode; + } + + public void setCountryCode(Integer countryCode) { + this.countryCode = countryCode; + } + + + public ValidationPhoneNumber regionCode(String regionCode) { + this.regionCode = regionCode; + return this; + } + + /** + * Get regionCode + * @return regionCode + **/ + @javax.annotation.Nonnull + public String getRegionCode() { + return regionCode; + } + + public void setRegionCode(String regionCode) { + this.regionCode = regionCode; + } + + + public ValidationPhoneNumber nationalFormatted(String nationalFormatted) { + this.nationalFormatted = nationalFormatted; + return this; + } + + /** + * Get nationalFormatted + * @return nationalFormatted + **/ + @javax.annotation.Nonnull + public String getNationalFormatted() { + return nationalFormatted; + } + + public void setNationalFormatted(String nationalFormatted) { + this.nationalFormatted = nationalFormatted; + } + + + public ValidationPhoneNumber internationalFormatted(String internationalFormatted) { + this.internationalFormatted = internationalFormatted; + return this; + } + + /** + * Get internationalFormatted + * @return internationalFormatted + **/ + @javax.annotation.Nonnull + public String getInternationalFormatted() { + return internationalFormatted; + } + + public void setInternationalFormatted(String internationalFormatted) { + this.internationalFormatted = internationalFormatted; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidationPhoneNumber validationPhoneNumber = (ValidationPhoneNumber) o; + return Objects.equals(this.nationalNumber, validationPhoneNumber.nationalNumber) && + Objects.equals(this.countryCode, validationPhoneNumber.countryCode) && + Objects.equals(this.regionCode, validationPhoneNumber.regionCode) && + Objects.equals(this.nationalFormatted, validationPhoneNumber.nationalFormatted) && + Objects.equals(this.internationalFormatted, validationPhoneNumber.internationalFormatted); + } + + @Override + public int hashCode() { + return Objects.hash(nationalNumber, countryCode, regionCode, nationalFormatted, internationalFormatted); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidationPhoneNumber {\n"); + sb.append(" nationalNumber: ").append(toIndentedString(nationalNumber)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" regionCode: ").append(toIndentedString(regionCode)).append("\n"); + sb.append(" nationalFormatted: ").append(toIndentedString(nationalFormatted)).append("\n"); + sb.append(" internationalFormatted: ").append(toIndentedString(internationalFormatted)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("nationalNumber"); + openapiFields.add("countryCode"); + openapiFields.add("regionCode"); + openapiFields.add("nationalFormatted"); + openapiFields.add("internationalFormatted"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("nationalNumber"); + openapiRequiredFields.add("countryCode"); + openapiRequiredFields.add("regionCode"); + openapiRequiredFields.add("nationalFormatted"); + openapiRequiredFields.add("internationalFormatted"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ValidationPhoneNumber + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ValidationPhoneNumber.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ValidationPhoneNumber is not found in the empty JSON string", ValidationPhoneNumber.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ValidationPhoneNumber.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidationPhoneNumber` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ValidationPhoneNumber.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("regionCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `regionCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("regionCode").toString())); + } + if (!jsonObj.get("nationalFormatted").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nationalFormatted` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nationalFormatted").toString())); + } + if (!jsonObj.get("internationalFormatted").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `internationalFormatted` to be a primitive type in the JSON string but got `%s`", jsonObj.get("internationalFormatted").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ValidationPhoneNumber.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ValidationPhoneNumber' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ValidationPhoneNumber.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ValidationPhoneNumber value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ValidationPhoneNumber read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ValidationPhoneNumber given an JSON string + * + * @param jsonString JSON string + * @return An instance of ValidationPhoneNumber + * @throws IOException if the JSON string is invalid with respect to ValidationPhoneNumber + */ + public static ValidationPhoneNumber fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ValidationPhoneNumber.class); + } + + /** + * Convert an instance of ValidationPhoneNumber to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnAssociateStartReq.java b/src/main/java/com/corbado/generated/model/WebAuthnAssociateStartReq.java new file mode 100644 index 0000000..eac493f --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnAssociateStartReq.java @@ -0,0 +1,274 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnAssociateStartReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnAssociateStartReq { + public static final String SERIALIZED_NAME_ASSOCIATION_TOKEN = "associationToken"; + @SerializedName(SERIALIZED_NAME_ASSOCIATION_TOKEN) + private String associationToken; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public WebAuthnAssociateStartReq() { + } + + public WebAuthnAssociateStartReq associationToken(String associationToken) { + this.associationToken = associationToken; + return this; + } + + /** + * Get associationToken + * @return associationToken + **/ + @javax.annotation.Nonnull + public String getAssociationToken() { + return associationToken; + } + + public void setAssociationToken(String associationToken) { + this.associationToken = associationToken; + } + + + public WebAuthnAssociateStartReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public WebAuthnAssociateStartReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnAssociateStartReq webAuthnAssociateStartReq = (WebAuthnAssociateStartReq) o; + return Objects.equals(this.associationToken, webAuthnAssociateStartReq.associationToken) && + Objects.equals(this.requestID, webAuthnAssociateStartReq.requestID) && + Objects.equals(this.clientInfo, webAuthnAssociateStartReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(associationToken, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnAssociateStartReq {\n"); + sb.append(" associationToken: ").append(toIndentedString(associationToken)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("associationToken"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("associationToken"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnAssociateStartReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnAssociateStartReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnAssociateStartReq is not found in the empty JSON string", WebAuthnAssociateStartReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnAssociateStartReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnAssociateStartReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnAssociateStartReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("associationToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `associationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("associationToken").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnAssociateStartReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnAssociateStartReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnAssociateStartReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnAssociateStartReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnAssociateStartReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnAssociateStartReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnAssociateStartReq + * @throws IOException if the JSON string is invalid with respect to WebAuthnAssociateStartReq + */ + public static WebAuthnAssociateStartReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnAssociateStartReq.class); + } + + /** + * Convert an instance of WebAuthnAssociateStartReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnAssociateStartRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnAssociateStartRsp.java new file mode 100644 index 0000000..6a64efa --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnAssociateStartRsp.java @@ -0,0 +1,414 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnAssociateStartRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnAssociateStartRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + /** + * Status represents information if user signup was successful or the user with its credentials already exists + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("success"), + + DUPLICATE("duplicate"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL_CREATION_OPTIONS = "publicKeyCredentialCreationOptions"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL_CREATION_OPTIONS) + private String publicKeyCredentialCreationOptions; + + public WebAuthnAssociateStartRsp() { + } + + public WebAuthnAssociateStartRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebAuthnAssociateStartRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebAuthnAssociateStartRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebAuthnAssociateStartRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebAuthnAssociateStartRsp status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Status represents information if user signup was successful or the user with its credentials already exists + * @return status + **/ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public WebAuthnAssociateStartRsp publicKeyCredentialCreationOptions(String publicKeyCredentialCreationOptions) { + this.publicKeyCredentialCreationOptions = publicKeyCredentialCreationOptions; + return this; + } + + /** + * Contains JSON payload data to start Passkeys (Biometrics) sign up challenge + * @return publicKeyCredentialCreationOptions + **/ + @javax.annotation.Nonnull + public String getPublicKeyCredentialCreationOptions() { + return publicKeyCredentialCreationOptions; + } + + public void setPublicKeyCredentialCreationOptions(String publicKeyCredentialCreationOptions) { + this.publicKeyCredentialCreationOptions = publicKeyCredentialCreationOptions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnAssociateStartRsp webAuthnAssociateStartRsp = (WebAuthnAssociateStartRsp) o; + return Objects.equals(this.httpStatusCode, webAuthnAssociateStartRsp.httpStatusCode) && + Objects.equals(this.message, webAuthnAssociateStartRsp.message) && + Objects.equals(this.requestData, webAuthnAssociateStartRsp.requestData) && + Objects.equals(this.runtime, webAuthnAssociateStartRsp.runtime) && + Objects.equals(this.status, webAuthnAssociateStartRsp.status) && + Objects.equals(this.publicKeyCredentialCreationOptions, webAuthnAssociateStartRsp.publicKeyCredentialCreationOptions); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, status, publicKeyCredentialCreationOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnAssociateStartRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" publicKeyCredentialCreationOptions: ").append(toIndentedString(publicKeyCredentialCreationOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("status"); + openapiFields.add("publicKeyCredentialCreationOptions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("publicKeyCredentialCreationOptions"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnAssociateStartRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnAssociateStartRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnAssociateStartRsp is not found in the empty JSON string", WebAuthnAssociateStartRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnAssociateStartRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnAssociateStartRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnAssociateStartRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + if (!jsonObj.get("publicKeyCredentialCreationOptions").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKeyCredentialCreationOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKeyCredentialCreationOptions").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnAssociateStartRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnAssociateStartRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnAssociateStartRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnAssociateStartRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnAssociateStartRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnAssociateStartRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnAssociateStartRsp + * @throws IOException if the JSON string is invalid with respect to WebAuthnAssociateStartRsp + */ + public static WebAuthnAssociateStartRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnAssociateStartRsp.class); + } + + /** + * Convert an instance of WebAuthnAssociateStartRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateFinishRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateFinishRsp.java new file mode 100644 index 0000000..d340ddb --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateFinishRsp.java @@ -0,0 +1,503 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnAuthenticateFinishRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnAuthenticateFinishRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_CREDENTIAL_I_D = "credentialID"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_I_D) + private String credentialID; + + public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; + @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) + private String userFullName; + + /** + * Status represents information if user signup was successful or the user with its credentials already exists + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("success"), + + UNCONFIRMED_CREDENTIAL("unconfirmedCredential"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public WebAuthnAuthenticateFinishRsp() { + } + + public WebAuthnAuthenticateFinishRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebAuthnAuthenticateFinishRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebAuthnAuthenticateFinishRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebAuthnAuthenticateFinishRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebAuthnAuthenticateFinishRsp userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + **/ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public WebAuthnAuthenticateFinishRsp username(String username) { + this.username = username; + return this; + } + + /** + * Username of current challenge + * @return username + **/ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + public WebAuthnAuthenticateFinishRsp credentialID(String credentialID) { + this.credentialID = credentialID; + return this; + } + + /** + * Used credential ID + * @return credentialID + **/ + @javax.annotation.Nonnull + public String getCredentialID() { + return credentialID; + } + + public void setCredentialID(String credentialID) { + this.credentialID = credentialID; + } + + + public WebAuthnAuthenticateFinishRsp userFullName(String userFullName) { + this.userFullName = userFullName; + return this; + } + + /** + * Optional user's full name to be used if the user wasn't found and needs to be created first + * @return userFullName + **/ + @javax.annotation.Nullable + public String getUserFullName() { + return userFullName; + } + + public void setUserFullName(String userFullName) { + this.userFullName = userFullName; + } + + + public WebAuthnAuthenticateFinishRsp status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Status represents information if user signup was successful or the user with its credentials already exists + * @return status + **/ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnAuthenticateFinishRsp webAuthnAuthenticateFinishRsp = (WebAuthnAuthenticateFinishRsp) o; + return Objects.equals(this.httpStatusCode, webAuthnAuthenticateFinishRsp.httpStatusCode) && + Objects.equals(this.message, webAuthnAuthenticateFinishRsp.message) && + Objects.equals(this.requestData, webAuthnAuthenticateFinishRsp.requestData) && + Objects.equals(this.runtime, webAuthnAuthenticateFinishRsp.runtime) && + Objects.equals(this.userID, webAuthnAuthenticateFinishRsp.userID) && + Objects.equals(this.username, webAuthnAuthenticateFinishRsp.username) && + Objects.equals(this.credentialID, webAuthnAuthenticateFinishRsp.credentialID) && + Objects.equals(this.userFullName, webAuthnAuthenticateFinishRsp.userFullName) && + Objects.equals(this.status, webAuthnAuthenticateFinishRsp.status); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, userID, username, credentialID, userFullName, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnAuthenticateFinishRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" credentialID: ").append(toIndentedString(credentialID)).append("\n"); + sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("userID"); + openapiFields.add("username"); + openapiFields.add("credentialID"); + openapiFields.add("userFullName"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("credentialID"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnAuthenticateFinishRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnAuthenticateFinishRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnAuthenticateFinishRsp is not found in the empty JSON string", WebAuthnAuthenticateFinishRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnAuthenticateFinishRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnAuthenticateFinishRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnAuthenticateFinishRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("credentialID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `credentialID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialID").toString())); + } + if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnAuthenticateFinishRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnAuthenticateFinishRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnAuthenticateFinishRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnAuthenticateFinishRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnAuthenticateFinishRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnAuthenticateFinishRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnAuthenticateFinishRsp + * @throws IOException if the JSON string is invalid with respect to WebAuthnAuthenticateFinishRsp + */ + public static WebAuthnAuthenticateFinishRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnAuthenticateFinishRsp.class); + } + + /** + * Convert an instance of WebAuthnAuthenticateFinishRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartReq.java b/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartReq.java new file mode 100644 index 0000000..076ac38 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartReq.java @@ -0,0 +1,273 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnAuthenticateStartReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnAuthenticateStartReq { + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public WebAuthnAuthenticateStartReq() { + } + + public WebAuthnAuthenticateStartReq username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + public WebAuthnAuthenticateStartReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public WebAuthnAuthenticateStartReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nonnull + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnAuthenticateStartReq webAuthnAuthenticateStartReq = (WebAuthnAuthenticateStartReq) o; + return Objects.equals(this.username, webAuthnAuthenticateStartReq.username) && + Objects.equals(this.requestID, webAuthnAuthenticateStartReq.requestID) && + Objects.equals(this.clientInfo, webAuthnAuthenticateStartReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(username, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnAuthenticateStartReq {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("username"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("clientInfo"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnAuthenticateStartReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnAuthenticateStartReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnAuthenticateStartReq is not found in the empty JSON string", WebAuthnAuthenticateStartReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnAuthenticateStartReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnAuthenticateStartReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnAuthenticateStartReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the required field `clientInfo` + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnAuthenticateStartReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnAuthenticateStartReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnAuthenticateStartReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnAuthenticateStartReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnAuthenticateStartReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnAuthenticateStartReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnAuthenticateStartReq + * @throws IOException if the JSON string is invalid with respect to WebAuthnAuthenticateStartReq + */ + public static WebAuthnAuthenticateStartReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnAuthenticateStartReq.class); + } + + /** + * Convert an instance of WebAuthnAuthenticateStartReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartRsp.java new file mode 100644 index 0000000..365d012 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartRsp.java @@ -0,0 +1,416 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnAuthenticateStartRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnAuthenticateStartRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL_REQUEST_OPTIONS = "publicKeyCredentialRequestOptions"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL_REQUEST_OPTIONS) + private String publicKeyCredentialRequestOptions; + + /** + * Status represents information if authenticate start was successful or device is unknown + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("success"), + + UNKNOWN_DEVICE("unknownDevice"), + + UNCONFIRMED_DEVICE("unconfirmedDevice"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public WebAuthnAuthenticateStartRsp() { + } + + public WebAuthnAuthenticateStartRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebAuthnAuthenticateStartRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebAuthnAuthenticateStartRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebAuthnAuthenticateStartRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebAuthnAuthenticateStartRsp publicKeyCredentialRequestOptions(String publicKeyCredentialRequestOptions) { + this.publicKeyCredentialRequestOptions = publicKeyCredentialRequestOptions; + return this; + } + + /** + * Contains JSON payload data to start Passkeys (Biometrics) login challenge + * @return publicKeyCredentialRequestOptions + **/ + @javax.annotation.Nonnull + public String getPublicKeyCredentialRequestOptions() { + return publicKeyCredentialRequestOptions; + } + + public void setPublicKeyCredentialRequestOptions(String publicKeyCredentialRequestOptions) { + this.publicKeyCredentialRequestOptions = publicKeyCredentialRequestOptions; + } + + + public WebAuthnAuthenticateStartRsp status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Status represents information if authenticate start was successful or device is unknown + * @return status + **/ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnAuthenticateStartRsp webAuthnAuthenticateStartRsp = (WebAuthnAuthenticateStartRsp) o; + return Objects.equals(this.httpStatusCode, webAuthnAuthenticateStartRsp.httpStatusCode) && + Objects.equals(this.message, webAuthnAuthenticateStartRsp.message) && + Objects.equals(this.requestData, webAuthnAuthenticateStartRsp.requestData) && + Objects.equals(this.runtime, webAuthnAuthenticateStartRsp.runtime) && + Objects.equals(this.publicKeyCredentialRequestOptions, webAuthnAuthenticateStartRsp.publicKeyCredentialRequestOptions) && + Objects.equals(this.status, webAuthnAuthenticateStartRsp.status); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, publicKeyCredentialRequestOptions, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnAuthenticateStartRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" publicKeyCredentialRequestOptions: ").append(toIndentedString(publicKeyCredentialRequestOptions)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("publicKeyCredentialRequestOptions"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("publicKeyCredentialRequestOptions"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnAuthenticateStartRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnAuthenticateStartRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnAuthenticateStartRsp is not found in the empty JSON string", WebAuthnAuthenticateStartRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnAuthenticateStartRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnAuthenticateStartRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnAuthenticateStartRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("publicKeyCredentialRequestOptions").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKeyCredentialRequestOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKeyCredentialRequestOptions").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnAuthenticateStartRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnAuthenticateStartRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnAuthenticateStartRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnAuthenticateStartRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnAuthenticateStartRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnAuthenticateStartRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnAuthenticateStartRsp + * @throws IOException if the JSON string is invalid with respect to WebAuthnAuthenticateStartRsp + */ + public static WebAuthnAuthenticateStartRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnAuthenticateStartRsp.class); + } + + /** + * Convert an instance of WebAuthnAuthenticateStartRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateSuccess.java b/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateSuccess.java new file mode 100644 index 0000000..d76e19f --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateSuccess.java @@ -0,0 +1,419 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnAuthenticateSuccess + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnAuthenticateSuccess { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_CREDENTIAL_I_D = "credentialID"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_I_D) + private String credentialID; + + public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; + @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) + private String userFullName; + + public WebAuthnAuthenticateSuccess() { + } + + public WebAuthnAuthenticateSuccess httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebAuthnAuthenticateSuccess message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebAuthnAuthenticateSuccess requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebAuthnAuthenticateSuccess runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebAuthnAuthenticateSuccess userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + **/ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public WebAuthnAuthenticateSuccess username(String username) { + this.username = username; + return this; + } + + /** + * Username of current challenge + * @return username + **/ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + public WebAuthnAuthenticateSuccess credentialID(String credentialID) { + this.credentialID = credentialID; + return this; + } + + /** + * Used credential ID + * @return credentialID + **/ + @javax.annotation.Nonnull + public String getCredentialID() { + return credentialID; + } + + public void setCredentialID(String credentialID) { + this.credentialID = credentialID; + } + + + public WebAuthnAuthenticateSuccess userFullName(String userFullName) { + this.userFullName = userFullName; + return this; + } + + /** + * Optional user's full name to be used if the user wasn't found and needs to be created first + * @return userFullName + **/ + @javax.annotation.Nullable + public String getUserFullName() { + return userFullName; + } + + public void setUserFullName(String userFullName) { + this.userFullName = userFullName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnAuthenticateSuccess webAuthnAuthenticateSuccess = (WebAuthnAuthenticateSuccess) o; + return Objects.equals(this.httpStatusCode, webAuthnAuthenticateSuccess.httpStatusCode) && + Objects.equals(this.message, webAuthnAuthenticateSuccess.message) && + Objects.equals(this.requestData, webAuthnAuthenticateSuccess.requestData) && + Objects.equals(this.runtime, webAuthnAuthenticateSuccess.runtime) && + Objects.equals(this.userID, webAuthnAuthenticateSuccess.userID) && + Objects.equals(this.username, webAuthnAuthenticateSuccess.username) && + Objects.equals(this.credentialID, webAuthnAuthenticateSuccess.credentialID) && + Objects.equals(this.userFullName, webAuthnAuthenticateSuccess.userFullName); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, userID, username, credentialID, userFullName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnAuthenticateSuccess {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" credentialID: ").append(toIndentedString(credentialID)).append("\n"); + sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("userID"); + openapiFields.add("username"); + openapiFields.add("credentialID"); + openapiFields.add("userFullName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("credentialID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnAuthenticateSuccess + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnAuthenticateSuccess.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnAuthenticateSuccess is not found in the empty JSON string", WebAuthnAuthenticateSuccess.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnAuthenticateSuccess.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnAuthenticateSuccess` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnAuthenticateSuccess.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("credentialID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `credentialID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialID").toString())); + } + if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnAuthenticateSuccess.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnAuthenticateSuccess' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnAuthenticateSuccess.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnAuthenticateSuccess value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnAuthenticateSuccess read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnAuthenticateSuccess given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnAuthenticateSuccess + * @throws IOException if the JSON string is invalid with respect to WebAuthnAuthenticateSuccess + */ + public static WebAuthnAuthenticateSuccess fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnAuthenticateSuccess.class); + } + + /** + * Convert an instance of WebAuthnAuthenticateSuccess to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnAuthenticatorUpdateReq.java b/src/main/java/com/corbado/generated/model/WebAuthnAuthenticatorUpdateReq.java new file mode 100644 index 0000000..d67d607 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnAuthenticatorUpdateReq.java @@ -0,0 +1,274 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnAuthenticatorUpdateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnAuthenticatorUpdateReq { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public WebAuthnAuthenticatorUpdateReq() { + } + + public WebAuthnAuthenticatorUpdateReq name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public WebAuthnAuthenticatorUpdateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public WebAuthnAuthenticatorUpdateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnAuthenticatorUpdateReq webAuthnAuthenticatorUpdateReq = (WebAuthnAuthenticatorUpdateReq) o; + return Objects.equals(this.name, webAuthnAuthenticatorUpdateReq.name) && + Objects.equals(this.requestID, webAuthnAuthenticatorUpdateReq.requestID) && + Objects.equals(this.clientInfo, webAuthnAuthenticatorUpdateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(name, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnAuthenticatorUpdateReq {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnAuthenticatorUpdateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnAuthenticatorUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnAuthenticatorUpdateReq is not found in the empty JSON string", WebAuthnAuthenticatorUpdateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnAuthenticatorUpdateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnAuthenticatorUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnAuthenticatorUpdateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnAuthenticatorUpdateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnAuthenticatorUpdateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnAuthenticatorUpdateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnAuthenticatorUpdateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnAuthenticatorUpdateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnAuthenticatorUpdateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnAuthenticatorUpdateReq + * @throws IOException if the JSON string is invalid with respect to WebAuthnAuthenticatorUpdateReq + */ + public static WebAuthnAuthenticatorUpdateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnAuthenticatorUpdateReq.class); + } + + /** + * Convert an instance of WebAuthnAuthenticatorUpdateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsReq.java b/src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsReq.java new file mode 100644 index 0000000..75abd00 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsReq.java @@ -0,0 +1,303 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.corbado.generated.model.LoginIdentifierType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnCredentialExistsReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnCredentialExistsReq { + public static final String SERIALIZED_NAME_LOGIN_IDENTIFIER = "loginIdentifier"; + @SerializedName(SERIALIZED_NAME_LOGIN_IDENTIFIER) + private String loginIdentifier; + + public static final String SERIALIZED_NAME_LOGIN_IDENTIFIER_TYPE = "loginIdentifierType"; + @SerializedName(SERIALIZED_NAME_LOGIN_IDENTIFIER_TYPE) + private LoginIdentifierType loginIdentifierType; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public WebAuthnCredentialExistsReq() { + } + + public WebAuthnCredentialExistsReq loginIdentifier(String loginIdentifier) { + this.loginIdentifier = loginIdentifier; + return this; + } + + /** + * Get loginIdentifier + * @return loginIdentifier + **/ + @javax.annotation.Nonnull + public String getLoginIdentifier() { + return loginIdentifier; + } + + public void setLoginIdentifier(String loginIdentifier) { + this.loginIdentifier = loginIdentifier; + } + + + public WebAuthnCredentialExistsReq loginIdentifierType(LoginIdentifierType loginIdentifierType) { + this.loginIdentifierType = loginIdentifierType; + return this; + } + + /** + * Get loginIdentifierType + * @return loginIdentifierType + **/ + @javax.annotation.Nonnull + public LoginIdentifierType getLoginIdentifierType() { + return loginIdentifierType; + } + + public void setLoginIdentifierType(LoginIdentifierType loginIdentifierType) { + this.loginIdentifierType = loginIdentifierType; + } + + + public WebAuthnCredentialExistsReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public WebAuthnCredentialExistsReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nonnull + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnCredentialExistsReq webAuthnCredentialExistsReq = (WebAuthnCredentialExistsReq) o; + return Objects.equals(this.loginIdentifier, webAuthnCredentialExistsReq.loginIdentifier) && + Objects.equals(this.loginIdentifierType, webAuthnCredentialExistsReq.loginIdentifierType) && + Objects.equals(this.requestID, webAuthnCredentialExistsReq.requestID) && + Objects.equals(this.clientInfo, webAuthnCredentialExistsReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(loginIdentifier, loginIdentifierType, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnCredentialExistsReq {\n"); + sb.append(" loginIdentifier: ").append(toIndentedString(loginIdentifier)).append("\n"); + sb.append(" loginIdentifierType: ").append(toIndentedString(loginIdentifierType)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("loginIdentifier"); + openapiFields.add("loginIdentifierType"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("loginIdentifier"); + openapiRequiredFields.add("loginIdentifierType"); + openapiRequiredFields.add("clientInfo"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnCredentialExistsReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnCredentialExistsReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnCredentialExistsReq is not found in the empty JSON string", WebAuthnCredentialExistsReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnCredentialExistsReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnCredentialExistsReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnCredentialExistsReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("loginIdentifier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loginIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginIdentifier").toString())); + } + // validate the required field `loginIdentifierType` + LoginIdentifierType.validateJsonElement(jsonObj.get("loginIdentifierType")); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the required field `clientInfo` + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnCredentialExistsReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnCredentialExistsReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnCredentialExistsReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnCredentialExistsReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnCredentialExistsReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnCredentialExistsReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnCredentialExistsReq + * @throws IOException if the JSON string is invalid with respect to WebAuthnCredentialExistsReq + */ + public static WebAuthnCredentialExistsReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnCredentialExistsReq.class); + } + + /** + * Convert an instance of WebAuthnCredentialExistsReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsRsp.java new file mode 100644 index 0000000..4e56360 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsRsp.java @@ -0,0 +1,327 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnCredentialExistsRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnCredentialExistsRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_EXISTS = "exists"; + @SerializedName(SERIALIZED_NAME_EXISTS) + private Boolean exists; + + public WebAuthnCredentialExistsRsp() { + } + + public WebAuthnCredentialExistsRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebAuthnCredentialExistsRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebAuthnCredentialExistsRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebAuthnCredentialExistsRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebAuthnCredentialExistsRsp exists(Boolean exists) { + this.exists = exists; + return this; + } + + /** + * Get exists + * @return exists + **/ + @javax.annotation.Nonnull + public Boolean getExists() { + return exists; + } + + public void setExists(Boolean exists) { + this.exists = exists; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnCredentialExistsRsp webAuthnCredentialExistsRsp = (WebAuthnCredentialExistsRsp) o; + return Objects.equals(this.httpStatusCode, webAuthnCredentialExistsRsp.httpStatusCode) && + Objects.equals(this.message, webAuthnCredentialExistsRsp.message) && + Objects.equals(this.requestData, webAuthnCredentialExistsRsp.requestData) && + Objects.equals(this.runtime, webAuthnCredentialExistsRsp.runtime) && + Objects.equals(this.exists, webAuthnCredentialExistsRsp.exists); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, exists); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnCredentialExistsRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" exists: ").append(toIndentedString(exists)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("exists"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("exists"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnCredentialExistsRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnCredentialExistsRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnCredentialExistsRsp is not found in the empty JSON string", WebAuthnCredentialExistsRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnCredentialExistsRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnCredentialExistsRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnCredentialExistsRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnCredentialExistsRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnCredentialExistsRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnCredentialExistsRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnCredentialExistsRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnCredentialExistsRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnCredentialExistsRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnCredentialExistsRsp + * @throws IOException if the JSON string is invalid with respect to WebAuthnCredentialExistsRsp + */ + public static WebAuthnCredentialExistsRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnCredentialExistsRsp.class); + } + + /** + * Convert an instance of WebAuthnCredentialExistsRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnCredentialItemRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnCredentialItemRsp.java new file mode 100644 index 0000000..03195a2 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnCredentialItemRsp.java @@ -0,0 +1,840 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnCredentialItemRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnCredentialItemRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CREDENTIAL_HASH = "credentialHash"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_HASH) + private String credentialHash; + + public static final String SERIALIZED_NAME_AAGUID = "aaguid"; + @SerializedName(SERIALIZED_NAME_AAGUID) + private String aaguid; + + public static final String SERIALIZED_NAME_ATTESTATION_TYPE = "attestationType"; + @SerializedName(SERIALIZED_NAME_ATTESTATION_TYPE) + private String attestationType; + + public static final String SERIALIZED_NAME_BACKUP_STATE = "backupState"; + @SerializedName(SERIALIZED_NAME_BACKUP_STATE) + private Boolean backupState; + + public static final String SERIALIZED_NAME_BACKUP_ELIGIBLE = "backupEligible"; + @SerializedName(SERIALIZED_NAME_BACKUP_ELIGIBLE) + private Boolean backupEligible; + + /** + * Gets or Sets transport + */ + @JsonAdapter(TransportEnum.Adapter.class) + public enum TransportEnum { + USB("usb"), + + NFC("nfc"), + + BLE("ble"), + + INTERNAL("internal"), + + HYBRID("hybrid"), + + SMART_CARD("smart-card"); + + private String value; + + TransportEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TransportEnum fromValue(String value) { + for (TransportEnum b : TransportEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TransportEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TransportEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TransportEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TransportEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TRANSPORT = "transport"; + @SerializedName(SERIALIZED_NAME_TRANSPORT) + private List transport = new ArrayList<>(); + + /** + * Status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + PENDING("pending"), + + ACTIVE("active"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_USER_AGENT = "userAgent"; + @SerializedName(SERIALIZED_NAME_USER_AGENT) + private String userAgent; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_AUTHENTICATOR_I_D = "authenticatorID"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATOR_I_D) + private String authenticatorID; + + public static final String SERIALIZED_NAME_AUTHENTICATOR_NAME = "authenticatorName"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATOR_NAME) + private String authenticatorName; + + public static final String SERIALIZED_NAME_LAST_USED = "lastUsed"; + @SerializedName(SERIALIZED_NAME_LAST_USED) + private String lastUsed; + + public static final String SERIALIZED_NAME_LAST_USED_DEVICE_NAME = "lastUsedDeviceName"; + @SerializedName(SERIALIZED_NAME_LAST_USED_DEVICE_NAME) + private String lastUsedDeviceName; + + public WebAuthnCredentialItemRsp() { + } + + public WebAuthnCredentialItemRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebAuthnCredentialItemRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebAuthnCredentialItemRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebAuthnCredentialItemRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebAuthnCredentialItemRsp id(String id) { + this.id = id; + return this; + } + + /** + * Credential ID + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public WebAuthnCredentialItemRsp credentialHash(String credentialHash) { + this.credentialHash = credentialHash; + return this; + } + + /** + * Get credentialHash + * @return credentialHash + **/ + @javax.annotation.Nonnull + public String getCredentialHash() { + return credentialHash; + } + + public void setCredentialHash(String credentialHash) { + this.credentialHash = credentialHash; + } + + + public WebAuthnCredentialItemRsp aaguid(String aaguid) { + this.aaguid = aaguid; + return this; + } + + /** + * Get aaguid + * @return aaguid + **/ + @javax.annotation.Nonnull + public String getAaguid() { + return aaguid; + } + + public void setAaguid(String aaguid) { + this.aaguid = aaguid; + } + + + public WebAuthnCredentialItemRsp attestationType(String attestationType) { + this.attestationType = attestationType; + return this; + } + + /** + * Get attestationType + * @return attestationType + **/ + @javax.annotation.Nonnull + public String getAttestationType() { + return attestationType; + } + + public void setAttestationType(String attestationType) { + this.attestationType = attestationType; + } + + + public WebAuthnCredentialItemRsp backupState(Boolean backupState) { + this.backupState = backupState; + return this; + } + + /** + * Backup state + * @return backupState + **/ + @javax.annotation.Nullable + public Boolean getBackupState() { + return backupState; + } + + public void setBackupState(Boolean backupState) { + this.backupState = backupState; + } + + + public WebAuthnCredentialItemRsp backupEligible(Boolean backupEligible) { + this.backupEligible = backupEligible; + return this; + } + + /** + * Backup eligible + * @return backupEligible + **/ + @javax.annotation.Nonnull + public Boolean getBackupEligible() { + return backupEligible; + } + + public void setBackupEligible(Boolean backupEligible) { + this.backupEligible = backupEligible; + } + + + public WebAuthnCredentialItemRsp transport(List transport) { + this.transport = transport; + return this; + } + + public WebAuthnCredentialItemRsp addTransportItem(TransportEnum transportItem) { + if (this.transport == null) { + this.transport = new ArrayList<>(); + } + this.transport.add(transportItem); + return this; + } + + /** + * Transport + * @return transport + **/ + @javax.annotation.Nonnull + public List getTransport() { + return transport; + } + + public void setTransport(List transport) { + this.transport = transport; + } + + + public WebAuthnCredentialItemRsp status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Status + * @return status + **/ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public WebAuthnCredentialItemRsp userAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + * User agent + * @return userAgent + **/ + @javax.annotation.Nonnull + public String getUserAgent() { + return userAgent; + } + + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + + public WebAuthnCredentialItemRsp created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public WebAuthnCredentialItemRsp authenticatorID(String authenticatorID) { + this.authenticatorID = authenticatorID; + return this; + } + + /** + * Authenticator ID + * @return authenticatorID + **/ + @javax.annotation.Nonnull + public String getAuthenticatorID() { + return authenticatorID; + } + + public void setAuthenticatorID(String authenticatorID) { + this.authenticatorID = authenticatorID; + } + + + public WebAuthnCredentialItemRsp authenticatorName(String authenticatorName) { + this.authenticatorName = authenticatorName; + return this; + } + + /** + * Get authenticatorName + * @return authenticatorName + **/ + @javax.annotation.Nonnull + public String getAuthenticatorName() { + return authenticatorName; + } + + public void setAuthenticatorName(String authenticatorName) { + this.authenticatorName = authenticatorName; + } + + + public WebAuthnCredentialItemRsp lastUsed(String lastUsed) { + this.lastUsed = lastUsed; + return this; + } + + /** + * Timestamp of when the passkey was last used in yyyy-MM-dd'T'HH:mm:ss format + * @return lastUsed + **/ + @javax.annotation.Nonnull + public String getLastUsed() { + return lastUsed; + } + + public void setLastUsed(String lastUsed) { + this.lastUsed = lastUsed; + } + + + public WebAuthnCredentialItemRsp lastUsedDeviceName(String lastUsedDeviceName) { + this.lastUsedDeviceName = lastUsedDeviceName; + return this; + } + + /** + * Get lastUsedDeviceName + * @return lastUsedDeviceName + **/ + @javax.annotation.Nonnull + public String getLastUsedDeviceName() { + return lastUsedDeviceName; + } + + public void setLastUsedDeviceName(String lastUsedDeviceName) { + this.lastUsedDeviceName = lastUsedDeviceName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnCredentialItemRsp webAuthnCredentialItemRsp = (WebAuthnCredentialItemRsp) o; + return Objects.equals(this.httpStatusCode, webAuthnCredentialItemRsp.httpStatusCode) && + Objects.equals(this.message, webAuthnCredentialItemRsp.message) && + Objects.equals(this.requestData, webAuthnCredentialItemRsp.requestData) && + Objects.equals(this.runtime, webAuthnCredentialItemRsp.runtime) && + Objects.equals(this.id, webAuthnCredentialItemRsp.id) && + Objects.equals(this.credentialHash, webAuthnCredentialItemRsp.credentialHash) && + Objects.equals(this.aaguid, webAuthnCredentialItemRsp.aaguid) && + Objects.equals(this.attestationType, webAuthnCredentialItemRsp.attestationType) && + Objects.equals(this.backupState, webAuthnCredentialItemRsp.backupState) && + Objects.equals(this.backupEligible, webAuthnCredentialItemRsp.backupEligible) && + Objects.equals(this.transport, webAuthnCredentialItemRsp.transport) && + Objects.equals(this.status, webAuthnCredentialItemRsp.status) && + Objects.equals(this.userAgent, webAuthnCredentialItemRsp.userAgent) && + Objects.equals(this.created, webAuthnCredentialItemRsp.created) && + Objects.equals(this.authenticatorID, webAuthnCredentialItemRsp.authenticatorID) && + Objects.equals(this.authenticatorName, webAuthnCredentialItemRsp.authenticatorName) && + Objects.equals(this.lastUsed, webAuthnCredentialItemRsp.lastUsed) && + Objects.equals(this.lastUsedDeviceName, webAuthnCredentialItemRsp.lastUsedDeviceName); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, id, credentialHash, aaguid, attestationType, backupState, backupEligible, transport, status, userAgent, created, authenticatorID, authenticatorName, lastUsed, lastUsedDeviceName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnCredentialItemRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" credentialHash: ").append(toIndentedString(credentialHash)).append("\n"); + sb.append(" aaguid: ").append(toIndentedString(aaguid)).append("\n"); + sb.append(" attestationType: ").append(toIndentedString(attestationType)).append("\n"); + sb.append(" backupState: ").append(toIndentedString(backupState)).append("\n"); + sb.append(" backupEligible: ").append(toIndentedString(backupEligible)).append("\n"); + sb.append(" transport: ").append(toIndentedString(transport)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" userAgent: ").append(toIndentedString(userAgent)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" authenticatorID: ").append(toIndentedString(authenticatorID)).append("\n"); + sb.append(" authenticatorName: ").append(toIndentedString(authenticatorName)).append("\n"); + sb.append(" lastUsed: ").append(toIndentedString(lastUsed)).append("\n"); + sb.append(" lastUsedDeviceName: ").append(toIndentedString(lastUsedDeviceName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("id"); + openapiFields.add("credentialHash"); + openapiFields.add("aaguid"); + openapiFields.add("attestationType"); + openapiFields.add("backupState"); + openapiFields.add("backupEligible"); + openapiFields.add("transport"); + openapiFields.add("status"); + openapiFields.add("userAgent"); + openapiFields.add("created"); + openapiFields.add("authenticatorID"); + openapiFields.add("authenticatorName"); + openapiFields.add("lastUsed"); + openapiFields.add("lastUsedDeviceName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("credentialHash"); + openapiRequiredFields.add("aaguid"); + openapiRequiredFields.add("attestationType"); + openapiRequiredFields.add("backupEligible"); + openapiRequiredFields.add("transport"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("userAgent"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("authenticatorID"); + openapiRequiredFields.add("authenticatorName"); + openapiRequiredFields.add("lastUsed"); + openapiRequiredFields.add("lastUsedDeviceName"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnCredentialItemRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnCredentialItemRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnCredentialItemRsp is not found in the empty JSON string", WebAuthnCredentialItemRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnCredentialItemRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnCredentialItemRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnCredentialItemRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("credentialHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `credentialHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialHash").toString())); + } + if (!jsonObj.get("aaguid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `aaguid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aaguid").toString())); + } + if (!jsonObj.get("attestationType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `attestationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attestationType").toString())); + } + // ensure the required json array is present + if (jsonObj.get("transport") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("transport").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transport` to be an array in the JSON string but got `%s`", jsonObj.get("transport").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + if (!jsonObj.get("userAgent").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userAgent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userAgent").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("authenticatorID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authenticatorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticatorID").toString())); + } + if (!jsonObj.get("authenticatorName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authenticatorName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticatorName").toString())); + } + if (!jsonObj.get("lastUsed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastUsed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUsed").toString())); + } + if (!jsonObj.get("lastUsedDeviceName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastUsedDeviceName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUsedDeviceName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnCredentialItemRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnCredentialItemRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnCredentialItemRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnCredentialItemRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnCredentialItemRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnCredentialItemRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnCredentialItemRsp + * @throws IOException if the JSON string is invalid with respect to WebAuthnCredentialItemRsp + */ + public static WebAuthnCredentialItemRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnCredentialItemRsp.class); + } + + /** + * Convert an instance of WebAuthnCredentialItemRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnCredentialListRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnCredentialListRsp.java new file mode 100644 index 0000000..d636758 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnCredentialListRsp.java @@ -0,0 +1,378 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.WebAuthnCredentialItemRsp; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnCredentialListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnCredentialListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_ROWS = "rows"; + @SerializedName(SERIALIZED_NAME_ROWS) + private List rows = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public WebAuthnCredentialListRsp() { + } + + public WebAuthnCredentialListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebAuthnCredentialListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebAuthnCredentialListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebAuthnCredentialListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebAuthnCredentialListRsp rows(List rows) { + this.rows = rows; + return this; + } + + public WebAuthnCredentialListRsp addRowsItem(WebAuthnCredentialItemRsp rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * @return rows + **/ + @javax.annotation.Nonnull + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + + public WebAuthnCredentialListRsp paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnCredentialListRsp webAuthnCredentialListRsp = (WebAuthnCredentialListRsp) o; + return Objects.equals(this.httpStatusCode, webAuthnCredentialListRsp.httpStatusCode) && + Objects.equals(this.message, webAuthnCredentialListRsp.message) && + Objects.equals(this.requestData, webAuthnCredentialListRsp.requestData) && + Objects.equals(this.runtime, webAuthnCredentialListRsp.runtime) && + Objects.equals(this.rows, webAuthnCredentialListRsp.rows) && + Objects.equals(this.paging, webAuthnCredentialListRsp.paging); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, rows, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnCredentialListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("rows"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("rows"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnCredentialListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnCredentialListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnCredentialListRsp is not found in the empty JSON string", WebAuthnCredentialListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnCredentialListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnCredentialListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnCredentialListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rows` to be an array in the JSON string but got `%s`", jsonObj.get("rows").toString())); + } + + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + // validate the required field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + WebAuthnCredentialItemRsp.validateJsonElement(jsonArrayrows.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnCredentialListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnCredentialListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnCredentialListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnCredentialListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnCredentialListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnCredentialListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnCredentialListRsp + * @throws IOException if the JSON string is invalid with respect to WebAuthnCredentialListRsp + */ + public static WebAuthnCredentialListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnCredentialListRsp.class); + } + + /** + * Convert an instance of WebAuthnCredentialListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnCredentialReq.java b/src/main/java/com/corbado/generated/model/WebAuthnCredentialReq.java new file mode 100644 index 0000000..565e335 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnCredentialReq.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnCredentialReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnCredentialReq { + /** + * Gets or Sets status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + PENDING("pending"), + + ACTIVE("active"), + + DELETED("deleted"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public WebAuthnCredentialReq() { + } + + public WebAuthnCredentialReq status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public WebAuthnCredentialReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public WebAuthnCredentialReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnCredentialReq webAuthnCredentialReq = (WebAuthnCredentialReq) o; + return Objects.equals(this.status, webAuthnCredentialReq.status) && + Objects.equals(this.requestID, webAuthnCredentialReq.requestID) && + Objects.equals(this.clientInfo, webAuthnCredentialReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(status, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnCredentialReq {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnCredentialReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnCredentialReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnCredentialReq is not found in the empty JSON string", WebAuthnCredentialReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnCredentialReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnCredentialReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnCredentialReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnCredentialReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnCredentialReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnCredentialReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnCredentialReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnCredentialReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnCredentialReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnCredentialReq + * @throws IOException if the JSON string is invalid with respect to WebAuthnCredentialReq + */ + public static WebAuthnCredentialReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnCredentialReq.class); + } + + /** + * Convert an instance of WebAuthnCredentialReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnCredentialRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnCredentialRsp.java new file mode 100644 index 0000000..a985f4b --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnCredentialRsp.java @@ -0,0 +1,386 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnCredentialRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnCredentialRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + /** + * Status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + PENDING("pending"), + + ACTIVE("active"), + + DELETED("deleted"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public WebAuthnCredentialRsp() { + } + + public WebAuthnCredentialRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebAuthnCredentialRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebAuthnCredentialRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebAuthnCredentialRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebAuthnCredentialRsp status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Status + * @return status + **/ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnCredentialRsp webAuthnCredentialRsp = (WebAuthnCredentialRsp) o; + return Objects.equals(this.httpStatusCode, webAuthnCredentialRsp.httpStatusCode) && + Objects.equals(this.message, webAuthnCredentialRsp.message) && + Objects.equals(this.requestData, webAuthnCredentialRsp.requestData) && + Objects.equals(this.runtime, webAuthnCredentialRsp.runtime) && + Objects.equals(this.status, webAuthnCredentialRsp.status); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnCredentialRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnCredentialRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnCredentialRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnCredentialRsp is not found in the empty JSON string", WebAuthnCredentialRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnCredentialRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnCredentialRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnCredentialRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnCredentialRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnCredentialRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnCredentialRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnCredentialRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnCredentialRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnCredentialRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnCredentialRsp + * @throws IOException if the JSON string is invalid with respect to WebAuthnCredentialRsp + */ + public static WebAuthnCredentialRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnCredentialRsp.class); + } + + /** + * Convert an instance of WebAuthnCredentialRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnFinishReq.java b/src/main/java/com/corbado/generated/model/WebAuthnFinishReq.java new file mode 100644 index 0000000..54369d7 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnFinishReq.java @@ -0,0 +1,273 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnFinishReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnFinishReq { + public static final String SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL = "publicKeyCredential"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL) + private String publicKeyCredential; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public WebAuthnFinishReq() { + } + + public WebAuthnFinishReq publicKeyCredential(String publicKeyCredential) { + this.publicKeyCredential = publicKeyCredential; + return this; + } + + /** + * Contains JSON payload data for Passkeys (Biometrics) login finish challenge + * @return publicKeyCredential + **/ + @javax.annotation.Nonnull + public String getPublicKeyCredential() { + return publicKeyCredential; + } + + public void setPublicKeyCredential(String publicKeyCredential) { + this.publicKeyCredential = publicKeyCredential; + } + + + public WebAuthnFinishReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public WebAuthnFinishReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nonnull + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnFinishReq webAuthnFinishReq = (WebAuthnFinishReq) o; + return Objects.equals(this.publicKeyCredential, webAuthnFinishReq.publicKeyCredential) && + Objects.equals(this.requestID, webAuthnFinishReq.requestID) && + Objects.equals(this.clientInfo, webAuthnFinishReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(publicKeyCredential, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnFinishReq {\n"); + sb.append(" publicKeyCredential: ").append(toIndentedString(publicKeyCredential)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("publicKeyCredential"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("publicKeyCredential"); + openapiRequiredFields.add("clientInfo"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnFinishReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnFinishReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnFinishReq is not found in the empty JSON string", WebAuthnFinishReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnFinishReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnFinishReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnFinishReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("publicKeyCredential").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKeyCredential` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKeyCredential").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the required field `clientInfo` + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnFinishReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnFinishReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnFinishReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnFinishReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnFinishReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnFinishReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnFinishReq + * @throws IOException if the JSON string is invalid with respect to WebAuthnFinishReq + */ + public static WebAuthnFinishReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnFinishReq.class); + } + + /** + * Convert an instance of WebAuthnFinishReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnMediationStartReq.java b/src/main/java/com/corbado/generated/model/WebAuthnMediationStartReq.java new file mode 100644 index 0000000..2f5a22d --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnMediationStartReq.java @@ -0,0 +1,272 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnMediationStartReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnMediationStartReq { + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public WebAuthnMediationStartReq() { + } + + public WebAuthnMediationStartReq username(String username) { + this.username = username; + return this; + } + + /** + * Optional limits possible credentials matching to username + * @return username + **/ + @javax.annotation.Nullable + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + public WebAuthnMediationStartReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public WebAuthnMediationStartReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nonnull + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnMediationStartReq webAuthnMediationStartReq = (WebAuthnMediationStartReq) o; + return Objects.equals(this.username, webAuthnMediationStartReq.username) && + Objects.equals(this.requestID, webAuthnMediationStartReq.requestID) && + Objects.equals(this.clientInfo, webAuthnMediationStartReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(username, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnMediationStartReq {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("username"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("clientInfo"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnMediationStartReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnMediationStartReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnMediationStartReq is not found in the empty JSON string", WebAuthnMediationStartReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnMediationStartReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnMediationStartReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnMediationStartReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the required field `clientInfo` + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnMediationStartReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnMediationStartReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnMediationStartReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnMediationStartReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnMediationStartReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnMediationStartReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnMediationStartReq + * @throws IOException if the JSON string is invalid with respect to WebAuthnMediationStartReq + */ + public static WebAuthnMediationStartReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnMediationStartReq.class); + } + + /** + * Convert an instance of WebAuthnMediationStartReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnMediationStartRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnMediationStartRsp.java new file mode 100644 index 0000000..61b5b6b --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnMediationStartRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnMediationStartRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnMediationStartRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_CHALLENGE = "challenge"; + @SerializedName(SERIALIZED_NAME_CHALLENGE) + private String challenge; + + public WebAuthnMediationStartRsp() { + } + + public WebAuthnMediationStartRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebAuthnMediationStartRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebAuthnMediationStartRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebAuthnMediationStartRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebAuthnMediationStartRsp challenge(String challenge) { + this.challenge = challenge; + return this; + } + + /** + * Contains JSON payload data to start Passkeys (Biometrics) login challenge + * @return challenge + **/ + @javax.annotation.Nonnull + public String getChallenge() { + return challenge; + } + + public void setChallenge(String challenge) { + this.challenge = challenge; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnMediationStartRsp webAuthnMediationStartRsp = (WebAuthnMediationStartRsp) o; + return Objects.equals(this.httpStatusCode, webAuthnMediationStartRsp.httpStatusCode) && + Objects.equals(this.message, webAuthnMediationStartRsp.message) && + Objects.equals(this.requestData, webAuthnMediationStartRsp.requestData) && + Objects.equals(this.runtime, webAuthnMediationStartRsp.runtime) && + Objects.equals(this.challenge, webAuthnMediationStartRsp.challenge); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, challenge); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnMediationStartRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" challenge: ").append(toIndentedString(challenge)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("challenge"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("challenge"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnMediationStartRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnMediationStartRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnMediationStartRsp is not found in the empty JSON string", WebAuthnMediationStartRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnMediationStartRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnMediationStartRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnMediationStartRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("challenge").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `challenge` to be a primitive type in the JSON string but got `%s`", jsonObj.get("challenge").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnMediationStartRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnMediationStartRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnMediationStartRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnMediationStartRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnMediationStartRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnMediationStartRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnMediationStartRsp + * @throws IOException if the JSON string is invalid with respect to WebAuthnMediationStartRsp + */ + public static WebAuthnMediationStartRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnMediationStartRsp.class); + } + + /** + * Convert an instance of WebAuthnMediationStartRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnRegisterFinishRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnRegisterFinishRsp.java new file mode 100644 index 0000000..0ba5ad3 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnRegisterFinishRsp.java @@ -0,0 +1,503 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnRegisterFinishRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnRegisterFinishRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_CREDENTIAL_I_D = "credentialID"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_I_D) + private String credentialID; + + public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; + @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) + private String userFullName; + + /** + * Status represents information if user sign up was successful or if the user with provided credentials already exists + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("success"), + + DUPLICATE("duplicate"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public WebAuthnRegisterFinishRsp() { + } + + public WebAuthnRegisterFinishRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebAuthnRegisterFinishRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebAuthnRegisterFinishRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebAuthnRegisterFinishRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebAuthnRegisterFinishRsp userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + **/ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public WebAuthnRegisterFinishRsp username(String username) { + this.username = username; + return this; + } + + /** + * Username of current challenge + * @return username + **/ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + public WebAuthnRegisterFinishRsp credentialID(String credentialID) { + this.credentialID = credentialID; + return this; + } + + /** + * Used credential ID + * @return credentialID + **/ + @javax.annotation.Nonnull + public String getCredentialID() { + return credentialID; + } + + public void setCredentialID(String credentialID) { + this.credentialID = credentialID; + } + + + public WebAuthnRegisterFinishRsp userFullName(String userFullName) { + this.userFullName = userFullName; + return this; + } + + /** + * Optional user's full name to be used if the user wasn't found and needs to be created first + * @return userFullName + **/ + @javax.annotation.Nullable + public String getUserFullName() { + return userFullName; + } + + public void setUserFullName(String userFullName) { + this.userFullName = userFullName; + } + + + public WebAuthnRegisterFinishRsp status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Status represents information if user sign up was successful or if the user with provided credentials already exists + * @return status + **/ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnRegisterFinishRsp webAuthnRegisterFinishRsp = (WebAuthnRegisterFinishRsp) o; + return Objects.equals(this.httpStatusCode, webAuthnRegisterFinishRsp.httpStatusCode) && + Objects.equals(this.message, webAuthnRegisterFinishRsp.message) && + Objects.equals(this.requestData, webAuthnRegisterFinishRsp.requestData) && + Objects.equals(this.runtime, webAuthnRegisterFinishRsp.runtime) && + Objects.equals(this.userID, webAuthnRegisterFinishRsp.userID) && + Objects.equals(this.username, webAuthnRegisterFinishRsp.username) && + Objects.equals(this.credentialID, webAuthnRegisterFinishRsp.credentialID) && + Objects.equals(this.userFullName, webAuthnRegisterFinishRsp.userFullName) && + Objects.equals(this.status, webAuthnRegisterFinishRsp.status); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, userID, username, credentialID, userFullName, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnRegisterFinishRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" credentialID: ").append(toIndentedString(credentialID)).append("\n"); + sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("userID"); + openapiFields.add("username"); + openapiFields.add("credentialID"); + openapiFields.add("userFullName"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("credentialID"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnRegisterFinishRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnRegisterFinishRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnRegisterFinishRsp is not found in the empty JSON string", WebAuthnRegisterFinishRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnRegisterFinishRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnRegisterFinishRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnRegisterFinishRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("credentialID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `credentialID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialID").toString())); + } + if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnRegisterFinishRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnRegisterFinishRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnRegisterFinishRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnRegisterFinishRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnRegisterFinishRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnRegisterFinishRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnRegisterFinishRsp + * @throws IOException if the JSON string is invalid with respect to WebAuthnRegisterFinishRsp + */ + public static WebAuthnRegisterFinishRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnRegisterFinishRsp.class); + } + + /** + * Convert an instance of WebAuthnRegisterFinishRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnRegisterStartReq.java b/src/main/java/com/corbado/generated/model/WebAuthnRegisterStartReq.java new file mode 100644 index 0000000..55e4291 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnRegisterStartReq.java @@ -0,0 +1,387 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnRegisterStartReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnRegisterStartReq { + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; + @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) + private String userFullName; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + /** + * Sets credential status into active and pending. Pending status dont allow a login until the credential gets confirmed by an api call. + */ + @JsonAdapter(CredentialStatusEnum.Adapter.class) + public enum CredentialStatusEnum { + ACTIVE("active"), + + PENDING("pending"); + + private String value; + + CredentialStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CredentialStatusEnum fromValue(String value) { + for (CredentialStatusEnum b : CredentialStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CredentialStatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CredentialStatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CredentialStatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CredentialStatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CREDENTIAL_STATUS = "credentialStatus"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_STATUS) + private CredentialStatusEnum credentialStatus = CredentialStatusEnum.PENDING; + + public WebAuthnRegisterStartReq() { + } + + public WebAuthnRegisterStartReq username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + public WebAuthnRegisterStartReq userFullName(String userFullName) { + this.userFullName = userFullName; + return this; + } + + /** + * Optional user's full name to be used if the user wasn't found and needs to be created first + * @return userFullName + **/ + @javax.annotation.Nullable + public String getUserFullName() { + return userFullName; + } + + public void setUserFullName(String userFullName) { + this.userFullName = userFullName; + } + + + public WebAuthnRegisterStartReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public WebAuthnRegisterStartReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nonnull + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + public WebAuthnRegisterStartReq credentialStatus(CredentialStatusEnum credentialStatus) { + this.credentialStatus = credentialStatus; + return this; + } + + /** + * Sets credential status into active and pending. Pending status dont allow a login until the credential gets confirmed by an api call. + * @return credentialStatus + **/ + @javax.annotation.Nullable + public CredentialStatusEnum getCredentialStatus() { + return credentialStatus; + } + + public void setCredentialStatus(CredentialStatusEnum credentialStatus) { + this.credentialStatus = credentialStatus; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnRegisterStartReq webAuthnRegisterStartReq = (WebAuthnRegisterStartReq) o; + return Objects.equals(this.username, webAuthnRegisterStartReq.username) && + Objects.equals(this.userFullName, webAuthnRegisterStartReq.userFullName) && + Objects.equals(this.requestID, webAuthnRegisterStartReq.requestID) && + Objects.equals(this.clientInfo, webAuthnRegisterStartReq.clientInfo) && + Objects.equals(this.credentialStatus, webAuthnRegisterStartReq.credentialStatus); + } + + @Override + public int hashCode() { + return Objects.hash(username, userFullName, requestID, clientInfo, credentialStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnRegisterStartReq {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append(" credentialStatus: ").append(toIndentedString(credentialStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("username"); + openapiFields.add("userFullName"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + openapiFields.add("credentialStatus"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("clientInfo"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnRegisterStartReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnRegisterStartReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnRegisterStartReq is not found in the empty JSON string", WebAuthnRegisterStartReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnRegisterStartReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnRegisterStartReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnRegisterStartReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the required field `clientInfo` + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + if ((jsonObj.get("credentialStatus") != null && !jsonObj.get("credentialStatus").isJsonNull()) && !jsonObj.get("credentialStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `credentialStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialStatus").toString())); + } + // validate the optional field `credentialStatus` + if (jsonObj.get("credentialStatus") != null && !jsonObj.get("credentialStatus").isJsonNull()) { + CredentialStatusEnum.validateJsonElement(jsonObj.get("credentialStatus")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnRegisterStartReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnRegisterStartReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnRegisterStartReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnRegisterStartReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnRegisterStartReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnRegisterStartReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnRegisterStartReq + * @throws IOException if the JSON string is invalid with respect to WebAuthnRegisterStartReq + */ + public static WebAuthnRegisterStartReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnRegisterStartReq.class); + } + + /** + * Convert an instance of WebAuthnRegisterStartReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebAuthnRegisterStartRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnRegisterStartRsp.java new file mode 100644 index 0000000..2a5a841 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebAuthnRegisterStartRsp.java @@ -0,0 +1,414 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebAuthnRegisterStartRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebAuthnRegisterStartRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + /** + * Status represents information if user signup was successful or the user with its credentials already exists + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCESS("success"), + + DUPLICATE("duplicate"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL_CREATION_OPTIONS = "publicKeyCredentialCreationOptions"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL_CREATION_OPTIONS) + private String publicKeyCredentialCreationOptions; + + public WebAuthnRegisterStartRsp() { + } + + public WebAuthnRegisterStartRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebAuthnRegisterStartRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebAuthnRegisterStartRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebAuthnRegisterStartRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebAuthnRegisterStartRsp status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Status represents information if user signup was successful or the user with its credentials already exists + * @return status + **/ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public WebAuthnRegisterStartRsp publicKeyCredentialCreationOptions(String publicKeyCredentialCreationOptions) { + this.publicKeyCredentialCreationOptions = publicKeyCredentialCreationOptions; + return this; + } + + /** + * Contains JSON payload data to start Passkeys (Biometrics) sign up challenge + * @return publicKeyCredentialCreationOptions + **/ + @javax.annotation.Nonnull + public String getPublicKeyCredentialCreationOptions() { + return publicKeyCredentialCreationOptions; + } + + public void setPublicKeyCredentialCreationOptions(String publicKeyCredentialCreationOptions) { + this.publicKeyCredentialCreationOptions = publicKeyCredentialCreationOptions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebAuthnRegisterStartRsp webAuthnRegisterStartRsp = (WebAuthnRegisterStartRsp) o; + return Objects.equals(this.httpStatusCode, webAuthnRegisterStartRsp.httpStatusCode) && + Objects.equals(this.message, webAuthnRegisterStartRsp.message) && + Objects.equals(this.requestData, webAuthnRegisterStartRsp.requestData) && + Objects.equals(this.runtime, webAuthnRegisterStartRsp.runtime) && + Objects.equals(this.status, webAuthnRegisterStartRsp.status) && + Objects.equals(this.publicKeyCredentialCreationOptions, webAuthnRegisterStartRsp.publicKeyCredentialCreationOptions); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, status, publicKeyCredentialCreationOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebAuthnRegisterStartRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" publicKeyCredentialCreationOptions: ").append(toIndentedString(publicKeyCredentialCreationOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("status"); + openapiFields.add("publicKeyCredentialCreationOptions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("publicKeyCredentialCreationOptions"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebAuthnRegisterStartRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebAuthnRegisterStartRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnRegisterStartRsp is not found in the empty JSON string", WebAuthnRegisterStartRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebAuthnRegisterStartRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnRegisterStartRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebAuthnRegisterStartRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + if (!jsonObj.get("publicKeyCredentialCreationOptions").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKeyCredentialCreationOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKeyCredentialCreationOptions").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebAuthnRegisterStartRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebAuthnRegisterStartRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnRegisterStartRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebAuthnRegisterStartRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebAuthnRegisterStartRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebAuthnRegisterStartRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebAuthnRegisterStartRsp + * @throws IOException if the JSON string is invalid with respect to WebAuthnRegisterStartRsp + */ + public static WebAuthnRegisterStartRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebAuthnRegisterStartRsp.class); + } + + /** + * Convert an instance of WebAuthnRegisterStartRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingCreate.java b/src/main/java/com/corbado/generated/model/WebauthnSettingCreate.java new file mode 100644 index 0000000..5a06738 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebauthnSettingCreate.java @@ -0,0 +1,244 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebauthnSettingCreate + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebauthnSettingCreate { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ORIGIN = "origin"; + @SerializedName(SERIALIZED_NAME_ORIGIN) + private String origin; + + public WebauthnSettingCreate() { + } + + public WebauthnSettingCreate name(String name) { + this.name = name; + return this; + } + + /** + * Name of this setting + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public WebauthnSettingCreate origin(String origin) { + this.origin = origin; + return this; + } + + /** + * Define here either a url incl. schema or an android-apk-key-hash + * @return origin + **/ + @javax.annotation.Nonnull + public String getOrigin() { + return origin; + } + + public void setOrigin(String origin) { + this.origin = origin; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebauthnSettingCreate webauthnSettingCreate = (WebauthnSettingCreate) o; + return Objects.equals(this.name, webauthnSettingCreate.name) && + Objects.equals(this.origin, webauthnSettingCreate.origin); + } + + @Override + public int hashCode() { + return Objects.hash(name, origin); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebauthnSettingCreate {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("origin"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("origin"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingCreate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebauthnSettingCreate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingCreate is not found in the empty JSON string", WebauthnSettingCreate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebauthnSettingCreate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingCreate` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebauthnSettingCreate.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("origin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebauthnSettingCreate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebauthnSettingCreate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingCreate.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebauthnSettingCreate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebauthnSettingCreate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebauthnSettingCreate given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebauthnSettingCreate + * @throws IOException if the JSON string is invalid with respect to WebauthnSettingCreate + */ + public static WebauthnSettingCreate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebauthnSettingCreate.class); + } + + /** + * Convert an instance of WebauthnSettingCreate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingCreateReq.java b/src/main/java/com/corbado/generated/model/WebauthnSettingCreateReq.java new file mode 100644 index 0000000..1b226a5 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebauthnSettingCreateReq.java @@ -0,0 +1,304 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebauthnSettingCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebauthnSettingCreateReq { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ORIGIN = "origin"; + @SerializedName(SERIALIZED_NAME_ORIGIN) + private String origin; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public WebauthnSettingCreateReq() { + } + + public WebauthnSettingCreateReq name(String name) { + this.name = name; + return this; + } + + /** + * Name of this setting + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public WebauthnSettingCreateReq origin(String origin) { + this.origin = origin; + return this; + } + + /** + * Define here either a url incl. schema or an android-apk-key-hash + * @return origin + **/ + @javax.annotation.Nonnull + public String getOrigin() { + return origin; + } + + public void setOrigin(String origin) { + this.origin = origin; + } + + + public WebauthnSettingCreateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public WebauthnSettingCreateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebauthnSettingCreateReq webauthnSettingCreateReq = (WebauthnSettingCreateReq) o; + return Objects.equals(this.name, webauthnSettingCreateReq.name) && + Objects.equals(this.origin, webauthnSettingCreateReq.origin) && + Objects.equals(this.requestID, webauthnSettingCreateReq.requestID) && + Objects.equals(this.clientInfo, webauthnSettingCreateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(name, origin, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebauthnSettingCreateReq {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("origin"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("origin"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebauthnSettingCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingCreateReq is not found in the empty JSON string", WebauthnSettingCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebauthnSettingCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebauthnSettingCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("origin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebauthnSettingCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebauthnSettingCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebauthnSettingCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebauthnSettingCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebauthnSettingCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebauthnSettingCreateReq + * @throws IOException if the JSON string is invalid with respect to WebauthnSettingCreateReq + */ + public static WebauthnSettingCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebauthnSettingCreateReq.class); + } + + /** + * Convert an instance of WebauthnSettingCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingCreateRsp.java b/src/main/java/com/corbado/generated/model/WebauthnSettingCreateRsp.java new file mode 100644 index 0000000..100b011 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebauthnSettingCreateRsp.java @@ -0,0 +1,450 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebauthnSettingCreateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebauthnSettingCreateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ORIGIN = "origin"; + @SerializedName(SERIALIZED_NAME_ORIGIN) + private String origin; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public WebauthnSettingCreateRsp() { + } + + public WebauthnSettingCreateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebauthnSettingCreateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebauthnSettingCreateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebauthnSettingCreateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebauthnSettingCreateRsp name(String name) { + this.name = name; + return this; + } + + /** + * Name of this setting + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public WebauthnSettingCreateRsp origin(String origin) { + this.origin = origin; + return this; + } + + /** + * Define here either a url incl. schema or an android-apk-key-hash + * @return origin + **/ + @javax.annotation.Nonnull + public String getOrigin() { + return origin; + } + + public void setOrigin(String origin) { + this.origin = origin; + } + + + public WebauthnSettingCreateRsp id(String id) { + this.id = id; + return this; + } + + /** + * ID of WebAuthn setting + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public WebauthnSettingCreateRsp created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public WebauthnSettingCreateRsp updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebauthnSettingCreateRsp webauthnSettingCreateRsp = (WebauthnSettingCreateRsp) o; + return Objects.equals(this.httpStatusCode, webauthnSettingCreateRsp.httpStatusCode) && + Objects.equals(this.message, webauthnSettingCreateRsp.message) && + Objects.equals(this.requestData, webauthnSettingCreateRsp.requestData) && + Objects.equals(this.runtime, webauthnSettingCreateRsp.runtime) && + Objects.equals(this.name, webauthnSettingCreateRsp.name) && + Objects.equals(this.origin, webauthnSettingCreateRsp.origin) && + Objects.equals(this.id, webauthnSettingCreateRsp.id) && + Objects.equals(this.created, webauthnSettingCreateRsp.created) && + Objects.equals(this.updated, webauthnSettingCreateRsp.updated); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, name, origin, id, created, updated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebauthnSettingCreateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("name"); + openapiFields.add("origin"); + openapiFields.add("id"); + openapiFields.add("created"); + openapiFields.add("updated"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("origin"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingCreateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebauthnSettingCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingCreateRsp is not found in the empty JSON string", WebauthnSettingCreateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebauthnSettingCreateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebauthnSettingCreateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("origin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebauthnSettingCreateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebauthnSettingCreateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingCreateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebauthnSettingCreateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebauthnSettingCreateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebauthnSettingCreateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebauthnSettingCreateRsp + * @throws IOException if the JSON string is invalid with respect to WebauthnSettingCreateRsp + */ + public static WebauthnSettingCreateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebauthnSettingCreateRsp.class); + } + + /** + * Convert an instance of WebauthnSettingCreateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingDeleteReq.java b/src/main/java/com/corbado/generated/model/WebauthnSettingDeleteReq.java new file mode 100644 index 0000000..2d11133 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebauthnSettingDeleteReq.java @@ -0,0 +1,237 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebauthnSettingDeleteReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebauthnSettingDeleteReq { + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public WebauthnSettingDeleteReq() { + } + + public WebauthnSettingDeleteReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public WebauthnSettingDeleteReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebauthnSettingDeleteReq webauthnSettingDeleteReq = (WebauthnSettingDeleteReq) o; + return Objects.equals(this.requestID, webauthnSettingDeleteReq.requestID) && + Objects.equals(this.clientInfo, webauthnSettingDeleteReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebauthnSettingDeleteReq {\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingDeleteReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebauthnSettingDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingDeleteReq is not found in the empty JSON string", WebauthnSettingDeleteReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebauthnSettingDeleteReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebauthnSettingDeleteReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebauthnSettingDeleteReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingDeleteReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebauthnSettingDeleteReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebauthnSettingDeleteReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebauthnSettingDeleteReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebauthnSettingDeleteReq + * @throws IOException if the JSON string is invalid with respect to WebauthnSettingDeleteReq + */ + public static WebauthnSettingDeleteReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebauthnSettingDeleteReq.class); + } + + /** + * Convert an instance of WebauthnSettingDeleteReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingGetRsp.java b/src/main/java/com/corbado/generated/model/WebauthnSettingGetRsp.java new file mode 100644 index 0000000..254ac0c --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebauthnSettingGetRsp.java @@ -0,0 +1,450 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebauthnSettingGetRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebauthnSettingGetRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ORIGIN = "origin"; + @SerializedName(SERIALIZED_NAME_ORIGIN) + private String origin; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public WebauthnSettingGetRsp() { + } + + public WebauthnSettingGetRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebauthnSettingGetRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebauthnSettingGetRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebauthnSettingGetRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebauthnSettingGetRsp name(String name) { + this.name = name; + return this; + } + + /** + * Name of this setting + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public WebauthnSettingGetRsp origin(String origin) { + this.origin = origin; + return this; + } + + /** + * Define here either a url incl. schema or an android-apk-key-hash + * @return origin + **/ + @javax.annotation.Nonnull + public String getOrigin() { + return origin; + } + + public void setOrigin(String origin) { + this.origin = origin; + } + + + public WebauthnSettingGetRsp id(String id) { + this.id = id; + return this; + } + + /** + * ID of WebAuthn setting + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public WebauthnSettingGetRsp created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public WebauthnSettingGetRsp updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebauthnSettingGetRsp webauthnSettingGetRsp = (WebauthnSettingGetRsp) o; + return Objects.equals(this.httpStatusCode, webauthnSettingGetRsp.httpStatusCode) && + Objects.equals(this.message, webauthnSettingGetRsp.message) && + Objects.equals(this.requestData, webauthnSettingGetRsp.requestData) && + Objects.equals(this.runtime, webauthnSettingGetRsp.runtime) && + Objects.equals(this.name, webauthnSettingGetRsp.name) && + Objects.equals(this.origin, webauthnSettingGetRsp.origin) && + Objects.equals(this.id, webauthnSettingGetRsp.id) && + Objects.equals(this.created, webauthnSettingGetRsp.created) && + Objects.equals(this.updated, webauthnSettingGetRsp.updated); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, name, origin, id, created, updated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebauthnSettingGetRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("name"); + openapiFields.add("origin"); + openapiFields.add("id"); + openapiFields.add("created"); + openapiFields.add("updated"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("origin"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingGetRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebauthnSettingGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingGetRsp is not found in the empty JSON string", WebauthnSettingGetRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebauthnSettingGetRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebauthnSettingGetRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("origin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebauthnSettingGetRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebauthnSettingGetRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingGetRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebauthnSettingGetRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebauthnSettingGetRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebauthnSettingGetRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebauthnSettingGetRsp + * @throws IOException if the JSON string is invalid with respect to WebauthnSettingGetRsp + */ + public static WebauthnSettingGetRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebauthnSettingGetRsp.class); + } + + /** + * Convert an instance of WebauthnSettingGetRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingItem.java b/src/main/java/com/corbado/generated/model/WebauthnSettingItem.java new file mode 100644 index 0000000..2248692 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebauthnSettingItem.java @@ -0,0 +1,334 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebauthnSettingItem + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebauthnSettingItem { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ORIGIN = "origin"; + @SerializedName(SERIALIZED_NAME_ORIGIN) + private String origin; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public WebauthnSettingItem() { + } + + public WebauthnSettingItem name(String name) { + this.name = name; + return this; + } + + /** + * Name of this setting + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public WebauthnSettingItem origin(String origin) { + this.origin = origin; + return this; + } + + /** + * Define here either a url incl. schema or an android-apk-key-hash + * @return origin + **/ + @javax.annotation.Nonnull + public String getOrigin() { + return origin; + } + + public void setOrigin(String origin) { + this.origin = origin; + } + + + public WebauthnSettingItem id(String id) { + this.id = id; + return this; + } + + /** + * ID of WebAuthn setting + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public WebauthnSettingItem created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public WebauthnSettingItem updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebauthnSettingItem webauthnSettingItem = (WebauthnSettingItem) o; + return Objects.equals(this.name, webauthnSettingItem.name) && + Objects.equals(this.origin, webauthnSettingItem.origin) && + Objects.equals(this.id, webauthnSettingItem.id) && + Objects.equals(this.created, webauthnSettingItem.created) && + Objects.equals(this.updated, webauthnSettingItem.updated); + } + + @Override + public int hashCode() { + return Objects.hash(name, origin, id, created, updated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebauthnSettingItem {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("origin"); + openapiFields.add("id"); + openapiFields.add("created"); + openapiFields.add("updated"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("origin"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebauthnSettingItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingItem is not found in the empty JSON string", WebauthnSettingItem.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebauthnSettingItem.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingItem` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebauthnSettingItem.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("origin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebauthnSettingItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebauthnSettingItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebauthnSettingItem value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebauthnSettingItem read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebauthnSettingItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebauthnSettingItem + * @throws IOException if the JSON string is invalid with respect to WebauthnSettingItem + */ + public static WebauthnSettingItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebauthnSettingItem.class); + } + + /** + * Convert an instance of WebauthnSettingItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingListRsp.java b/src/main/java/com/corbado/generated/model/WebauthnSettingListRsp.java new file mode 100644 index 0000000..0841c61 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebauthnSettingListRsp.java @@ -0,0 +1,378 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.WebauthnSettingItem; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebauthnSettingListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebauthnSettingListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_ROWS = "rows"; + @SerializedName(SERIALIZED_NAME_ROWS) + private List rows = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public WebauthnSettingListRsp() { + } + + public WebauthnSettingListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebauthnSettingListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebauthnSettingListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebauthnSettingListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebauthnSettingListRsp rows(List rows) { + this.rows = rows; + return this; + } + + public WebauthnSettingListRsp addRowsItem(WebauthnSettingItem rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * @return rows + **/ + @javax.annotation.Nonnull + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + + public WebauthnSettingListRsp paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebauthnSettingListRsp webauthnSettingListRsp = (WebauthnSettingListRsp) o; + return Objects.equals(this.httpStatusCode, webauthnSettingListRsp.httpStatusCode) && + Objects.equals(this.message, webauthnSettingListRsp.message) && + Objects.equals(this.requestData, webauthnSettingListRsp.requestData) && + Objects.equals(this.runtime, webauthnSettingListRsp.runtime) && + Objects.equals(this.rows, webauthnSettingListRsp.rows) && + Objects.equals(this.paging, webauthnSettingListRsp.paging); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, rows, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebauthnSettingListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("rows"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("rows"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebauthnSettingListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingListRsp is not found in the empty JSON string", WebauthnSettingListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebauthnSettingListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebauthnSettingListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rows` to be an array in the JSON string but got `%s`", jsonObj.get("rows").toString())); + } + + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + // validate the required field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + WebauthnSettingItem.validateJsonElement(jsonArrayrows.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebauthnSettingListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebauthnSettingListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebauthnSettingListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebauthnSettingListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebauthnSettingListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebauthnSettingListRsp + * @throws IOException if the JSON string is invalid with respect to WebauthnSettingListRsp + */ + public static WebauthnSettingListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebauthnSettingListRsp.class); + } + + /** + * Convert an instance of WebauthnSettingListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingUpdateReq.java b/src/main/java/com/corbado/generated/model/WebauthnSettingUpdateReq.java new file mode 100644 index 0000000..4a842e6 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebauthnSettingUpdateReq.java @@ -0,0 +1,304 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebauthnSettingUpdateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebauthnSettingUpdateReq { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ORIGIN = "origin"; + @SerializedName(SERIALIZED_NAME_ORIGIN) + private String origin; + + public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; + @SerializedName(SERIALIZED_NAME_REQUEST_I_D) + private String requestID; + + public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFO) + private ClientInfo clientInfo; + + public WebauthnSettingUpdateReq() { + } + + public WebauthnSettingUpdateReq name(String name) { + this.name = name; + return this; + } + + /** + * Name of this setting + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public WebauthnSettingUpdateReq origin(String origin) { + this.origin = origin; + return this; + } + + /** + * Define here either a url incl. schema or an android-apk-key-hash + * @return origin + **/ + @javax.annotation.Nonnull + public String getOrigin() { + return origin; + } + + public void setOrigin(String origin) { + this.origin = origin; + } + + + public WebauthnSettingUpdateReq requestID(String requestID) { + this.requestID = requestID; + return this; + } + + /** + * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side + * @return requestID + **/ + @javax.annotation.Nullable + public String getRequestID() { + return requestID; + } + + public void setRequestID(String requestID) { + this.requestID = requestID; + } + + + public WebauthnSettingUpdateReq clientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + return this; + } + + /** + * Get clientInfo + * @return clientInfo + **/ + @javax.annotation.Nullable + public ClientInfo getClientInfo() { + return clientInfo; + } + + public void setClientInfo(ClientInfo clientInfo) { + this.clientInfo = clientInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebauthnSettingUpdateReq webauthnSettingUpdateReq = (WebauthnSettingUpdateReq) o; + return Objects.equals(this.name, webauthnSettingUpdateReq.name) && + Objects.equals(this.origin, webauthnSettingUpdateReq.origin) && + Objects.equals(this.requestID, webauthnSettingUpdateReq.requestID) && + Objects.equals(this.clientInfo, webauthnSettingUpdateReq.clientInfo); + } + + @Override + public int hashCode() { + return Objects.hash(name, origin, requestID, clientInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebauthnSettingUpdateReq {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); + sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("origin"); + openapiFields.add("requestID"); + openapiFields.add("clientInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("origin"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingUpdateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebauthnSettingUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingUpdateReq is not found in the empty JSON string", WebauthnSettingUpdateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebauthnSettingUpdateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebauthnSettingUpdateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("origin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); + } + if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); + } + // validate the optional field `clientInfo` + if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { + ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebauthnSettingUpdateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebauthnSettingUpdateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingUpdateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebauthnSettingUpdateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebauthnSettingUpdateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebauthnSettingUpdateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebauthnSettingUpdateReq + * @throws IOException if the JSON string is invalid with respect to WebauthnSettingUpdateReq + */ + public static WebauthnSettingUpdateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebauthnSettingUpdateReq.class); + } + + /** + * Convert an instance of WebauthnSettingUpdateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingUpdateRsp.java b/src/main/java/com/corbado/generated/model/WebauthnSettingUpdateRsp.java new file mode 100644 index 0000000..5ced0f3 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebauthnSettingUpdateRsp.java @@ -0,0 +1,450 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebauthnSettingUpdateRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebauthnSettingUpdateRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ORIGIN = "origin"; + @SerializedName(SERIALIZED_NAME_ORIGIN) + private String origin; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_UPDATED = "updated"; + @SerializedName(SERIALIZED_NAME_UPDATED) + private String updated; + + public WebauthnSettingUpdateRsp() { + } + + public WebauthnSettingUpdateRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebauthnSettingUpdateRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebauthnSettingUpdateRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebauthnSettingUpdateRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebauthnSettingUpdateRsp name(String name) { + this.name = name; + return this; + } + + /** + * Name of this setting + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public WebauthnSettingUpdateRsp origin(String origin) { + this.origin = origin; + return this; + } + + /** + * Define here either a url incl. schema or an android-apk-key-hash + * @return origin + **/ + @javax.annotation.Nonnull + public String getOrigin() { + return origin; + } + + public void setOrigin(String origin) { + this.origin = origin; + } + + + public WebauthnSettingUpdateRsp id(String id) { + this.id = id; + return this; + } + + /** + * ID of WebAuthn setting + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public WebauthnSettingUpdateRsp created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public WebauthnSettingUpdateRsp updated(String updated) { + this.updated = updated; + return this; + } + + /** + * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format + * @return updated + **/ + @javax.annotation.Nonnull + public String getUpdated() { + return updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebauthnSettingUpdateRsp webauthnSettingUpdateRsp = (WebauthnSettingUpdateRsp) o; + return Objects.equals(this.httpStatusCode, webauthnSettingUpdateRsp.httpStatusCode) && + Objects.equals(this.message, webauthnSettingUpdateRsp.message) && + Objects.equals(this.requestData, webauthnSettingUpdateRsp.requestData) && + Objects.equals(this.runtime, webauthnSettingUpdateRsp.runtime) && + Objects.equals(this.name, webauthnSettingUpdateRsp.name) && + Objects.equals(this.origin, webauthnSettingUpdateRsp.origin) && + Objects.equals(this.id, webauthnSettingUpdateRsp.id) && + Objects.equals(this.created, webauthnSettingUpdateRsp.created) && + Objects.equals(this.updated, webauthnSettingUpdateRsp.updated); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, name, origin, id, created, updated); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebauthnSettingUpdateRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("name"); + openapiFields.add("origin"); + openapiFields.add("id"); + openapiFields.add("created"); + openapiFields.add("updated"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("origin"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("updated"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingUpdateRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebauthnSettingUpdateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingUpdateRsp is not found in the empty JSON string", WebauthnSettingUpdateRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebauthnSettingUpdateRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingUpdateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebauthnSettingUpdateRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("origin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("updated").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebauthnSettingUpdateRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebauthnSettingUpdateRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingUpdateRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebauthnSettingUpdateRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebauthnSettingUpdateRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebauthnSettingUpdateRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebauthnSettingUpdateRsp + * @throws IOException if the JSON string is invalid with respect to WebauthnSettingUpdateRsp + */ + public static WebauthnSettingUpdateRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebauthnSettingUpdateRsp.class); + } + + /** + * Convert an instance of WebauthnSettingUpdateRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticator.java b/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticator.java new file mode 100644 index 0000000..a208b83 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticator.java @@ -0,0 +1,241 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebauthnStatsAuthenticator + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebauthnStatsAuthenticator { + public static final String SERIALIZED_NAME_TOTAL_PASSKEYS = "totalPasskeys"; + @SerializedName(SERIALIZED_NAME_TOTAL_PASSKEYS) + private Integer totalPasskeys; + + public static final String SERIALIZED_NAME_AUTHENTICATOR_NAME = "authenticatorName"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATOR_NAME) + private String authenticatorName; + + public WebauthnStatsAuthenticator() { + } + + public WebauthnStatsAuthenticator totalPasskeys(Integer totalPasskeys) { + this.totalPasskeys = totalPasskeys; + return this; + } + + /** + * Get totalPasskeys + * @return totalPasskeys + **/ + @javax.annotation.Nonnull + public Integer getTotalPasskeys() { + return totalPasskeys; + } + + public void setTotalPasskeys(Integer totalPasskeys) { + this.totalPasskeys = totalPasskeys; + } + + + public WebauthnStatsAuthenticator authenticatorName(String authenticatorName) { + this.authenticatorName = authenticatorName; + return this; + } + + /** + * Get authenticatorName + * @return authenticatorName + **/ + @javax.annotation.Nonnull + public String getAuthenticatorName() { + return authenticatorName; + } + + public void setAuthenticatorName(String authenticatorName) { + this.authenticatorName = authenticatorName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebauthnStatsAuthenticator webauthnStatsAuthenticator = (WebauthnStatsAuthenticator) o; + return Objects.equals(this.totalPasskeys, webauthnStatsAuthenticator.totalPasskeys) && + Objects.equals(this.authenticatorName, webauthnStatsAuthenticator.authenticatorName); + } + + @Override + public int hashCode() { + return Objects.hash(totalPasskeys, authenticatorName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebauthnStatsAuthenticator {\n"); + sb.append(" totalPasskeys: ").append(toIndentedString(totalPasskeys)).append("\n"); + sb.append(" authenticatorName: ").append(toIndentedString(authenticatorName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("totalPasskeys"); + openapiFields.add("authenticatorName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("totalPasskeys"); + openapiRequiredFields.add("authenticatorName"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebauthnStatsAuthenticator + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebauthnStatsAuthenticator.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnStatsAuthenticator is not found in the empty JSON string", WebauthnStatsAuthenticator.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebauthnStatsAuthenticator.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnStatsAuthenticator` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebauthnStatsAuthenticator.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("authenticatorName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authenticatorName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticatorName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebauthnStatsAuthenticator.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebauthnStatsAuthenticator' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebauthnStatsAuthenticator.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebauthnStatsAuthenticator value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebauthnStatsAuthenticator read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebauthnStatsAuthenticator given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebauthnStatsAuthenticator + * @throws IOException if the JSON string is invalid with respect to WebauthnStatsAuthenticator + */ + public static WebauthnStatsAuthenticator fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebauthnStatsAuthenticator.class); + } + + /** + * Convert an instance of WebauthnStatsAuthenticator to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRsp.java b/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRsp.java new file mode 100644 index 0000000..233291d --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.WebauthnStatsAuthenticatorRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebauthnStatsAuthenticatorRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebauthnStatsAuthenticatorRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private WebauthnStatsAuthenticatorRspAllOfData data; + + public WebauthnStatsAuthenticatorRsp() { + } + + public WebauthnStatsAuthenticatorRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebauthnStatsAuthenticatorRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebauthnStatsAuthenticatorRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebauthnStatsAuthenticatorRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebauthnStatsAuthenticatorRsp data(WebauthnStatsAuthenticatorRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public WebauthnStatsAuthenticatorRspAllOfData getData() { + return data; + } + + public void setData(WebauthnStatsAuthenticatorRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebauthnStatsAuthenticatorRsp webauthnStatsAuthenticatorRsp = (WebauthnStatsAuthenticatorRsp) o; + return Objects.equals(this.httpStatusCode, webauthnStatsAuthenticatorRsp.httpStatusCode) && + Objects.equals(this.message, webauthnStatsAuthenticatorRsp.message) && + Objects.equals(this.requestData, webauthnStatsAuthenticatorRsp.requestData) && + Objects.equals(this.runtime, webauthnStatsAuthenticatorRsp.runtime) && + Objects.equals(this.data, webauthnStatsAuthenticatorRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebauthnStatsAuthenticatorRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebauthnStatsAuthenticatorRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebauthnStatsAuthenticatorRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnStatsAuthenticatorRsp is not found in the empty JSON string", WebauthnStatsAuthenticatorRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebauthnStatsAuthenticatorRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnStatsAuthenticatorRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebauthnStatsAuthenticatorRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + WebauthnStatsAuthenticatorRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebauthnStatsAuthenticatorRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebauthnStatsAuthenticatorRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebauthnStatsAuthenticatorRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebauthnStatsAuthenticatorRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebauthnStatsAuthenticatorRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebauthnStatsAuthenticatorRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebauthnStatsAuthenticatorRsp + * @throws IOException if the JSON string is invalid with respect to WebauthnStatsAuthenticatorRsp + */ + public static WebauthnStatsAuthenticatorRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebauthnStatsAuthenticatorRsp.class); + } + + /** + * Convert an instance of WebauthnStatsAuthenticatorRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRspAllOfData.java b/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRspAllOfData.java new file mode 100644 index 0000000..45bee41 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRspAllOfData.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.WebauthnStatsAuthenticator; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebauthnStatsAuthenticatorRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebauthnStatsAuthenticatorRspAllOfData { + public static final String SERIALIZED_NAME_STATS = "stats"; + @SerializedName(SERIALIZED_NAME_STATS) + private List stats = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public WebauthnStatsAuthenticatorRspAllOfData() { + } + + public WebauthnStatsAuthenticatorRspAllOfData stats(List stats) { + this.stats = stats; + return this; + } + + public WebauthnStatsAuthenticatorRspAllOfData addStatsItem(WebauthnStatsAuthenticator statsItem) { + if (this.stats == null) { + this.stats = new ArrayList<>(); + } + this.stats.add(statsItem); + return this; + } + + /** + * Get stats + * @return stats + **/ + @javax.annotation.Nonnull + public List getStats() { + return stats; + } + + public void setStats(List stats) { + this.stats = stats; + } + + + public WebauthnStatsAuthenticatorRspAllOfData paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebauthnStatsAuthenticatorRspAllOfData webauthnStatsAuthenticatorRspAllOfData = (WebauthnStatsAuthenticatorRspAllOfData) o; + return Objects.equals(this.stats, webauthnStatsAuthenticatorRspAllOfData.stats) && + Objects.equals(this.paging, webauthnStatsAuthenticatorRspAllOfData.paging); + } + + @Override + public int hashCode() { + return Objects.hash(stats, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebauthnStatsAuthenticatorRspAllOfData {\n"); + sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stats"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("stats"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebauthnStatsAuthenticatorRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebauthnStatsAuthenticatorRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnStatsAuthenticatorRspAllOfData is not found in the empty JSON string", WebauthnStatsAuthenticatorRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebauthnStatsAuthenticatorRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnStatsAuthenticatorRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebauthnStatsAuthenticatorRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("stats").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); + } + + JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); + // validate the required field `stats` (array) + for (int i = 0; i < jsonArraystats.size(); i++) { + WebauthnStatsAuthenticator.validateJsonElement(jsonArraystats.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebauthnStatsAuthenticatorRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebauthnStatsAuthenticatorRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebauthnStatsAuthenticatorRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebauthnStatsAuthenticatorRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebauthnStatsAuthenticatorRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebauthnStatsAuthenticatorRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebauthnStatsAuthenticatorRspAllOfData + * @throws IOException if the JSON string is invalid with respect to WebauthnStatsAuthenticatorRspAllOfData + */ + public static WebauthnStatsAuthenticatorRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebauthnStatsAuthenticatorRspAllOfData.class); + } + + /** + * Convert an instance of WebauthnStatsAuthenticatorRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebauthnStatsType.java b/src/main/java/com/corbado/generated/model/WebauthnStatsType.java new file mode 100644 index 0000000..52881cb --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebauthnStatsType.java @@ -0,0 +1,291 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebauthnStatsType + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebauthnStatsType { + public static final String SERIALIZED_NAME_TOTAL_PASSKEYS = "totalPasskeys"; + @SerializedName(SERIALIZED_NAME_TOTAL_PASSKEYS) + private Integer totalPasskeys; + + public static final String SERIALIZED_NAME_PASSKEYS = "passkeys"; + @SerializedName(SERIALIZED_NAME_PASSKEYS) + private Integer passkeys; + + public static final String SERIALIZED_NAME_SYNCED_PASSKEYS = "syncedPasskeys"; + @SerializedName(SERIALIZED_NAME_SYNCED_PASSKEYS) + private Integer syncedPasskeys; + + public static final String SERIALIZED_NAME_HYBRID_PASSKEYS = "hybridPasskeys"; + @SerializedName(SERIALIZED_NAME_HYBRID_PASSKEYS) + private Integer hybridPasskeys; + + public WebauthnStatsType() { + } + + public WebauthnStatsType totalPasskeys(Integer totalPasskeys) { + this.totalPasskeys = totalPasskeys; + return this; + } + + /** + * Get totalPasskeys + * @return totalPasskeys + **/ + @javax.annotation.Nonnull + public Integer getTotalPasskeys() { + return totalPasskeys; + } + + public void setTotalPasskeys(Integer totalPasskeys) { + this.totalPasskeys = totalPasskeys; + } + + + public WebauthnStatsType passkeys(Integer passkeys) { + this.passkeys = passkeys; + return this; + } + + /** + * Get passkeys + * @return passkeys + **/ + @javax.annotation.Nullable + public Integer getPasskeys() { + return passkeys; + } + + public void setPasskeys(Integer passkeys) { + this.passkeys = passkeys; + } + + + public WebauthnStatsType syncedPasskeys(Integer syncedPasskeys) { + this.syncedPasskeys = syncedPasskeys; + return this; + } + + /** + * Get syncedPasskeys + * @return syncedPasskeys + **/ + @javax.annotation.Nonnull + public Integer getSyncedPasskeys() { + return syncedPasskeys; + } + + public void setSyncedPasskeys(Integer syncedPasskeys) { + this.syncedPasskeys = syncedPasskeys; + } + + + public WebauthnStatsType hybridPasskeys(Integer hybridPasskeys) { + this.hybridPasskeys = hybridPasskeys; + return this; + } + + /** + * Get hybridPasskeys + * @return hybridPasskeys + **/ + @javax.annotation.Nonnull + public Integer getHybridPasskeys() { + return hybridPasskeys; + } + + public void setHybridPasskeys(Integer hybridPasskeys) { + this.hybridPasskeys = hybridPasskeys; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebauthnStatsType webauthnStatsType = (WebauthnStatsType) o; + return Objects.equals(this.totalPasskeys, webauthnStatsType.totalPasskeys) && + Objects.equals(this.passkeys, webauthnStatsType.passkeys) && + Objects.equals(this.syncedPasskeys, webauthnStatsType.syncedPasskeys) && + Objects.equals(this.hybridPasskeys, webauthnStatsType.hybridPasskeys); + } + + @Override + public int hashCode() { + return Objects.hash(totalPasskeys, passkeys, syncedPasskeys, hybridPasskeys); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebauthnStatsType {\n"); + sb.append(" totalPasskeys: ").append(toIndentedString(totalPasskeys)).append("\n"); + sb.append(" passkeys: ").append(toIndentedString(passkeys)).append("\n"); + sb.append(" syncedPasskeys: ").append(toIndentedString(syncedPasskeys)).append("\n"); + sb.append(" hybridPasskeys: ").append(toIndentedString(hybridPasskeys)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("totalPasskeys"); + openapiFields.add("passkeys"); + openapiFields.add("syncedPasskeys"); + openapiFields.add("hybridPasskeys"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("totalPasskeys"); + openapiRequiredFields.add("syncedPasskeys"); + openapiRequiredFields.add("hybridPasskeys"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebauthnStatsType + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebauthnStatsType.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnStatsType is not found in the empty JSON string", WebauthnStatsType.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebauthnStatsType.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnStatsType` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebauthnStatsType.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebauthnStatsType.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebauthnStatsType' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebauthnStatsType.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebauthnStatsType value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebauthnStatsType read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebauthnStatsType given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebauthnStatsType + * @throws IOException if the JSON string is invalid with respect to WebauthnStatsType + */ + public static WebauthnStatsType fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebauthnStatsType.class); + } + + /** + * Convert an instance of WebauthnStatsType to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebauthnStatsTypeRsp.java b/src/main/java/com/corbado/generated/model/WebauthnStatsTypeRsp.java new file mode 100644 index 0000000..420709f --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebauthnStatsTypeRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.WebauthnStatsTypeRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebauthnStatsTypeRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebauthnStatsTypeRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private WebauthnStatsTypeRspAllOfData data; + + public WebauthnStatsTypeRsp() { + } + + public WebauthnStatsTypeRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebauthnStatsTypeRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebauthnStatsTypeRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebauthnStatsTypeRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebauthnStatsTypeRsp data(WebauthnStatsTypeRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public WebauthnStatsTypeRspAllOfData getData() { + return data; + } + + public void setData(WebauthnStatsTypeRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebauthnStatsTypeRsp webauthnStatsTypeRsp = (WebauthnStatsTypeRsp) o; + return Objects.equals(this.httpStatusCode, webauthnStatsTypeRsp.httpStatusCode) && + Objects.equals(this.message, webauthnStatsTypeRsp.message) && + Objects.equals(this.requestData, webauthnStatsTypeRsp.requestData) && + Objects.equals(this.runtime, webauthnStatsTypeRsp.runtime) && + Objects.equals(this.data, webauthnStatsTypeRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebauthnStatsTypeRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebauthnStatsTypeRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebauthnStatsTypeRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnStatsTypeRsp is not found in the empty JSON string", WebauthnStatsTypeRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebauthnStatsTypeRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnStatsTypeRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebauthnStatsTypeRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + WebauthnStatsTypeRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebauthnStatsTypeRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebauthnStatsTypeRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebauthnStatsTypeRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebauthnStatsTypeRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebauthnStatsTypeRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebauthnStatsTypeRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebauthnStatsTypeRsp + * @throws IOException if the JSON string is invalid with respect to WebauthnStatsTypeRsp + */ + public static WebauthnStatsTypeRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebauthnStatsTypeRsp.class); + } + + /** + * Convert an instance of WebauthnStatsTypeRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebauthnStatsTypeRspAllOfData.java b/src/main/java/com/corbado/generated/model/WebauthnStatsTypeRspAllOfData.java new file mode 100644 index 0000000..a796789 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebauthnStatsTypeRspAllOfData.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.WebauthnStatsType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebauthnStatsTypeRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebauthnStatsTypeRspAllOfData { + public static final String SERIALIZED_NAME_STATS = "stats"; + @SerializedName(SERIALIZED_NAME_STATS) + private List stats = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public WebauthnStatsTypeRspAllOfData() { + } + + public WebauthnStatsTypeRspAllOfData stats(List stats) { + this.stats = stats; + return this; + } + + public WebauthnStatsTypeRspAllOfData addStatsItem(WebauthnStatsType statsItem) { + if (this.stats == null) { + this.stats = new ArrayList<>(); + } + this.stats.add(statsItem); + return this; + } + + /** + * Get stats + * @return stats + **/ + @javax.annotation.Nonnull + public List getStats() { + return stats; + } + + public void setStats(List stats) { + this.stats = stats; + } + + + public WebauthnStatsTypeRspAllOfData paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebauthnStatsTypeRspAllOfData webauthnStatsTypeRspAllOfData = (WebauthnStatsTypeRspAllOfData) o; + return Objects.equals(this.stats, webauthnStatsTypeRspAllOfData.stats) && + Objects.equals(this.paging, webauthnStatsTypeRspAllOfData.paging); + } + + @Override + public int hashCode() { + return Objects.hash(stats, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebauthnStatsTypeRspAllOfData {\n"); + sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stats"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("stats"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebauthnStatsTypeRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebauthnStatsTypeRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnStatsTypeRspAllOfData is not found in the empty JSON string", WebauthnStatsTypeRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebauthnStatsTypeRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnStatsTypeRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebauthnStatsTypeRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("stats").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); + } + + JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); + // validate the required field `stats` (array) + for (int i = 0; i < jsonArraystats.size(); i++) { + WebauthnStatsType.validateJsonElement(jsonArraystats.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebauthnStatsTypeRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebauthnStatsTypeRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebauthnStatsTypeRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebauthnStatsTypeRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebauthnStatsTypeRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebauthnStatsTypeRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebauthnStatsTypeRspAllOfData + * @throws IOException if the JSON string is invalid with respect to WebauthnStatsTypeRspAllOfData + */ + public static WebauthnStatsTypeRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebauthnStatsTypeRspAllOfData.class); + } + + /** + * Convert an instance of WebauthnStatsTypeRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebhookLog.java b/src/main/java/com/corbado/generated/model/WebhookLog.java new file mode 100644 index 0000000..2b1f19f --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebhookLog.java @@ -0,0 +1,535 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * Webhook log entry + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebhookLog { + public static final String SERIALIZED_NAME_WEBHOOK_I_D = "webhookID"; + @SerializedName(SERIALIZED_NAME_WEBHOOK_I_D) + private String webhookID; + + public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; + @SerializedName(SERIALIZED_NAME_PROJECT_I_D) + private String projectID; + + public static final String SERIALIZED_NAME_ACTION = "action"; + @SerializedName(SERIALIZED_NAME_ACTION) + private String action; + + public static final String SERIALIZED_NAME_RESPONSE_I_D = "responseID"; + @SerializedName(SERIALIZED_NAME_RESPONSE_I_D) + private String responseID; + + public static final String SERIALIZED_NAME_REQUEST_U_R_L = "requestURL"; + @SerializedName(SERIALIZED_NAME_REQUEST_U_R_L) + private String requestURL; + + public static final String SERIALIZED_NAME_REQUEST_BODY = "requestBody"; + @SerializedName(SERIALIZED_NAME_REQUEST_BODY) + private String requestBody; + + public static final String SERIALIZED_NAME_RESPONSE_STATUS = "responseStatus"; + @SerializedName(SERIALIZED_NAME_RESPONSE_STATUS) + private Integer responseStatus; + + public static final String SERIALIZED_NAME_RESPONSE_HEADERS = "responseHeaders"; + @SerializedName(SERIALIZED_NAME_RESPONSE_HEADERS) + private Object responseHeaders; + + public static final String SERIALIZED_NAME_RESPONSE_BODY = "responseBody"; + @SerializedName(SERIALIZED_NAME_RESPONSE_BODY) + private String responseBody; + + public static final String SERIALIZED_NAME_RESPONSE_ERROR = "responseError"; + @SerializedName(SERIALIZED_NAME_RESPONSE_ERROR) + private String responseError; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public WebhookLog() { + } + + public WebhookLog webhookID(String webhookID) { + this.webhookID = webhookID; + return this; + } + + /** + * Unique ID of webhook request which will be randomly generated on server side + * @return webhookID + **/ + @javax.annotation.Nonnull + public String getWebhookID() { + return webhookID; + } + + public void setWebhookID(String webhookID) { + this.webhookID = webhookID; + } + + + public WebhookLog projectID(String projectID) { + this.projectID = projectID; + return this; + } + + /** + * ID of project + * @return projectID + **/ + @javax.annotation.Nonnull + public String getProjectID() { + return projectID; + } + + public void setProjectID(String projectID) { + this.projectID = projectID; + } + + + public WebhookLog action(String action) { + this.action = action; + return this; + } + + /** + * Webhook action + * @return action + **/ + @javax.annotation.Nonnull + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + + public WebhookLog responseID(String responseID) { + this.responseID = responseID; + return this; + } + + /** + * Unique ID of response, you can provide your own while responding to the webhook, if not the ID will be randomly generated on server side. This has the same meaning as overriding requestID for API requests. + * @return responseID + **/ + @javax.annotation.Nonnull + public String getResponseID() { + return responseID; + } + + public void setResponseID(String responseID) { + this.responseID = responseID; + } + + + public WebhookLog requestURL(String requestURL) { + this.requestURL = requestURL; + return this; + } + + /** + * Absolute request URL of webhook backend + * @return requestURL + **/ + @javax.annotation.Nonnull + public String getRequestURL() { + return requestURL; + } + + public void setRequestURL(String requestURL) { + this.requestURL = requestURL; + } + + + public WebhookLog requestBody(String requestBody) { + this.requestBody = requestBody; + return this; + } + + /** + * Request contents that were sent to webhook backend + * @return requestBody + **/ + @javax.annotation.Nonnull + public String getRequestBody() { + return requestBody; + } + + public void setRequestBody(String requestBody) { + this.requestBody = requestBody; + } + + + public WebhookLog responseStatus(Integer responseStatus) { + this.responseStatus = responseStatus; + return this; + } + + /** + * Response HTTP status that was returned by webhook backend + * @return responseStatus + **/ + @javax.annotation.Nonnull + public Integer getResponseStatus() { + return responseStatus; + } + + public void setResponseStatus(Integer responseStatus) { + this.responseStatus = responseStatus; + } + + + public WebhookLog responseHeaders(Object responseHeaders) { + this.responseHeaders = responseHeaders; + return this; + } + + /** + * Response HTTP headers that were returned by webhook backend + * @return responseHeaders + **/ + @javax.annotation.Nonnull + public Object getResponseHeaders() { + return responseHeaders; + } + + public void setResponseHeaders(Object responseHeaders) { + this.responseHeaders = responseHeaders; + } + + + public WebhookLog responseBody(String responseBody) { + this.responseBody = responseBody; + return this; + } + + /** + * Response body JSON data that was returned by webhook backend + * @return responseBody + **/ + @javax.annotation.Nonnull + public String getResponseBody() { + return responseBody; + } + + public void setResponseBody(String responseBody) { + this.responseBody = responseBody; + } + + + public WebhookLog responseError(String responseError) { + this.responseError = responseError; + return this; + } + + /** + * Response error if present + * @return responseError + **/ + @javax.annotation.Nonnull + public String getResponseError() { + return responseError; + } + + public void setResponseError(String responseError) { + this.responseError = responseError; + } + + + public WebhookLog runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebhookLog created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the request was performed in RFC3339 format + * @return created + **/ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookLog webhookLog = (WebhookLog) o; + return Objects.equals(this.webhookID, webhookLog.webhookID) && + Objects.equals(this.projectID, webhookLog.projectID) && + Objects.equals(this.action, webhookLog.action) && + Objects.equals(this.responseID, webhookLog.responseID) && + Objects.equals(this.requestURL, webhookLog.requestURL) && + Objects.equals(this.requestBody, webhookLog.requestBody) && + Objects.equals(this.responseStatus, webhookLog.responseStatus) && + Objects.equals(this.responseHeaders, webhookLog.responseHeaders) && + Objects.equals(this.responseBody, webhookLog.responseBody) && + Objects.equals(this.responseError, webhookLog.responseError) && + Objects.equals(this.runtime, webhookLog.runtime) && + Objects.equals(this.created, webhookLog.created); + } + + @Override + public int hashCode() { + return Objects.hash(webhookID, projectID, action, responseID, requestURL, requestBody, responseStatus, responseHeaders, responseBody, responseError, runtime, created); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookLog {\n"); + sb.append(" webhookID: ").append(toIndentedString(webhookID)).append("\n"); + sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" responseID: ").append(toIndentedString(responseID)).append("\n"); + sb.append(" requestURL: ").append(toIndentedString(requestURL)).append("\n"); + sb.append(" requestBody: ").append(toIndentedString(requestBody)).append("\n"); + sb.append(" responseStatus: ").append(toIndentedString(responseStatus)).append("\n"); + sb.append(" responseHeaders: ").append(toIndentedString(responseHeaders)).append("\n"); + sb.append(" responseBody: ").append(toIndentedString(responseBody)).append("\n"); + sb.append(" responseError: ").append(toIndentedString(responseError)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("webhookID"); + openapiFields.add("projectID"); + openapiFields.add("action"); + openapiFields.add("responseID"); + openapiFields.add("requestURL"); + openapiFields.add("requestBody"); + openapiFields.add("responseStatus"); + openapiFields.add("responseHeaders"); + openapiFields.add("responseBody"); + openapiFields.add("responseError"); + openapiFields.add("runtime"); + openapiFields.add("created"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("webhookID"); + openapiRequiredFields.add("projectID"); + openapiRequiredFields.add("action"); + openapiRequiredFields.add("responseID"); + openapiRequiredFields.add("requestURL"); + openapiRequiredFields.add("requestBody"); + openapiRequiredFields.add("responseStatus"); + openapiRequiredFields.add("responseHeaders"); + openapiRequiredFields.add("responseBody"); + openapiRequiredFields.add("responseError"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("created"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebhookLog + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookLog is not found in the empty JSON string", WebhookLog.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebhookLog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookLog` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookLog.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("webhookID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `webhookID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookID").toString())); + } + if (!jsonObj.get("projectID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); + } + if (!jsonObj.get("action").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString())); + } + if (!jsonObj.get("responseID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `responseID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseID").toString())); + } + if (!jsonObj.get("requestURL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestURL").toString())); + } + if (!jsonObj.get("requestBody").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestBody` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestBody").toString())); + } + if (!jsonObj.get("responseBody").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `responseBody` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseBody").toString())); + } + if (!jsonObj.get("responseError").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `responseError` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseError").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebhookLog.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookLog' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookLog.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebhookLog value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebhookLog read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookLog given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookLog + * @throws IOException if the JSON string is invalid with respect to WebhookLog + */ + public static WebhookLog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookLog.class); + } + + /** + * Convert an instance of WebhookLog to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebhookLogsListRsp.java b/src/main/java/com/corbado/generated/model/WebhookLogsListRsp.java new file mode 100644 index 0000000..846f1af --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebhookLogsListRsp.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.RequestData; +import com.corbado.generated.model.WebhookLogsListRspAllOfData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebhookLogsListRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebhookLogsListRsp { + public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; + @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) + private Integer httpStatusCode; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; + @SerializedName(SERIALIZED_NAME_REQUEST_DATA) + private RequestData requestData; + + public static final String SERIALIZED_NAME_RUNTIME = "runtime"; + @SerializedName(SERIALIZED_NAME_RUNTIME) + private Float runtime; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private WebhookLogsListRspAllOfData data; + + public WebhookLogsListRsp() { + } + + public WebhookLogsListRsp httpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + + /** + * HTTP status code of operation + * minimum: 200 + * maximum: 599 + * @return httpStatusCode + **/ + @javax.annotation.Nonnull + public Integer getHttpStatusCode() { + return httpStatusCode; + } + + public void setHttpStatusCode(Integer httpStatusCode) { + this.httpStatusCode = httpStatusCode; + } + + + public WebhookLogsListRsp message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + public WebhookLogsListRsp requestData(RequestData requestData) { + this.requestData = requestData; + return this; + } + + /** + * Get requestData + * @return requestData + **/ + @javax.annotation.Nonnull + public RequestData getRequestData() { + return requestData; + } + + public void setRequestData(RequestData requestData) { + this.requestData = requestData; + } + + + public WebhookLogsListRsp runtime(Float runtime) { + this.runtime = runtime; + return this; + } + + /** + * Runtime in seconds for this request + * @return runtime + **/ + @javax.annotation.Nonnull + public Float getRuntime() { + return runtime; + } + + public void setRuntime(Float runtime) { + this.runtime = runtime; + } + + + public WebhookLogsListRsp data(WebhookLogsListRspAllOfData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public WebhookLogsListRspAllOfData getData() { + return data; + } + + public void setData(WebhookLogsListRspAllOfData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookLogsListRsp webhookLogsListRsp = (WebhookLogsListRsp) o; + return Objects.equals(this.httpStatusCode, webhookLogsListRsp.httpStatusCode) && + Objects.equals(this.message, webhookLogsListRsp.message) && + Objects.equals(this.requestData, webhookLogsListRsp.requestData) && + Objects.equals(this.runtime, webhookLogsListRsp.runtime) && + Objects.equals(this.data, webhookLogsListRsp.data); + } + + @Override + public int hashCode() { + return Objects.hash(httpStatusCode, message, requestData, runtime, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookLogsListRsp {\n"); + sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); + sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("httpStatusCode"); + openapiFields.add("message"); + openapiFields.add("requestData"); + openapiFields.add("runtime"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("httpStatusCode"); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("requestData"); + openapiRequiredFields.add("runtime"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebhookLogsListRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookLogsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookLogsListRsp is not found in the empty JSON string", WebhookLogsListRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebhookLogsListRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookLogsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookLogsListRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the required field `requestData` + RequestData.validateJsonElement(jsonObj.get("requestData")); + // validate the required field `data` + WebhookLogsListRspAllOfData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebhookLogsListRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookLogsListRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookLogsListRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebhookLogsListRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebhookLogsListRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookLogsListRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookLogsListRsp + * @throws IOException if the JSON string is invalid with respect to WebhookLogsListRsp + */ + public static WebhookLogsListRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookLogsListRsp.class); + } + + /** + * Convert an instance of WebhookLogsListRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/WebhookLogsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/WebhookLogsListRspAllOfData.java new file mode 100644 index 0000000..1392ab6 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/WebhookLogsListRspAllOfData.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.WebhookLog; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * WebhookLogsListRspAllOfData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +public class WebhookLogsListRspAllOfData { + public static final String SERIALIZED_NAME_LOGS = "logs"; + @SerializedName(SERIALIZED_NAME_LOGS) + private List logs = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public WebhookLogsListRspAllOfData() { + } + + public WebhookLogsListRspAllOfData logs(List logs) { + this.logs = logs; + return this; + } + + public WebhookLogsListRspAllOfData addLogsItem(WebhookLog logsItem) { + if (this.logs == null) { + this.logs = new ArrayList<>(); + } + this.logs.add(logsItem); + return this; + } + + /** + * Get logs + * @return logs + **/ + @javax.annotation.Nonnull + public List getLogs() { + return logs; + } + + public void setLogs(List logs) { + this.logs = logs; + } + + + public WebhookLogsListRspAllOfData paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + **/ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookLogsListRspAllOfData webhookLogsListRspAllOfData = (WebhookLogsListRspAllOfData) o; + return Objects.equals(this.logs, webhookLogsListRspAllOfData.logs) && + Objects.equals(this.paging, webhookLogsListRspAllOfData.paging); + } + + @Override + public int hashCode() { + return Objects.hash(logs, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookLogsListRspAllOfData {\n"); + sb.append(" logs: ").append(toIndentedString(logs)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("logs"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("logs"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WebhookLogsListRspAllOfData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookLogsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookLogsListRspAllOfData is not found in the empty JSON string", WebhookLogsListRspAllOfData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!WebhookLogsListRspAllOfData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookLogsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookLogsListRspAllOfData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("logs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `logs` to be an array in the JSON string but got `%s`", jsonObj.get("logs").toString())); + } + + JsonArray jsonArraylogs = jsonObj.getAsJsonArray("logs"); + // validate the required field `logs` (array) + for (int i = 0; i < jsonArraylogs.size(); i++) { + WebhookLog.validateJsonElement(jsonArraylogs.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebhookLogsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookLogsListRspAllOfData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookLogsListRspAllOfData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebhookLogsListRspAllOfData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebhookLogsListRspAllOfData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookLogsListRspAllOfData given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookLogsListRspAllOfData + * @throws IOException if the JSON string is invalid with respect to WebhookLogsListRspAllOfData + */ + public static WebhookLogsListRspAllOfData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookLogsListRspAllOfData.class); + } + + /** + * Convert an instance of WebhookLogsListRspAllOfData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/resources/checkstyle.xml b/src/main/resources/checkstyle.xml index feb49c9..69aeba8 100644 --- a/src/main/resources/checkstyle.xml +++ b/src/main/resources/checkstyle.xml @@ -268,8 +268,8 @@ Checkstyle configuration that checks the Google coding conventions from Google J
- - + + diff --git a/src/main/resources/findbugs-exclude.xml b/src/main/resources/findbugs-exclude.xml new file mode 100644 index 0000000..b1755a1 --- /dev/null +++ b/src/main/resources/findbugs-exclude.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main/resources/suppressions.xml b/src/main/resources/suppressions.xml index b94beaf..0f082bf 100644 --- a/src/main/resources/suppressions.xml +++ b/src/main/resources/suppressions.xml @@ -12,4 +12,7 @@ + + + \ No newline at end of file From 976522dc66dce0c45df7796e35099cfe6129b590 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 28 Jun 2024 18:27:40 +0200 Subject: [PATCH 03/59] add simple ci --- .github/workflows/ci.yml | 89 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9573355 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,89 @@ +name: CI + +on: + workflow_dispatch: {} + push: + branches: + - master + - beta + - sdk-release/** + - feature/** + - development + tags: + - v[0-9]+.[0-9]+.[0-9]+* + pull_request: + branches: + - master + - beta + - sdk-release/** + - feature/** + - development + +jobs: + build: + name: Build + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: Setup Java + id: setup-jre + uses: actions/setup-java@v3 + with: + java-version: "17" # always use 17 LTS for building + architecture: x64 + + - name: Set Test Java Runtime Environment variable + run: echo "JAVA_TEST_HOME=${{ steps.setup-jre.outputs.path }}" >> $GITHUB_ENV + + - name: Install dependencies + run: mvn clean install -DskipTests + + - name: Build project + run: mvn package + + test: + name: Test + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + java-version: + - "1.8" + - "11" + - "17" + - "18" + - "19" + - "20" + + steps: + - uses: actions/checkout@master + + - name: Setup Test Java Runtime + id: setup-test-jre + uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java-version }} + architecture: x64 + + - name: Set Test Java Runtime Environment variable + run: echo "JAVA_TEST_HOME=${{ steps.setup-test-jre.outputs.path }}" >> $GITHUB_ENV + + - name: Setup Java + uses: actions/setup-java@v3 + with: + java-version: "17" # always use 17 LTS for building + architecture: x64 + + + - name: Display version + run: | + echo "JAVA_TEST_HOME=$JAVA_TEST_HOME" + + - name: Run test suite + run: mvn test + From 0cc05882cb02bc8e9408617546e210eff5da01ca Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 28 Jun 2024 19:03:53 +0200 Subject: [PATCH 04/59] test ci/build --- src/main/java/com/corbado/sdk/Config.java | 8 ++++++++ .../com/corbado/sdk/{CorbadoSDK.java => CorbadoSdk.java} | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) rename src/main/java/com/corbado/sdk/{CorbadoSDK.java => CorbadoSdk.java} (81%) diff --git a/src/main/java/com/corbado/sdk/Config.java b/src/main/java/com/corbado/sdk/Config.java index 263bb95..440f953 100644 --- a/src/main/java/com/corbado/sdk/Config.java +++ b/src/main/java/com/corbado/sdk/Config.java @@ -5,4 +5,12 @@ public class Config { /** The i. */ private int i; + + public int getI() { + return this.i; + } + + public void setI(int i) { + this.i = i; + } } diff --git a/src/main/java/com/corbado/sdk/CorbadoSDK.java b/src/main/java/com/corbado/sdk/CorbadoSdk.java similarity index 81% rename from src/main/java/com/corbado/sdk/CorbadoSDK.java rename to src/main/java/com/corbado/sdk/CorbadoSdk.java index eca5e36..7409b8a 100644 --- a/src/main/java/com/corbado/sdk/CorbadoSDK.java +++ b/src/main/java/com/corbado/sdk/CorbadoSdk.java @@ -1,7 +1,7 @@ package com.corbado.sdk; -/** The Class CorbadoSDK. */ -public class CorbadoSDK { +/** The Class CorbadoSdk. */ +public class CorbadoSdk { /** The configuration class. */ private Config config; @@ -12,7 +12,7 @@ public class CorbadoSDK { * @return the config */ public Config getConfig() { - return this.config; + return config; } /** From e5ae0cdefa579e50d5ce0cfe0da27a9ca4f6fd63 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Fri, 28 Jun 2024 19:17:57 +0200 Subject: [PATCH 05/59] Update ci.yml --- .github/workflows/ci.yml | 42 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9573355..37eebe0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,27 +6,26 @@ on: branches: - master - beta - - sdk-release/** - - feature/** - - development + - 'sdk-release/**' + - 'feature/**' + - development tags: - - v[0-9]+.[0-9]+.[0-9]+* + - 'v[0-9]+.[0-9]+.[0-9]+*' pull_request: branches: - master - beta - - sdk-release/** - - feature/** - - development + - 'sdk-release/**' + - 'feature/**' + - development jobs: build: name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master + - name: Checkout repository + uses: actions/checkout@v3 - name: Setup Java id: setup-jre @@ -38,17 +37,12 @@ jobs: - name: Set Test Java Runtime Environment variable run: echo "JAVA_TEST_HOME=${{ steps.setup-jre.outputs.path }}" >> $GITHUB_ENV - - name: Install dependencies - run: mvn clean install -DskipTests - - - name: Build project - run: mvn package + - name: Install dependencies + run: mvn clean install -DskipTests test: name: Test - runs-on: ubuntu-latest - strategy: fail-fast: false matrix: @@ -59,9 +53,9 @@ jobs: - "18" - "19" - "20" - steps: - - uses: actions/checkout@master + - name: Checkout repository + uses: actions/checkout@v3 - name: Setup Test Java Runtime id: setup-test-jre @@ -73,16 +67,8 @@ jobs: - name: Set Test Java Runtime Environment variable run: echo "JAVA_TEST_HOME=${{ steps.setup-test-jre.outputs.path }}" >> $GITHUB_ENV - - name: Setup Java - uses: actions/setup-java@v3 - with: - java-version: "17" # always use 17 LTS for building - architecture: x64 - - - name: Display version - run: | - echo "JAVA_TEST_HOME=$JAVA_TEST_HOME" + run: echo "JAVA_TEST_HOME=$JAVA_TEST_HOME" - name: Run test suite run: mvn test From 78b00bb8cbd3c73112e8036657c9c0d85a2883cc Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Fri, 28 Jun 2024 19:23:27 +0200 Subject: [PATCH 06/59] Update ci.yml --- .github/workflows/ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37eebe0..ee07ca8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,13 +25,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Java id: setup-jre - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: "17" # always use 17 LTS for building + distribution: zulu architecture: x64 - name: Set Test Java Runtime Environment variable @@ -46,6 +47,7 @@ jobs: strategy: fail-fast: false matrix: + distribution: zulu java-version: - "1.8" - "11" @@ -55,13 +57,14 @@ jobs: - "20" steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Test Java Runtime id: setup-test-jre - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java-version }} + distribution: zulu architecture: x64 - name: Set Test Java Runtime Environment variable From 27662282ecc16fa2ae5a9d77cb6e0a38ad9ab3f4 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Fri, 28 Jun 2024 19:24:45 +0200 Subject: [PATCH 07/59] Update ci.yml --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee07ca8..c0978b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,6 @@ jobs: strategy: fail-fast: false matrix: - distribution: zulu java-version: - "1.8" - "11" From 2da3f9bfe68f468d6c2ba20ce8699d2a82f2570f Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 28 Jun 2024 19:29:01 +0200 Subject: [PATCH 08/59] fix path compatibility in pom.xml --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c235dad..b206312 100644 --- a/pom.xml +++ b/pom.xml @@ -190,8 +190,8 @@ 3.4.0 true - ${basedir}\src\main\resources\checkstyle.xml - ${basedir}\src\main\resources\suppressions.xml + ${basedir}/src/main/resources/checkstyle.xml + ${basedir}/src/main/resources/suppressions.xml config_loc=${basedir} From 811ba9fbeff6281d87cb3d8a42821a58bd2b3046 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 28 Jun 2024 19:31:51 +0200 Subject: [PATCH 09/59] fix java version in ci and path compatibilities --- .github/workflows/ci.yml | 2 +- src/main/resources/checkstyle.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0978b1..ffccd22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: fail-fast: false matrix: java-version: - - "1.8" + - "8" - "11" - "17" - "18" diff --git a/src/main/resources/checkstyle.xml b/src/main/resources/checkstyle.xml index 69aeba8..c3dbcbf 100644 --- a/src/main/resources/checkstyle.xml +++ b/src/main/resources/checkstyle.xml @@ -268,7 +268,7 @@ Checkstyle configuration that checks the Google coding conventions from Google J - + From b23fdacf95c2a3621aa1c24a78399a092d8c40b6 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 28 Jun 2024 19:35:38 +0200 Subject: [PATCH 10/59] add caching of maven dependencies to ci --- .github/workflows/ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ffccd22..b44d525 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,7 @@ jobs: build: name: Build runs-on: ubuntu-latest + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -38,12 +39,21 @@ jobs: - name: Set Test Java Runtime Environment variable run: echo "JAVA_TEST_HOME=${{ steps.setup-jre.outputs.path }}" >> $GITHUB_ENV + - name: Cache Maven dependencies + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Install dependencies run: mvn clean install -DskipTests test: name: Test runs-on: ubuntu-latest + strategy: fail-fast: false matrix: @@ -54,6 +64,7 @@ jobs: - "18" - "19" - "20" + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -72,6 +83,14 @@ jobs: - name: Display version run: echo "JAVA_TEST_HOME=$JAVA_TEST_HOME" + - name: Cache Maven dependencies for tests + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ matrix.java-version }}-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Run test suite run: mvn test From 748a7c25ef2d6907ea56834fbf5a2158b89f1d90 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 28 Jun 2024 20:57:33 +0200 Subject: [PATCH 11/59] fixed path issues, make checkstyle maven integration and plugin runnable with the same configuration --- pom.xml | 5 ++--- src/main/resources/checkstyle.xml | 16 +++++----------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index b206312..cf64209 100644 --- a/pom.xml +++ b/pom.xml @@ -190,9 +190,8 @@ 3.4.0 true - ${basedir}/src/main/resources/checkstyle.xml - ${basedir}/src/main/resources/suppressions.xml - config_loc=${basedir} + ${basedir}${file.separator}src${file.separator}main${file.separator}resources${file.separator}checkstyle.xml + config_loc=${basedir}${file.separator}src${file.separator}main${file.separator}resources diff --git a/src/main/resources/checkstyle.xml b/src/main/resources/checkstyle.xml index c3dbcbf..92124d1 100644 --- a/src/main/resources/checkstyle.xml +++ b/src/main/resources/checkstyle.xml @@ -5,9 +5,8 @@ This configuration file was written by the eclipse-cs plugin configuration editor --> @@ -169,7 +168,6 @@ Checkstyle configuration that checks the Google coding conventions from Google J - @@ -223,9 +221,10 @@ Checkstyle configuration that checks the Google coding conventions from Google J + - + @@ -243,10 +242,6 @@ Checkstyle configuration that checks the Google coding conventions from Google J - - - - @@ -268,8 +263,7 @@ Checkstyle configuration that checks the Google coding conventions from Google J - - + From 887301ee569511fb8182e5530f83a918a6451559 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 28 Jun 2024 21:37:59 +0200 Subject: [PATCH 12/59] Implemented Config.java --- src/main/java/com/corbado/sdk/Config.java | 177 +++++++++++++++++++++- 1 file changed, 170 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/corbado/sdk/Config.java b/src/main/java/com/corbado/sdk/Config.java index 440f953..b312e24 100644 --- a/src/main/java/com/corbado/sdk/Config.java +++ b/src/main/java/com/corbado/sdk/Config.java @@ -1,16 +1,179 @@ package com.corbado.sdk; -/** Configuration class. */ +import java.net.MalformedURLException; +import java.net.URL; + +/** + * Configuration class for setting up project parameters. + * + *

This class encapsulates project configuration details including project ID, API secret, + * backend API URL, and other parameters. It provides validation for these fields and computes + * derived properties like frontend API URL and issuer. + */ public class Config { - /** The i. */ - private int i; + // Fields + + /** The project id. */ + private String projectId; + + /** The api secret. */ + private String apiSecret; + + /** The backend api. */ + private String backendApi = "https://backendapi.corbado.io"; + + /** The short session cookie name. */ + private String shortSessionCookieName = "cbo_short_session"; + + /** The issuer. */ + private String issuer; + + /** The frontend api. */ + private String frontendApi; + + /** + * Instantiates a new config. + * + * @param projectId the project id + * @param apiSecret the api secret + */ + // Constructors + public Config(String projectId, String apiSecret) { + this.projectId = projectId; + this.apiSecret = apiSecret; + + // default values + this.frontendApi = "https://" + projectId + ".frontendapi.corbado.io"; + this.issuer = this.frontendApi; + } + + /** + * Gets the api secret. + * + * @return the api secret + */ + public String getApiSecret() { + return this.apiSecret; + } + + /** + * Gets the backend api. + * + * @return the backend api + */ + public String getBackendApi() { + return this.backendApi; + } + + /** + * Gets the frontend api. + * + * @return the frontend api + */ + public String getFrontendApi() { + return this.frontendApi; + } + + /** + * Gets the issuer. + * + * @return the issuer + */ + public String getIssuer() { + return this.issuer; + } + + // Getters and Setters + /** + * Gets the project id. + * + * @return the project id + */ + public String getProjectId() { + return this.projectId; + } + + /** + * Gets the short session cookie name. + * + * @return the short session cookie name + */ + public String getShortSessionCookieName() { + return this.shortSessionCookieName; + } + + /** + * Sets the api secret. + * + * @param apiSecret the new api secret + * @throws IllegalArgumentException If the API secret does not start with "corbado1_". + */ + public void setApiSecret(String apiSecret) { + if (!apiSecret.startsWith("corbado1_")) { + throw new IllegalArgumentException("Invalid API Secret, must start with 'corbado1_'"); + } + this.apiSecret = apiSecret; + } + + /** + * Sets the backend api. + * + * @param backendApi the new backend api + * @throws IllegalArgumentException If the URL is invalid. + */ + public void setBackendApi(String backendApi) { + try { + new URL(backendApi); // Validate URL syntax + } catch (final MalformedURLException e) { + throw new IllegalArgumentException("Invalid backend API URL: " + e.getMessage()); + } + this.backendApi = backendApi; + } + + /** + * Sets the frontend api. + * + * @param frontendApi the new frontend api + * @throws IllegalArgumentException If the URL is invalid. + */ + public void setFrontendApi(String frontendApi) { + try { + new URL(frontendApi); // Validate URL syntax + } catch (final MalformedURLException e) { + throw new IllegalArgumentException("Invalid frontend API URL: " + e.getMessage()); + } + this.frontendApi = frontendApi; + } + + /** + * Sets the issuer. + * + * @param issuer the new issuer + */ + public void setIssuer(String issuer) { + this.issuer = issuer; + } - public int getI() { - return this.i; + /** + * Sets the project id. + * + * @param projectId the new project id + * @throws IllegalArgumentException If the project Id does not start with "pro-". + */ + public void setProjectId(String projectId) { + if (!projectId.startsWith("pro-")) { + throw new IllegalArgumentException("Invalid project ID, must start with 'pro-'"); + } + this.projectId = projectId; } - public void setI(int i) { - this.i = i; + /** + * Sets the short session cookie name. + * + * @param shortSessionCookieName the new short session cookie name + */ + public void setShortSessionCookieName(String shortSessionCookieName) { + this.shortSessionCookieName = shortSessionCookieName; } } From 3b6b0a280a1a28e8ee8463e62f63e79480f30546 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 5 Jul 2024 17:07:30 +0200 Subject: [PATCH 13/59] add .env and dotenv-java for environment variables management --- .env | 3 +++ pom.xml | 39 +++++++++++++++++++++++++++++---------- 2 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..6261a44 --- /dev/null +++ b/.env @@ -0,0 +1,3 @@ +CORBADO_API_SECRET=your_api_secret +CORBADO_PROJECT_ID=your_project_id +CORBADO_BACKEND_API=your_backend_api \ No newline at end of file diff --git a/pom.xml b/pom.xml index cf64209..4b55d6a 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,16 @@ src/main/java + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + + org.apache.maven.plugins @@ -189,7 +199,6 @@ maven-checkstyle-plugin 3.4.0 - true ${basedir}${file.separator}src${file.separator}main${file.separator}resources${file.separator}checkstyle.xml config_loc=${basedir}${file.separator}src${file.separator}main${file.separator}resources @@ -200,15 +209,19 @@ 9.3 - - - validate - validate - - check - - - + + + validate + validate + + true + true + + + check + + + @@ -224,6 +237,12 @@ jsr305 3.0.2 + + io.github.cdimascio + dotenv-java + + 2.3.2 + com.squareup.okhttp3 okhttp From 09d604d5218b4ca9e95b909a02a8625bb23af714 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 5 Jul 2024 17:08:07 +0200 Subject: [PATCH 14/59] add .env to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9fa0641..f5eaadf 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /corbado-java-cs-cleanup.xml /corbado-java-cs-formatter.xml /.checkstyle +.env From dfe788f34ae29d2c72ad15204f0d06d0367231d4 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 5 Jul 2024 18:34:38 +0200 Subject: [PATCH 15/59] fix checkstyle --- src/main/resources/checkstyle.xml | 18 +++++++++++++++--- src/main/resources/suppressions.xml | 8 -------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/main/resources/checkstyle.xml b/src/main/resources/checkstyle.xml index 92124d1..038a82b 100644 --- a/src/main/resources/checkstyle.xml +++ b/src/main/resources/checkstyle.xml @@ -6,10 +6,20 @@ --> - + @@ -162,10 +172,12 @@ - + + + diff --git a/src/main/resources/suppressions.xml b/src/main/resources/suppressions.xml index 0f082bf..444d0b8 100644 --- a/src/main/resources/suppressions.xml +++ b/src/main/resources/suppressions.xml @@ -5,14 +5,6 @@ "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd"> - - - - - - - \ No newline at end of file From ee55af1a6e998306f5837450e505e83c46051b89 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 5 Jul 2024 18:37:13 +0200 Subject: [PATCH 16/59] Added working user service, test for it,test utils, and minimal SDK/config implementation --- .../com/corbado/entities/package-info.java | 4 + .../exceptions/CorbadoServerException.java | 36 + .../corbado/exceptions/StandardException.java | 11 + .../corbado/generated/invoker/ApiClient.java | 3155 +++++++++-------- src/main/java/com/corbado/sdk/Config.java | 34 +- src/main/java/com/corbado/sdk/CorbadoSdk.java | 64 + .../corbado/services/AuthTokenService.java | 3 + .../services/EmailMagicLinkService.java | 3 + .../com/corbado/services/EmailOtpService.java | 3 + .../com/corbado/services/SessionService.java | 3 + .../com/corbado/services/SmsOtpService.java | 3 + .../com/corbado/services/UserService.java | 119 + .../corbado/services/ValidationService.java | 3 + .../com/corbado/services/base/ApiService.java | 18 + src/test/java/integration/UserServiceIT.java | 122 + src/test/java/util/TestUtils.java | 99 + 16 files changed, 2135 insertions(+), 1545 deletions(-) create mode 100644 src/main/java/com/corbado/entities/package-info.java create mode 100644 src/main/java/com/corbado/exceptions/CorbadoServerException.java create mode 100644 src/main/java/com/corbado/exceptions/StandardException.java create mode 100644 src/main/java/com/corbado/services/AuthTokenService.java create mode 100644 src/main/java/com/corbado/services/EmailMagicLinkService.java create mode 100644 src/main/java/com/corbado/services/EmailOtpService.java create mode 100644 src/main/java/com/corbado/services/SessionService.java create mode 100644 src/main/java/com/corbado/services/SmsOtpService.java create mode 100644 src/main/java/com/corbado/services/UserService.java create mode 100644 src/main/java/com/corbado/services/ValidationService.java create mode 100644 src/main/java/com/corbado/services/base/ApiService.java create mode 100644 src/test/java/integration/UserServiceIT.java create mode 100644 src/test/java/util/TestUtils.java diff --git a/src/main/java/com/corbado/entities/package-info.java b/src/main/java/com/corbado/entities/package-info.java new file mode 100644 index 0000000..341974e --- /dev/null +++ b/src/main/java/com/corbado/entities/package-info.java @@ -0,0 +1,4 @@ +/** + * Desc. + */ +package com.corbado.entities; diff --git a/src/main/java/com/corbado/exceptions/CorbadoServerException.java b/src/main/java/com/corbado/exceptions/CorbadoServerException.java new file mode 100644 index 0000000..c57f483 --- /dev/null +++ b/src/main/java/com/corbado/exceptions/CorbadoServerException.java @@ -0,0 +1,36 @@ +package com.corbado.exceptions; + +import com.corbado.generated.invoker.ApiException; + +/** Custom exception class for server-related errors. */ +// TODO: Complete +public class CorbadoServerException extends Exception { + + private static final long serialVersionUID = 5970919574670247150L; + + private final int httpStatusCode; + private final String body; + + /** + * Convert ApiException to ServerException. + * + * @param e ApiException to be converted + * @throws StandardException If response body is not a string + */ + public CorbadoServerException(final ApiException e) { + this(e.getCode(), e.getResponseBody()); + } + + public CorbadoServerException(final int statusCode, final String body) { + httpStatusCode = statusCode; + this.body = body; + } + + public String getBody() { + return body; + } + + public int getHttpStatusCode() { + return httpStatusCode; + } +} diff --git a/src/main/java/com/corbado/exceptions/StandardException.java b/src/main/java/com/corbado/exceptions/StandardException.java new file mode 100644 index 0000000..96d8a5f --- /dev/null +++ b/src/main/java/com/corbado/exceptions/StandardException.java @@ -0,0 +1,11 @@ +package com.corbado.exceptions; + +/** Custom exception class for standard exceptions. */ +public class StandardException extends Exception { + + private static final long serialVersionUID = -1528458577429647143L; + + public StandardException(final String string) { + super(string); + } +} diff --git a/src/main/java/com/corbado/generated/invoker/ApiClient.java b/src/main/java/com/corbado/generated/invoker/ApiClient.java index b310bd3..602aa61 100644 --- a/src/main/java/com/corbado/generated/invoker/ApiClient.java +++ b/src/main/java/com/corbado/generated/invoker/ApiClient.java @@ -1,6 +1,6 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) * * The version of the OpenAPI document: 1.0.0 * Contact: support@corbado.com @@ -10,19 +10,8 @@ * Do not edit the class manually. */ - package com.corbado.generated.invoker; -import okhttp3.*; -import okhttp3.internal.http.HttpMethod; -import okhttp3.internal.tls.OkHostnameVerifier; -import okhttp3.logging.HttpLoggingInterceptor; -import okhttp3.logging.HttpLoggingInterceptor.Level; -import okio.Buffer; -import okio.BufferedSink; -import okio.Okio; - -import javax.net.ssl.*; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -39,1554 +28,1656 @@ import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; import java.text.DateFormat; import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; import java.util.regex.Matcher; import java.util.regex.Pattern; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.KeyManager; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.TrustManagerFactory; +import javax.net.ssl.X509TrustManager; + +import com.corbado.generated.invoker.auth.ApiKeyAuth; import com.corbado.generated.invoker.auth.Authentication; import com.corbado.generated.invoker.auth.HttpBasicAuth; import com.corbado.generated.invoker.auth.HttpBearerAuth; -import com.corbado.generated.invoker.auth.ApiKeyAuth; - -/** - *

ApiClient class.

- */ -public class ApiClient { - - private String basePath = "https://backendapi.corbado.io"; - protected List servers = new ArrayList(Arrays.asList( - new ServerConfiguration( - "https://backendapi.corbado.io", - "No description provided", - new HashMap() - ) - )); - protected Integer serverIndex = 0; - protected Map serverVariables = null; - private boolean debugging = false; - private Map defaultHeaderMap = new HashMap(); - private Map defaultCookieMap = new HashMap(); - private String tempFolderPath = null; - - private Map authentications; - - private DateFormat dateFormat; - private DateFormat datetimeFormat; - private boolean lenientDatetimeFormat; - private int dateLength; - - private InputStream sslCaCert; - private boolean verifyingSsl; - private KeyManager[] keyManagers; - - private OkHttpClient httpClient; - private JSON json; - - private HttpLoggingInterceptor loggingInterceptor; - - /** - * Basic constructor for ApiClient - */ - public ApiClient() { - init(); - initHttpClient(); - - // Setup authentications (key: authentication name, value: authentication). - authentications.put("basicAuth", new HttpBasicAuth()); - authentications.put("bearerAuth", new HttpBearerAuth("bearer")); - authentications.put("projectID", new ApiKeyAuth("header", "X-Corbado-ProjectID")); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - /** - * Basic constructor with custom OkHttpClient - * - * @param client a {@link okhttp3.OkHttpClient} object - */ - public ApiClient(OkHttpClient client) { - init(); - - httpClient = client; - - // Setup authentications (key: authentication name, value: authentication). - authentications.put("basicAuth", new HttpBasicAuth()); - authentications.put("bearerAuth", new HttpBearerAuth("bearer")); - authentications.put("projectID", new ApiKeyAuth("header", "X-Corbado-ProjectID")); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - private void initHttpClient() { - initHttpClient(Collections.emptyList()); - } - - private void initHttpClient(List interceptors) { - OkHttpClient.Builder builder = new OkHttpClient.Builder(); - builder.addNetworkInterceptor(getProgressInterceptor()); - for (Interceptor interceptor: interceptors) { - builder.addInterceptor(interceptor); - } - - httpClient = builder.build(); - } - - private void init() { - verifyingSsl = true; - - json = new JSON(); - - // Set default User-Agent. - setUserAgent("OpenAPI-Generator/1.0.0/java"); - - authentications = new HashMap(); - } - - /** - * Get base path - * - * @return Base path - */ - public String getBasePath() { - return basePath; - } - - /** - * Set base path - * - * @param basePath Base path of the URL (e.g https://backendapi.corbado.io - * @return An instance of OkHttpClient - */ - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - this.serverIndex = null; - return this; - } - - public List getServers() { - return servers; - } - - public ApiClient setServers(List servers) { - this.servers = servers; - return this; - } - - public Integer getServerIndex() { - return serverIndex; - } - - public ApiClient setServerIndex(Integer serverIndex) { - this.serverIndex = serverIndex; - return this; - } - - public Map getServerVariables() { - return serverVariables; - } - - public ApiClient setServerVariables(Map serverVariables) { - this.serverVariables = serverVariables; - return this; - } - - /** - * Get HTTP client - * - * @return An instance of OkHttpClient - */ - public OkHttpClient getHttpClient() { - return httpClient; - } - - /** - * Set HTTP client, which must never be null. - * - * @param newHttpClient An instance of OkHttpClient - * @return Api Client - * @throws java.lang.NullPointerException when newHttpClient is null - */ - public ApiClient setHttpClient(OkHttpClient newHttpClient) { - this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); - return this; - } - - /** - * Get JSON - * - * @return JSON object - */ - public JSON getJSON() { - return json; - } - - /** - * Set JSON - * - * @param json JSON object - * @return Api client - */ - public ApiClient setJSON(JSON json) { - this.json = json; - return this; - } - - /** - * True if isVerifyingSsl flag is on - * - * @return True if isVerifySsl flag is on - */ - public boolean isVerifyingSsl() { - return verifyingSsl; - } - - /** - * Configure whether to verify certificate and hostname when making https requests. - * Default to true. - * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. - * - * @param verifyingSsl True to verify TLS/SSL connection - * @return ApiClient - */ - public ApiClient setVerifyingSsl(boolean verifyingSsl) { - this.verifyingSsl = verifyingSsl; - applySslSettings(); - return this; - } - - /** - * Get SSL CA cert. - * - * @return Input stream to the SSL CA cert - */ - public InputStream getSslCaCert() { - return sslCaCert; - } - - /** - * Configure the CA certificate to be trusted when making https requests. - * Use null to reset to default. - * - * @param sslCaCert input stream for SSL CA cert - * @return ApiClient - */ - public ApiClient setSslCaCert(InputStream sslCaCert) { - this.sslCaCert = sslCaCert; - applySslSettings(); - return this; - } - - /** - *

Getter for the field keyManagers.

- * - * @return an array of {@link javax.net.ssl.KeyManager} objects - */ - public KeyManager[] getKeyManagers() { - return keyManagers; - } - - /** - * Configure client keys to use for authorization in an SSL session. - * Use null to reset to default. - * - * @param managers The KeyManagers to use - * @return ApiClient - */ - public ApiClient setKeyManagers(KeyManager[] managers) { - this.keyManagers = managers; - applySslSettings(); - return this; - } - - /** - *

Getter for the field dateFormat.

- * - * @return a {@link java.text.DateFormat} object - */ - public DateFormat getDateFormat() { - return dateFormat; - } - - /** - *

Setter for the field dateFormat.

- * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link com.corbado.generated.invoker.ApiClient} object - */ - public ApiClient setDateFormat(DateFormat dateFormat) { - JSON.setDateFormat(dateFormat); - return this; - } - - /** - *

Set SqlDateFormat.

- * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link com.corbado.generated.invoker.ApiClient} object - */ - public ApiClient setSqlDateFormat(DateFormat dateFormat) { - JSON.setSqlDateFormat(dateFormat); - return this; - } - - /** - *

Set OffsetDateTimeFormat.

- * - * @param dateFormat a {@link java.time.format.DateTimeFormatter} object - * @return a {@link com.corbado.generated.invoker.ApiClient} object - */ - public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - JSON.setOffsetDateTimeFormat(dateFormat); - return this; - } - - /** - *

Set LocalDateFormat.

- * - * @param dateFormat a {@link java.time.format.DateTimeFormatter} object - * @return a {@link com.corbado.generated.invoker.ApiClient} object - */ - public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { - JSON.setLocalDateFormat(dateFormat); - return this; - } - - /** - *

Set LenientOnJson.

- * - * @param lenientOnJson a boolean - * @return a {@link com.corbado.generated.invoker.ApiClient} object - */ - public ApiClient setLenientOnJson(boolean lenientOnJson) { - JSON.setLenientOnJson(lenientOnJson); - return this; - } - - /** - * Get authentications (key: authentication name, value: authentication). - * - * @return Map of authentication objects - */ - public Map getAuthentications() { - return authentications; - } - - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(String authName) { - return authentications.get(authName); - } - /** - * Helper method to set access token for the first Bearer authentication. - * @param bearerToken Bearer token - */ - public void setBearerToken(String bearerToken) { - setBearerToken(() -> bearerToken); - } - - /** - * Helper method to set the supplier of access tokens for Bearer authentication. - * - * @param tokenSupplier The supplier of bearer tokens - */ - public void setBearerToken(Supplier tokenSupplier) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(tokenSupplier); - return; - } - } - throw new RuntimeException("No Bearer authentication configured!"); - } - - /** - * Helper method to set username for the first HTTP basic authentication. - * - * @param username Username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set password for the first HTTP basic authentication. - * - * @param password Password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set API key value for the first API key authentication. - * - * @param apiKey API key - */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set API key prefix for the first API key authentication. - * - * @param apiKeyPrefix API key prefix - */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set access token for the first OAuth2 authentication. - * - * @param accessToken Access token - */ - public void setAccessToken(String accessToken) { - throw new RuntimeException("No OAuth2 authentication configured!"); - } - - /** - * Helper method to set credentials for AWSV4 Signature - * - * @param accessKey Access Key - * @param secretKey Secret Key - * @param region Region - * @param service Service to access to - */ - public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { - throw new RuntimeException("No AWS4 authentication configured!"); - } - - /** - * Helper method to set credentials for AWSV4 Signature - * - * @param accessKey Access Key - * @param secretKey Secret Key - * @param sessionToken Session Token - * @param region Region - * @param service Service to access to - */ - public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { - throw new RuntimeException("No AWS4 authentication configured!"); - } - - /** - * Set the User-Agent header's value (by adding to the default header map). - * - * @param userAgent HTTP request's user agent - * @return ApiClient - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; - } - - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return ApiClient - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; - } - - /** - * Add a default cookie. - * - * @param key The cookie's key - * @param value The cookie's value - * @return ApiClient - */ - public ApiClient addDefaultCookie(String key, String value) { - defaultCookieMap.put(key, value); - return this; - } - - /** - * Check that whether debugging is enabled for this API client. - * - * @return True if debugging is enabled, false otherwise. - */ - public boolean isDebugging() { - return debugging; - } - - /** - * Enable/disable debugging for this API client. - * - * @param debugging To enable (true) or disable (false) debugging - * @return ApiClient - */ - public ApiClient setDebugging(boolean debugging) { - if (debugging != this.debugging) { - if (debugging) { - loggingInterceptor = new HttpLoggingInterceptor(); - loggingInterceptor.setLevel(Level.BODY); - httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); - } else { - final OkHttpClient.Builder builder = httpClient.newBuilder(); - builder.interceptors().remove(loggingInterceptor); - httpClient = builder.build(); - loggingInterceptor = null; - } - } - this.debugging = debugging; - return this; - } - - /** - * The path of temporary folder used to store downloaded files from endpoints - * with file response. The default value is null, i.e. using - * the system's default temporary folder. - * - * @see createTempFile - * @return Temporary folder path - */ - public String getTempFolderPath() { - return tempFolderPath; - } - - /** - * Set the temporary folder path (for downloading files) - * - * @param tempFolderPath Temporary folder path - * @return ApiClient - */ - public ApiClient setTempFolderPath(String tempFolderPath) { - this.tempFolderPath = tempFolderPath; - return this; - } - - /** - * Get connection timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getConnectTimeout() { - return httpClient.connectTimeoutMillis(); - } - - /** - * Sets the connect timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param connectionTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setConnectTimeout(int connectionTimeout) { - httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout() { - return httpClient.readTimeoutMillis(); - } - - /** - * Sets the read timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param readTimeout read timeout in milliseconds - * @return Api client - */ - public ApiClient setReadTimeout(int readTimeout) { - httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout() { - return httpClient.writeTimeoutMillis(); - } - - /** - * Sets the write timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link java.lang.Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setWriteTimeout(int writeTimeout) { - httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.Interceptor; +import okhttp3.MediaType; +import okhttp3.MultipartBody; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; +/** ApiClient class. */ +public class ApiClient { - /** - * Format the given parameter object into string. - * - * @param param Parameter - * @return String representation of the parameter - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { - //Serialize to json string and remove the " enclosing characters - String jsonStr = JSON.serialize(param); - return jsonStr.substring(1, jsonStr.length() - 1); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for (Object o : (Collection) param) { - if (b.length() > 0) { - b.append(","); + private String basePath = "https://backendapi.corbado.io"; + protected List servers = + new ArrayList<>( + Arrays.asList( + new ServerConfiguration( + "https://backendapi.corbado.io", "No description provided", new HashMap<>()))); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private final Map defaultHeaderMap = new HashMap<>(); + private final Map defaultCookieMap = new HashMap<>(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** Basic constructor for ApiClient */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("basicAuth", new HttpBasicAuth()); + authentications.put("bearerAuth", new HttpBearerAuth("bearer")); + authentications.put("projectID", new ApiKeyAuth("header", "X-Corbado-ProjectID")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(final OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("basicAuth", new HttpBasicAuth()); + authentications.put("bearerAuth", new HttpBearerAuth("bearer")); + authentications.put("projectID", new ApiKeyAuth("header", "X-Corbado-ProjectID")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(final String key, final String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(final String key, final String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder( + final MultipartBody.Builder mpBuilder, final String key, final File file) { + final Headers partHeaders = + Headers.of( + "Content-Disposition", + "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + final MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody + * Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder( + final MultipartBody.Builder mpBuilder, final String key, final Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + final Headers partHeaders = + Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Apply SSL related settings to httpClient according to the current values of verifyingSsl and + * sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = + new TrustManager[] { + new X509TrustManager() { + @Override + public void checkClientTrusted( + final java.security.cert.X509Certificate[] chain, final String authType) + throws CertificateException {} + + @Override + public void checkServerTrusted( + final java.security.cert.X509Certificate[] chain, final String authType) + throws CertificateException {} + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[] {}; } - b.append(o); - } - return b.toString(); + } + }; + hostnameVerifier = (hostname, session) -> true; + } else { + final TrustManagerFactory trustManagerFactory = + TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); } else { - return String.valueOf(param); - } - } - - /** - * Formats the specified query parameter to a list containing a single {@code Pair} object. - * - * Note that {@code value} must not be a collection. - * - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list containing a single {@code Pair} object. - */ - public List parameterToPair(String name, Object value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value instanceof Collection) { - return params; - } - - params.add(new Pair(name, parameterToString(value))); - return params; - } - - /** - * Formats the specified collection query parameters to a list of {@code Pair} objects. - * - * Note that the values of each of the returned Pair objects are percent-encoded. - * - * @param collectionFormat The collection format of the parameter. - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list of {@code Pair} objects. - */ - public List parameterToPairs(String collectionFormat, String name, Collection value) { - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value.isEmpty()) { - return params; - } - - // create the params based on the collection format - if ("multi".equals(collectionFormat)) { - for (Object item : value) { - params.add(new Pair(name, escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if ("ssv".equals(collectionFormat)) { - delimiter = escapeString(" "); - } else if ("tsv".equals(collectionFormat)) { - delimiter = escapeString("\t"); - } else if ("pipes".equals(collectionFormat)) { - delimiter = escapeString("|"); - } - - StringBuilder sb = new StringBuilder(); - for (Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(name, sb.substring(delimiter.length()))); - - return params; - } - - /** - * Formats the specified collection path parameter to a string value. - * - * @param collectionFormat The collection format of the parameter. - * @param value The value of the parameter. - * @return String representation of the parameter - */ - public String collectionPathParameterToString(String collectionFormat, Collection value) { - // create the value based on the collection format - if ("multi".equals(collectionFormat)) { - // not valid for path params - return parameterToString(value); - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - if ("ssv".equals(collectionFormat)) { - delimiter = " "; - } else if ("tsv".equals(collectionFormat)) { - delimiter = "\t"; - } else if ("pipes".equals(collectionFormat)) { - delimiter = "|"; + final char[] password = null; // Any password will work. + final CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + final Collection certificates = + certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + final KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (final Certificate certificate : certificates) { + final String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); } - - StringBuilder sb = new StringBuilder() ; - for (Object item : value) { - sb.append(delimiter); - sb.append(parameterToString(item)); + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + final SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = + httpClient + .newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (final GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + /** + * Build HTTP call with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and + * "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object + */ + public Call buildCall( + final String baseUrl, + final String path, + final String method, + final List queryParams, + final List collectionQueryParams, + final Object body, + final Map headerParams, + final Map cookieParams, + final Map formParams, + final String[] authNames, + final ApiCallback callback) + throws ApiException { + final Request request = + buildRequest( + baseUrl, + path, + method, + queryParams, + collectionQueryParams, + body, + headerParams, + cookieParams, + formParams, + authNames, + callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and + * "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object + */ + public Request buildRequest( + final String baseUrl, + final String path, + final String method, + final List queryParams, + final List collectionQueryParams, + final Object body, + final Map headerParams, + final Map cookieParams, + final Map formParams, + final String[] authNames, + final ApiCallback callback) + throws ApiException { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + final List allQueryParams = new ArrayList<>(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + final String contentType = headerParams.get("Content-Type"); + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentTypePure)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + // update parameters with authentication settings + updateParamsForAuth( + authNames, + allQueryParams, + headerParams, + cookieParams, + requestBodyToString(reqBody), + method, + URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + final ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(final Map formParams) { + final okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (final Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, which could + * contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(final Map formParams) { + final MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (final Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + final File file = (File) param.getValue(); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + final List list = (List) param.getValue(); + for (final Object item : list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } } - - return sb.substring(delimiter.length()); - } - - /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif - * - * @param filename The filename to be sanitized - * @return The sanitized filename - */ - public String sanitizeFilename(String filename) { - return filename.replaceAll(".*[/\\\\]", ""); - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * "* / *" is also default to JSON - * @param mime MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); - } - - /** - * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) - * - * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, - * null will be returned (not to set the Accept header explicitly). - */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } - } - return StringUtil.join(accepts, ","); - } - - /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. - * - * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, - * returns null. If it matches "any", JSON will be used. - */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { - return null; - } - - if (contentTypes[0].equals("*/*")) { - return "application/json"; - } - - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + return mpBuilder.build(); + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl( + final String baseUrl, + final String path, + final List queryParams, + final List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException( + String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", + serverIndex, servers.size())); } - - return contentTypes[0]; - } - - /** - * Escape the given string to be used as URL query value. - * - * @param str String to be escaped - * @return Escaped string - */ - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); - } catch (UnsupportedEncodingException e) { - return str; + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); + } + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (final Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + final String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); } - } - - /** - * Deserialize response body to Java object, according to the return type and - * the Content-Type response header. - * - * @param Type - * @param response HTTP response - * @param returnType The type of the Java object - * @return The deserialized Java object - * @throws com.corbado.generated.invoker.ApiException If fail to deserialize response body, i.e. cannot read response body - * or the Content-Type of the response is not supported. - */ - @SuppressWarnings("unchecked") - public T deserialize(Response response, Type returnType) throws ApiException { - if (response == null || returnType == null) { - return null; + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (final Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + final String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). + } + } + + return url.toString(); + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString( + final String collectionFormat, final Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + final StringBuilder sb = new StringBuilder(); + for (final Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Deserialize response body to Java object, according to the return type and the Content-Type + * response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws com.corbado.generated.invoker.ApiException If fail to deserialize response body, i.e. + * cannot read response body or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(final Response response, final Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (final IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) { + respBody = response.body().string(); + } else { + respBody = null; + } + } catch (final IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws com.corbado.generated.invoker.ApiException If fail to read file content from response + * and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(final Response response) throws ApiException { + try { + final File file = prepareDownloadFile(response); + final BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (final IOException e) { + throw new ApiException(e); + } + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(final String str) { + try { + return URLEncoder.encode(str, "utf8").replace("+", "%20"); + } catch (final UnsupportedEncodingException e) { + return str; + } + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws com.corbado.generated.invoker.ApiException If fail to execute the call + */ + public ApiResponse execute(final Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and data, which is a Java object + * deserialized from response body and would be null when returnType is null. + * @throws com.corbado.generated.invoker.ApiException If fail to execute the call + */ + public ApiResponse execute(final Call call, final Type returnType) throws ApiException { + try { + final Response response = call.execute(); + final T data = handleResponse(response, returnType); + return new ApiResponse<>(response.code(), response.headers().toMultimap(), data); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(final Call call, final ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync( + final Call call, final Type returnType, final ApiCallback callback) { + call.enqueue( + new Callback() { + @Override + public void onFailure(final Call call, final IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(final Call call, final Response response) throws IOException { + T result; try { - return (T) response.body().bytes(); - } catch (IOException e) { - throw new ApiException(e); - } - } else if (returnType.equals(File.class)) { - // Handle file downloading. - return (T) downloadFileFromResponse(response); - } - - String respBody; - try { - if (response.body() != null) - respBody = response.body().string(); - else - respBody = null; - } catch (IOException e) { - throw new ApiException(e); - } - - if (respBody == null || "".equals(respBody)) { - return null; - } - - String contentType = response.headers().get("Content-Type"); - if (contentType == null) { - // ensuring a default content type - contentType = "application/json"; - } - if (isJsonMime(contentType)) { - return JSON.deserialize(respBody, returnType); - } else if (returnType.equals(String.class)) { - // Expecting string, return the raw response body. - return (T) respBody; - } else { - throw new ApiException( - "Content type \"" + contentType + "\" is not supported for type: " + returnType, - response.code(), - response.headers().toMultimap(), - respBody); - } - } - - /** - * Serialize the given Java object into request body according to the object's - * class and the request Content-Type. - * - * @param obj The Java object - * @param contentType The request Content-Type - * @return The serialized request body - * @throws com.corbado.generated.invoker.ApiException If fail to serialize the given object - */ - public RequestBody serialize(Object obj, String contentType) throws ApiException { - if (obj instanceof byte[]) { - // Binary (byte array) body parameter support. - return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); - } else if (obj instanceof File) { - // File body parameter support. - return RequestBody.create((File) obj, MediaType.parse(contentType)); - } else if ("text/plain".equals(contentType) && obj instanceof String) { - return RequestBody.create((String) obj, MediaType.parse(contentType)); - } else if (isJsonMime(contentType)) { - String content; - if (obj != null) { - content = JSON.serialize(obj); - } else { - content = null; - } - return RequestBody.create(content, MediaType.parse(contentType)); - } else if (obj instanceof String) { - return RequestBody.create((String) obj, MediaType.parse(contentType)); - } else { - throw new ApiException("Content type \"" + contentType + "\" is not supported"); - } - } - - /** - * Download file from the given response. - * - * @param response An instance of the Response object - * @throws com.corbado.generated.invoker.ApiException If fail to read file content from response and write to disk - * @return Downloaded file - */ - public File downloadFileFromResponse(Response response) throws ApiException { - try { - File file = prepareDownloadFile(response); - BufferedSink sink = Okio.buffer(Okio.sink(file)); - sink.writeAll(response.body().source()); - sink.close(); - return file; - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * Prepare file for download - * - * @param response An instance of the Response object - * @return Prepared file for the download - * @throws java.io.IOException If fail to prepare file for download - */ - public File prepareDownloadFile(Response response) throws IOException { - String filename = null; - String contentDisposition = response.header("Content-Disposition"); - if (contentDisposition != null && !"".equals(contentDisposition)) { - // Get filename from the Content-Disposition header. - Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) { - filename = sanitizeFilename(matcher.group(1)); - } - } - - String prefix = null; - String suffix = null; - if (filename == null) { - prefix = "download-"; - suffix = ""; - } else { - int pos = filename.lastIndexOf("."); - if (pos == -1) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; - } - - if (tempFolderPath == null) - return Files.createTempFile(prefix, suffix).toFile(); - else - return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); - } - - /** - * {@link #execute(Call, Type)} - * - * @param Type - * @param call An instance of the Call object - * @return ApiResponse<T> - * @throws com.corbado.generated.invoker.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call) throws ApiException { - return execute(call, null); - } - - /** - * Execute HTTP call and deserialize the HTTP response body into the given return type. - * - * @param returnType The return type used to deserialize HTTP response body - * @param The return type corresponding to (same with) returnType - * @param call Call - * @return ApiResponse object containing response status, headers and - * data, which is a Java object deserialized from response body and would be null - * when returnType is null. - * @throws com.corbado.generated.invoker.ApiException If fail to execute the call - */ - public ApiResponse execute(Call call, Type returnType) throws ApiException { - try { - Response response = call.execute(); - T data = handleResponse(response, returnType); - return new ApiResponse(response.code(), response.headers().toMultimap(), data); - } catch (IOException e) { - throw new ApiException(e); - } - } - - /** - * {@link #executeAsync(Call, Type, ApiCallback)} - * - * @param Type - * @param call An instance of the Call object - * @param callback ApiCallback<T> - */ - public void executeAsync(Call call, ApiCallback callback) { - executeAsync(call, null, callback); - } - - /** - * Execute HTTP call asynchronously. - * - * @param Type - * @param call The callback to be executed when the API call finishes - * @param returnType Return type - * @param callback ApiCallback - * @see #execute(Call, Type) - */ - @SuppressWarnings("unchecked") - public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { - call.enqueue(new Callback() { - @Override - public void onFailure(Call call, IOException e) { - callback.onFailure(new ApiException(e), 0, null); - } - - @Override - public void onResponse(Call call, Response response) throws IOException { - T result; - try { - result = (T) handleResponse(response, returnType); - } catch (ApiException e) { - callback.onFailure(e, response.code(), response.headers().toMultimap()); - return; - } catch (Exception e) { - callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); - return; - } - callback.onSuccess(result, response.code(), response.headers().toMultimap()); + result = (T) handleResponse(response, returnType); + } catch (final ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (final Exception e) { + callback.onFailure( + new ApiException(e), response.code(), response.headers().toMultimap()); + return; } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } }); - } - - /** - * Handle the given response, return the deserialized object when the response is successful. - * - * @param Type - * @param response Response - * @param returnType Return type - * @return Type - * @throws com.corbado.generated.invoker.ApiException If the response has an unsuccessful status code or - * fail to deserialize the response body - */ - public T handleResponse(Response response, Type returnType) throws ApiException { - if (response.isSuccessful()) { - if (returnType == null || response.code() == 204) { - // returning null if the returnType is not defined, - // or the status code is 204 (No Content) - if (response.body() != null) { - try { - response.body().close(); - } catch (Exception e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - return null; - } else { - return deserialize(response, returnType); - } - } else { - String respBody = null; - if (response.body() != null) { - try { - respBody = response.body().string(); - } catch (IOException e) { - throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); - } - } - throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); - } - } - - /** - * Build HTTP call with the given options. - * - * @param baseUrl The base URL - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP call - * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object - */ - public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); - - return httpClient.newCall(request); - } - - /** - * Build an HTTP request with the given options. - * - * @param baseUrl The base URL - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP request - * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object - */ - public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams - List allQueryParams = new ArrayList(queryParams); - allQueryParams.addAll(collectionQueryParams); - - final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); - - // prepare HTTP request body - RequestBody reqBody; - String contentType = headerParams.get("Content-Type"); - String contentTypePure = contentType; - if (contentTypePure != null && contentTypePure.contains(";")) { - contentTypePure = contentType.substring(0, contentType.indexOf(";")); - } - if (!HttpMethod.permitsRequestBody(method)) { - reqBody = null; - } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { - reqBody = buildRequestBodyFormEncoding(formParams); - } else if ("multipart/form-data".equals(contentTypePure)) { - reqBody = buildRequestBodyMultipart(formParams); - } else if (body == null) { - if ("DELETE".equals(method)) { - // allow calling DELETE without sending a request body - reqBody = null; - } else { - // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); - } - } else { - reqBody = serialize(body, contentType); - } - - // update parameters with authentication settings - updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); - - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - // Associate callback with request (if not null) so interceptor can - // access it when creating ProgressResponseBody - reqBuilder.tag(callback); - - Request request = null; - - if (callback != null && reqBody != null) { - ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); - request = reqBuilder.method(method, progressRequestBody).build(); - } else { - request = reqBuilder.method(method, reqBody).build(); - } - - return request; - } - - /** - * Build full URL by concatenating base path, the given sub path and query parameters. - * - * @param baseUrl The base URL - * @param path The sub path - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @return The full URL - */ - public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { - final StringBuilder url = new StringBuilder(); - if (baseUrl != null) { - url.append(baseUrl).append(path); - } else { - String baseURL; - if (serverIndex != null) { - if (serverIndex < 0 || serverIndex >= servers.size()) { - throw new ArrayIndexOutOfBoundsException(String.format( - "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() - )); - } - baseURL = servers.get(serverIndex).URL(serverVariables); - } else { - baseURL = basePath; - } - url.append(baseURL).append(path); - } - - if (queryParams != null && !queryParams.isEmpty()) { - // support (constant) query string in `path`, e.g. "/posts?draft=1" - String prefix = path.contains("?") ? "&" : "?"; - for (Pair param : queryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())).append("=").append(escapeString(value)); - } - } - } - - if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { - String prefix = url.toString().contains("?") ? "&" : "?"; - for (Pair param : collectionQueryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - String value = parameterToString(param.getValue()); - // collection query parameter value already escaped as part of parameterToPairs - url.append(escapeString(param.getName())).append("=").append(value); - } - } - } - - return url.toString(); - } - - /** - * Set header parameters to the request builder, including default headers. - * - * @param headerParams Header parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { - for (Entry param : headerParams.entrySet()) { - reqBuilder.header(param.getKey(), parameterToString(param.getValue())); - } - for (Entry header : defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(header.getKey())) { - reqBuilder.header(header.getKey(), parameterToString(header.getValue())); - } - } - } - - /** - * Set cookie parameters to the request builder, including default cookies. - * - * @param cookieParams Cookie parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { - for (Entry param : cookieParams.entrySet()) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - for (Entry param : defaultCookieMap.entrySet()) { - if (!cookieParams.containsKey(param.getKey())) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - } - } - - /** - * Update query and header parameters based on authentication settings. - * - * @param authNames The authentications to apply - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws com.corbado.generated.invoker.ApiException If fails to update the parameters - */ - public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, - Map cookieParams, String payload, String method, URI uri) throws ApiException { - for (String authName : authNames) { - Authentication auth = authentications.get(authName); - if (auth == null) { - throw new RuntimeException("Authentication undefined: " + authName); - } - auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); - } - } - - /** - * Build a form-encoding request body with the given form parameters. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyFormEncoding(Map formParams) { - okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); - for (Entry param : formParams.entrySet()) { - formBuilder.add(param.getKey(), parameterToString(param.getValue())); - } - return formBuilder.build(); - } - - /** - * Build a multipart (file uploading) request body with the given form parameters, - * which could contain text fields and file fields. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyMultipart(Map formParams) { - MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); - for (Entry param : formParams.entrySet()) { - if (param.getValue() instanceof File) { - File file = (File) param.getValue(); - addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); - } else if (param.getValue() instanceof List) { - List list = (List) param.getValue(); - for (Object item: list) { - if (item instanceof File) { - addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); - } else { - addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); - } - } - } else { - addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); - } - } - return mpBuilder.build(); - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - public String guessContentTypeFromFile(File file) { - String contentType = URLConnection.guessContentTypeFromName(file.getName()); - if (contentType == null) { - return "application/octet-stream"; - } else { - return contentType; - } - } - - /** - * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. - * - * @param mpBuilder MultipartBody.Builder - * @param key The key of the Header element - * @param file The file to add to the Header - */ - private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); - MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); - } - - /** - * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. - * - * @param mpBuilder MultipartBody.Builder - * @param key The key of the Header element - * @param obj The complex object to add to the Header - */ - private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { - RequestBody requestBody; - if (obj instanceof String) { - requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); - } else { - String content; - if (obj != null) { - content = JSON.serialize(obj); - } else { - content = null; - } - requestBody = RequestBody.create(content, MediaType.parse("application/json")); - } - - Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); - mpBuilder.addPart(partHeaders, requestBody); - } - - /** - * Get network interceptor to add it to the httpClient to track download progress for - * async requests. - */ - private Interceptor getProgressInterceptor() { - return new Interceptor() { - @Override - public Response intercept(Interceptor.Chain chain) throws IOException { - final Request request = chain.request(); - final Response originalResponse = chain.proceed(request); - if (request.tag() instanceof ApiCallback) { - final ApiCallback callback = (ApiCallback) request.tag(); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), callback)) - .build(); - } - return originalResponse; - } - }; - } - - /** - * Apply SSL related settings to httpClient according to the current values of - * verifyingSsl and sslCaCert. - */ - private void applySslSettings() { - try { - TrustManager[] trustManagers; - HostnameVerifier hostnameVerifier; - if (!verifyingSsl) { - trustManagers = new TrustManager[]{ - new X509TrustManager() { - @Override - public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[]{}; - } - } - }; - hostnameVerifier = new HostnameVerifier() { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - }; - } else { - TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - - if (sslCaCert == null) { - trustManagerFactory.init((KeyStore) null); - } else { - char[] password = null; // Any password will work. - CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); - Collection certificates = certificateFactory.generateCertificates(sslCaCert); - if (certificates.isEmpty()) { - throw new IllegalArgumentException("expected non-empty set of trusted certificates"); - } - KeyStore caKeyStore = newEmptyKeyStore(password); - int index = 0; - for (Certificate certificate : certificates) { - String certificateAlias = "ca" + (index++); - caKeyStore.setCertificateEntry(certificateAlias, certificate); - } - trustManagerFactory.init(caKeyStore); - } - trustManagers = trustManagerFactory.getTrustManagers(); - hostnameVerifier = OkHostnameVerifier.INSTANCE; - } - - SSLContext sslContext = SSLContext.getInstance("TLS"); - sslContext.init(keyManagers, trustManagers, new SecureRandom()); - httpClient = httpClient.newBuilder() - .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) - .hostnameVerifier(hostnameVerifier) - .build(); - } catch (GeneralSecurityException e) { - throw new RuntimeException(e); + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(final String authName) { + return authentications.get(authName); + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Getter for the field dateFormat. + * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Getter for the field keyManagers. + * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for async + * requests. + */ + private Interceptor getProgressInterceptor() { + return chain -> { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse + .newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + }; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + public Integer getServerIndex() { + return serverIndex; + } + + public List getServers() { + return servers; + } + + public Map getServerVariables() { + return serverVariables; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints with file response. + * The default value is null, i.e. using the system's default temporary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(final File file) { + final String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws com.corbado.generated.invoker.ApiException If the response has an unsuccessful status + * code or fail to deserialize the response body + */ + public T handleResponse(final Response response, final Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (final Exception e) { + throw new ApiException( + response.message(), e, response.code(), response.headers().toMultimap()); + } } - } - - private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { try { - KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - keyStore.load(null, password); - return keyStore; - } catch (IOException e) { - throw new AssertionError(e); + respBody = response.body().string(); + } catch (final IOException e) { + throw new ApiException( + response.message(), e, response.code(), response.headers().toMultimap()); } - } - - /** - * Convert the HTTP request body to a string. - * - * @param requestBody The HTTP request object - * @return The string representation of the HTTP request body - * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object into a string - */ - private String requestBodyToString(RequestBody requestBody) throws ApiException { - if (requestBody != null) { - try { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return buffer.readUtf8(); - } catch (final IOException e) { - throw new ApiException(e); - } + } + throw new ApiException( + response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1.0.0/java"); + + authentications = new HashMap<>(); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(final List interceptors) { + final OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (final Interceptor interceptor : interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Check if the given MIME is a JSON MIME. JSON MIME examples: application/json application/json; + * charset=UTF8 APPLICATION/JSON application/vnd.company+json "* / *" is also default to JSON + * + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(final String mime) { + final String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || "*/*".equals(mime)); + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + private KeyStore newEmptyKeyStore(final char[] password) throws GeneralSecurityException { + try { + final KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (final IOException e) { + throw new AssertionError(e); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + *

Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(final String name, final Object value) { + final List params = new ArrayList<>(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + *

Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs( + final String collectionFormat, final String name, final Collection value) { + final List params = new ArrayList<>(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (final Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + final StringBuilder sb = new StringBuilder(); + for (final Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(final Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date + || param instanceof OffsetDateTime + || param instanceof LocalDate) { + // Serialize to json string and remove the " enclosing characters + final String jsonStr = JSON.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + final StringBuilder b = new StringBuilder(); + for (final Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); } - - // empty http request body - return ""; - } + b.append(o); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(final Response response) throws IOException { + String filename = null; + final String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + final Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + final Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + final int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) { + prefix = "download-"; + } + } + + if (tempFolderPath == null) { + return Files.createTempFile(prefix, suffix).toFile(); + } else { + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams( + final Map cookieParams, final Request.Builder reqBuilder) { + for (final Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + for (final Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams( + final Map headerParams, final Request.Builder reqBuilder) { + for (final Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (final Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object + * into a string + */ + private String requestBodyToString(final RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } + + /** + * Sanitize filename by removing path. e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(final String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Select the Accept header's value from the given accepts array: if JSON exists in the given + * array, use it; otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, null will be returned (not to + * set the Accept header explicitly). + */ + public String selectHeaderAccept(final String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (final String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: if JSON exists in the given array, + * use it; otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, returns null. If it + * matches "any", JSON will be used. + */ + public String selectHeaderContentType(final String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if ("*/*".equals(contentTypes[0])) { + return "application/json"; + } + + for (final String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Serialize the given Java object into request body according to the object's class and the + * request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws com.corbado.generated.invoker.ApiException If fail to serialize the given object + */ + public RequestBody serialize(final Object obj, final String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(final String accessToken) { + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(final String apiKey) { + for (final Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(final String apiKeyPrefix) { + for (final Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration( + final String accessKey, final String secretKey, final String region, final String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration( + final String accessKey, + final String secretKey, + final String sessionToken, + final String region, + final String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g https://backendapi.corbado.io + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(final String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + /** + * Helper method to set access token for the first Bearer authentication. + * + * @param bearerToken Bearer token + */ + public void setBearerToken(final String bearerToken) { + setBearerToken(() -> bearerToken); + } + + /** + * Helper method to set the supplier of access tokens for Bearer authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setBearerToken(final Supplier tokenSupplier) { + for (final Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(tokenSupplier); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Sets the connect timeout (in milliseconds). A value of 0 means no timeout, otherwise values + * must be between 1 and {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(final int connectionTimeout) { + httpClient = + httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Setter for the field dateFormat. + * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link com.corbado.generated.invoker.ApiClient} object + */ + public ApiClient setDateFormat(final DateFormat dateFormat) { + JSON.setDateFormat(dateFormat); + return this; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(final boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(final OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(final JSON json) { + this.json = json; + return this; + } + + /** + * Configure client keys to use for authorization in an SSL session. Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(final KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + * Set LenientOnJson. + * + * @param lenientOnJson a boolean + * @return a {@link com.corbado.generated.invoker.ApiClient} object + */ + public ApiClient setLenientOnJson(final boolean lenientOnJson) { + JSON.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Set LocalDateFormat. + * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link com.corbado.generated.invoker.ApiClient} object + */ + public ApiClient setLocalDateFormat(final DateTimeFormatter dateFormat) { + JSON.setLocalDateFormat(dateFormat); + return this; + } + + /** + * Set OffsetDateTimeFormat. + * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link com.corbado.generated.invoker.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(final DateTimeFormatter dateFormat) { + JSON.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(final String password) { + for (final Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Sets the read timeout (in milliseconds). A value of 0 means no timeout, otherwise values must + * be between 1 and {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(final int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + public ApiClient setServerIndex(final Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public ApiClient setServers(final List servers) { + this.servers = servers; + return this; + } + + public ApiClient setServerVariables(final Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Set SqlDateFormat. + * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link com.corbado.generated.invoker.ApiClient} object + */ + public ApiClient setSqlDateFormat(final DateFormat dateFormat) { + JSON.setSqlDateFormat(dateFormat); + return this; + } + + /** + * Configure the CA certificate to be trusted when making https requests. Use null to reset to + * default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(final InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(final String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(final String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(final String username) { + for (final Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Configure whether to verify certificate and hostname when making https requests. Default to + * true. NOTE: Do NOT set to false in production code, otherwise you would face multiple types of + * cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(final boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Sets the write timeout (in milliseconds). A value of 0 means no timeout, otherwise values must + * be between 1 and {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(final int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws com.corbado.generated.invoker.ApiException If fails to update the parameters + */ + public void updateParamsForAuth( + final String[] authNames, + final List queryParams, + final Map headerParams, + final Map cookieParams, + final String payload, + final String method, + final URI uri) + throws ApiException { + for (final String authName : authNames) { + final Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } } diff --git a/src/main/java/com/corbado/sdk/Config.java b/src/main/java/com/corbado/sdk/Config.java index b312e24..8d185a7 100644 --- a/src/main/java/com/corbado/sdk/Config.java +++ b/src/main/java/com/corbado/sdk/Config.java @@ -39,13 +39,19 @@ public class Config { * @param apiSecret the api secret */ // Constructors - public Config(String projectId, String apiSecret) { - this.projectId = projectId; - this.apiSecret = apiSecret; + public Config(final String projectId, final String apiSecret) { + setProjectId(projectId); // set and validate + setApiSecret(apiSecret); // default values - this.frontendApi = "https://" + projectId + ".frontendapi.corbado.io"; - this.issuer = this.frontendApi; + setFrontendApi("https://" + projectId + ".frontendapi.corbado.io"); + setIssuer(this.frontendApi); + } + + // Constructors + public Config(final String projectId, final String apiSecret, final String backendApi) { + this(projectId, apiSecret); + setBackendApi(backendApi); } /** @@ -109,9 +115,10 @@ public String getShortSessionCookieName() { * @param apiSecret the new api secret * @throws IllegalArgumentException If the API secret does not start with "corbado1_". */ - public void setApiSecret(String apiSecret) { + public void setApiSecret(final String apiSecret) { if (!apiSecret.startsWith("corbado1_")) { - throw new IllegalArgumentException("Invalid API Secret, must start with 'corbado1_'"); + throw new IllegalArgumentException( + "Invalid API Secret, must start with 'corbado1_', but was: " + apiSecret); } this.apiSecret = apiSecret; } @@ -122,7 +129,7 @@ public void setApiSecret(String apiSecret) { * @param backendApi the new backend api * @throws IllegalArgumentException If the URL is invalid. */ - public void setBackendApi(String backendApi) { + public void setBackendApi(final String backendApi) { try { new URL(backendApi); // Validate URL syntax } catch (final MalformedURLException e) { @@ -137,7 +144,7 @@ public void setBackendApi(String backendApi) { * @param frontendApi the new frontend api * @throws IllegalArgumentException If the URL is invalid. */ - public void setFrontendApi(String frontendApi) { + public void setFrontendApi(final String frontendApi) { try { new URL(frontendApi); // Validate URL syntax } catch (final MalformedURLException e) { @@ -151,7 +158,7 @@ public void setFrontendApi(String frontendApi) { * * @param issuer the new issuer */ - public void setIssuer(String issuer) { + public void setIssuer(final String issuer) { this.issuer = issuer; } @@ -161,9 +168,10 @@ public void setIssuer(String issuer) { * @param projectId the new project id * @throws IllegalArgumentException If the project Id does not start with "pro-". */ - public void setProjectId(String projectId) { + public void setProjectId(final String projectId) { if (!projectId.startsWith("pro-")) { - throw new IllegalArgumentException("Invalid project ID, must start with 'pro-'"); + throw new IllegalArgumentException( + "Invalid project ID, must start with 'pro-', but was: " + projectId); } this.projectId = projectId; } @@ -173,7 +181,7 @@ public void setProjectId(String projectId) { * * @param shortSessionCookieName the new short session cookie name */ - public void setShortSessionCookieName(String shortSessionCookieName) { + public void setShortSessionCookieName(final String shortSessionCookieName) { this.shortSessionCookieName = shortSessionCookieName; } } diff --git a/src/main/java/com/corbado/sdk/CorbadoSdk.java b/src/main/java/com/corbado/sdk/CorbadoSdk.java index 7409b8a..9b0a9df 100644 --- a/src/main/java/com/corbado/sdk/CorbadoSdk.java +++ b/src/main/java/com/corbado/sdk/CorbadoSdk.java @@ -1,11 +1,33 @@ package com.corbado.sdk; +import java.util.HashMap; +import java.util.Map; + +import com.corbado.exceptions.StandardException; +import com.corbado.generated.api.UserApi; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.services.UserService; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + /** The Class CorbadoSdk. */ public class CorbadoSdk { + public static final String CORBADO_HEADER_NAME = "X-Corbado-SDK"; + /** The configuration class. */ private Config config; + private UserService users; + + private ApiClient client; + + public CorbadoSdk(final Config config) throws StandardException { + this.config = config; + initializeClient(); + } + + // Getters /** * Gets the config. * @@ -15,6 +37,48 @@ public Config getConfig() { return config; } + // TODO: add language version + private String getLanguageVersion() { + return "1.8"; + } + + public UserService getUsers() { + if (users == null) { + this.users = new UserService(new UserApi(client)); + } + return users; + } + + // TODO: sdk version + private String getVersion() { + return "1.0.0"; + } + + private void initializeClient() throws StandardException { + final ApiClient tempClient = new ApiClient(); + tempClient.setBasePath(this.config.getBackendApi()); + tempClient.setUsername(this.config.getProjectId()); + tempClient.setPassword(this.config.getApiSecret()); + tempClient.setApiKey(this.config.getProjectId()); + + // Additional info for requests + final Map data = new HashMap<>(); + data.put("name", "Java SDK"); + data.put("sdkVersion", getVersion()); + data.put("languageVersion", getLanguageVersion()); + + final ObjectMapper objectMapper = new ObjectMapper(); + try { + final String headerValue = objectMapper.writeValueAsString(data); + tempClient.addDefaultHeader(CORBADO_HEADER_NAME, headerValue); + } catch (final JsonProcessingException e) { + throw new StandardException(e.getMessage()); + } + + this.client = tempClient; + } + + // Setters /** * Sets the config. * diff --git a/src/main/java/com/corbado/services/AuthTokenService.java b/src/main/java/com/corbado/services/AuthTokenService.java new file mode 100644 index 0000000..bbc863d --- /dev/null +++ b/src/main/java/com/corbado/services/AuthTokenService.java @@ -0,0 +1,3 @@ +package com.corbado.services; + +public class AuthTokenService {} diff --git a/src/main/java/com/corbado/services/EmailMagicLinkService.java b/src/main/java/com/corbado/services/EmailMagicLinkService.java new file mode 100644 index 0000000..9ae4797 --- /dev/null +++ b/src/main/java/com/corbado/services/EmailMagicLinkService.java @@ -0,0 +1,3 @@ +package com.corbado.services; + +public class EmailMagicLinkService {} diff --git a/src/main/java/com/corbado/services/EmailOtpService.java b/src/main/java/com/corbado/services/EmailOtpService.java new file mode 100644 index 0000000..aca0ed2 --- /dev/null +++ b/src/main/java/com/corbado/services/EmailOtpService.java @@ -0,0 +1,3 @@ +package com.corbado.services; + +public class EmailOtpService {} diff --git a/src/main/java/com/corbado/services/SessionService.java b/src/main/java/com/corbado/services/SessionService.java new file mode 100644 index 0000000..b704f76 --- /dev/null +++ b/src/main/java/com/corbado/services/SessionService.java @@ -0,0 +1,3 @@ +package com.corbado.services; + +public class SessionService {} diff --git a/src/main/java/com/corbado/services/SmsOtpService.java b/src/main/java/com/corbado/services/SmsOtpService.java new file mode 100644 index 0000000..0bd694e --- /dev/null +++ b/src/main/java/com/corbado/services/SmsOtpService.java @@ -0,0 +1,3 @@ +package com.corbado.services; + +public class SmsOtpService {} diff --git a/src/main/java/com/corbado/services/UserService.java b/src/main/java/com/corbado/services/UserService.java new file mode 100644 index 0000000..8cbfbc8 --- /dev/null +++ b/src/main/java/com/corbado/services/UserService.java @@ -0,0 +1,119 @@ +package com.corbado.services; + +import com.corbado.exceptions.CorbadoServerException; +import com.corbado.generated.api.UserApi; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.model.GenericRsp; +import com.corbado.generated.model.UserCreateReq; +import com.corbado.generated.model.UserCreateRsp; +import com.corbado.generated.model.UserDeleteReq; +import com.corbado.generated.model.UserGetRsp; +import com.corbado.generated.model.UserListRsp; +import com.corbado.services.base.ApiService; + +import java.util.List; + +/** Service for managing users. */ +public class UserService extends ApiService { + + /** + * s Constructor for UserService. + * + * @param client User API client + */ + public UserService(final UserApi client) { + super(client); + } + + /** + * Create a user. + * + * @param request User create request + * @return UserCreateRsp Response + * @throws CorbadoServerException If any server-side error occurs. + */ + public UserCreateRsp create(final UserCreateReq request) throws CorbadoServerException { + try { + return client.userCreate(request); + } catch (final ApiException e) { + throw new CorbadoServerException(e); + } + } + + /** + * Delete user. + * + * @param userId User ID + * @param request Request + * @return GenericRsp Response + * @throws CorbadoServerException If any server-side error occurs. + */ + public GenericRsp delete(final String userId, final UserDeleteReq request) + throws CorbadoServerException { + try { + return client.userDelete(userId, request); + } catch (final ApiException e) { + throw new CorbadoServerException(e); + } + } + + /** + * Get user. + * + * @param userId User ID + * @return UserGetRsp Response + * @throws CorbadoServerException If any server-side error occurs. + */ + public UserGetRsp get(final String userId) throws CorbadoServerException { + return get(userId, null, null); + } + + /** + * Get user. + * + * @param userId User ID + * @param remoteAddr Remote address + * @param userAgent User agent + * @return UserGetRsp Response + * @throws CorbadoServerException If any server-side error occurs. + */ + public UserGetRsp get(final String userId, final String remoteAddr, final String userAgent) + throws CorbadoServerException { + try { + return client.userGet(userId, remoteAddr, userAgent); + } catch (final ApiException e) { + throw new CorbadoServerException(e); + } + } + + /** + * List users with paging. + * + * @param remoteAddr Remote address + * @param userAgent User agent + * @param sort Sort + * @param filterArgs Filter arguments. Use null if not needed. + * @param page Page number. Use null if not needed. + * @param pageSize Page size. Use null if not needed. + * @return UserListRsp Response + * @throws CorbadoServerException If any server-side error occurs. + */ + public UserListRsp listUsers( + final String remoteAddr, + final String userAgent, + final String sort, + final List filterArgs, + final Integer page, + final Integer pageSize) + throws CorbadoServerException { + try { + if (page != null && page <= 0) { + throw new IllegalArgumentException("page can not be <= 0"); + } + + return client.userList(remoteAddr, userAgent, sort, filterArgs, page, pageSize); + } catch (final ApiException e) { + throw new CorbadoServerException(e); + } + } +} diff --git a/src/main/java/com/corbado/services/ValidationService.java b/src/main/java/com/corbado/services/ValidationService.java new file mode 100644 index 0000000..d41de74 --- /dev/null +++ b/src/main/java/com/corbado/services/ValidationService.java @@ -0,0 +1,3 @@ +package com.corbado.services; + +public class ValidationService {} diff --git a/src/main/java/com/corbado/services/base/ApiService.java b/src/main/java/com/corbado/services/base/ApiService.java new file mode 100644 index 0000000..fbad57f --- /dev/null +++ b/src/main/java/com/corbado/services/base/ApiService.java @@ -0,0 +1,18 @@ +package com.corbado.services.base; + +/** + * Abstract service for interaction with backend API. + */ +public abstract class ApiService { + /** + * Client for API interactions. + */ + protected T client; + + protected ApiService(final T client) { + super(); + this.client = client; + } + + +} diff --git a/src/test/java/integration/UserServiceIT.java b/src/test/java/integration/UserServiceIT.java new file mode 100644 index 0000000..8d9809a --- /dev/null +++ b/src/test/java/integration/UserServiceIT.java @@ -0,0 +1,122 @@ +package integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; + +import com.corbado.exceptions.CorbadoServerException; +import com.corbado.exceptions.StandardException; +import com.corbado.generated.model.GenericRsp; +import com.corbado.generated.model.UserCreateReq; +import com.corbado.generated.model.UserCreateRsp; +import com.corbado.generated.model.UserDeleteReq; +import com.corbado.generated.model.UserGetRsp; +import com.corbado.generated.model.UserListRsp; +import com.corbado.sdk.CorbadoSdk; +import com.corbado.services.UserService; + +import util.TestUtils; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +class UserServiceIT { + + protected CorbadoSdk sdk; + protected UserService fixture; + + @BeforeAll + public void setUpClass() throws StandardException { + sdk = TestUtils.instantiateSDK(); + fixture = sdk.getUsers(); + } + + @Test + void test_InstantiateSdkExpectNotNull() { + assertNotNull(sdk); + } + + @Test + /** Test case for user creation with validation error. * */ + void test_UserCreateBlankNameExpectValidationError() { + final UserCreateReq req = new UserCreateReq().name("").email(""); + + final CorbadoServerException e = + assertThrows(CorbadoServerException.class, () -> fixture.create(req)); + assertNotNull(e); + assertEquals(400, e.getHttpStatusCode()); + // TODO: complete + // assertArrayEquals(new String[] {"name: cannot be blank"}, + // e.getValidationMessages().toArray()); + } + + @Test + /** Test case for successful user creation. * */ + void test_UserCreateExpectSuccess() throws CorbadoServerException { + final UserCreateReq req = + new UserCreateReq() + .name(TestUtils.createRandomTestName()) + .email(TestUtils.createRandomTestEmail()); + + final UserCreateRsp rsp = fixture.create(req); + assertEquals(200, rsp.getHttpStatusCode()); + } + + @Test + /** Test for retrieving a user that does not exist. * */ + void test_UserGetExpectNotFound() { + final CorbadoServerException e = + assertThrows( + CorbadoServerException.class, + () -> { + final UserGetRsp ret = fixture.get("usr-1234567890"); + System.out.println(ret.toString()); + }); + assertNotNull(e); + assertEquals(404, e.getHttpStatusCode()); + } + + @Test + /** Test for successfully retrieving a user. * */ + void test_UserGetExpectSuccess() throws CorbadoServerException, StandardException { + final String userId = TestUtils.createUser(); + final UserGetRsp rsp = fixture.get(userId); + assertEquals(200, rsp.getHttpStatusCode()); + } + + @Test + /** Test for successfully deleting a user. * */ + void test_UserDeleteExpectSuccess() throws CorbadoServerException, StandardException { + final String userId = TestUtils.createUser(); + final GenericRsp rsp = fixture.delete(userId, new UserDeleteReq()); + assertEquals(200, rsp.getHttpStatusCode()); + } + + @Test + void test_UserListInvalidSortExpectValidationError() { + /** Test for listing users with validation error. * */ + final CorbadoServerException e = + assertThrows( + CorbadoServerException.class, () -> fixture.listUsers("", "", "foo:bar", null, 0, 0)); + assertNotNull(e); + assertEquals(422, e.getHttpStatusCode()); + // TODO + // assertArrayEquals( + // new String[] {"sort: Invalid order direction 'bar'"}, + // e.getValidationMessages().toArray()); + } + + @Test + void test_UserListSuccess() throws CorbadoServerException, StandardException { + /** Test for successfully listing users. * */ + final String userId = TestUtils.createUser(); + final UserListRsp rsp = fixture.listUsers(null, null, "created:desc", null, null, null); + + final boolean found = + rsp.getData().getUsers().stream().anyMatch(user -> user.getID().equals(userId)); + assertTrue(found); + } +} diff --git a/src/test/java/util/TestUtils.java b/src/test/java/util/TestUtils.java new file mode 100644 index 0000000..80f9830 --- /dev/null +++ b/src/test/java/util/TestUtils.java @@ -0,0 +1,99 @@ +package util; + +import java.util.Random; + +import com.corbado.exceptions.CorbadoServerException; +import com.corbado.exceptions.StandardException; +import com.corbado.generated.model.UserCreateReq; +import com.corbado.generated.model.UserCreateRsp; +import com.corbado.sdk.Config; +import com.corbado.sdk.CorbadoSdk; + +import io.github.cdimascio.dotenv.Dotenv; + +public class TestUtils { // Constants for environment variable names + public static final String CORBADO_API_SECRET = "CORBADO_API_SECRET"; + public static final String CORBADO_PROJECT_ID = "CORBADO_PROJECT_ID"; + public static final String CORBADO_BACKEND_API = "CORBADO_BACKEND_API"; + + /** + * Generate a random test email. + * + * @return random test email + */ + public static String createRandomTestEmail() { + final String characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + final String randomString = generateString(10, characters); + return "integration-test+" + randomString + "@corbado.com"; + } + + /** + * Generate a random test name. + * + * @return random test name + */ + public static String createRandomTestName() { + final String characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + return generateString(10, characters); + } + + /** + * Generate a random test phone number. + * + * @return random test phone number + */ + public static String createRandomTestPhoneNumber() { + final String digits = "0123456789"; + return "+491509" + generateString(7, digits); + } + + /** + * Create a user and return the user ID. + * + * @return user ID of the created user + * @throws StandardException + * @throws CorbadoServerException + */ + public static String createUser() throws CorbadoServerException, StandardException { + final UserCreateReq req = + new UserCreateReq().name(createRandomTestName()).email(createRandomTestEmail()); + final UserCreateRsp rsp = instantiateSDK().getUsers().create(req); + return rsp.getData().getUserID(); + } + + /** + * Generate a random string of specified length using the provided characters. + * + * @param length the length of the string to generate + * @param characters the characters to use for generating the string + * @return generated random string + */ + public static String generateString(final int length, final String characters) { + final Random random = new Random(); + final StringBuilder result = new StringBuilder(length); + for (int i = 0; i < length; i++) { + result.append(characters.charAt(random.nextInt(characters.length()))); + } + return result.toString(); + } + + /** + * Instantiate SDK with parameters from environment variables. + * + * @return CorbadoSdk instance + * @throws StandardException + */ + public static CorbadoSdk instantiateSDK() throws StandardException { + final Dotenv dotenv = Dotenv.load(); + + final String apiSecret = dotenv.get(CORBADO_API_SECRET, "missing CORBADO_API_SECRET"); + final String projectId = dotenv.get(CORBADO_PROJECT_ID, "missing CORBADO_PROJECT_ID"); + final String backendApi = dotenv.get(CORBADO_BACKEND_API); + + if (backendApi != null) { + return new CorbadoSdk(new Config(projectId, apiSecret, backendApi)); + } else { + return new CorbadoSdk(new Config(projectId, apiSecret)); + } + } +} From 6bed96badd40e50a2d376ddc7f4b2698f82dc672 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 12 Jul 2024 14:41:16 +0200 Subject: [PATCH 17/59] Migrated to lombrok, completed CorbadoServerException, Completed ValidationService integration test --- pom.xml | 44 ++++-- .../exceptions/CorbadoServerException.java | 131 ++++++++++++++++-- src/main/java/com/corbado/sdk/Config.java | 114 ++++----------- src/main/java/com/corbado/sdk/CorbadoSdk.java | 74 +++++----- .../com/corbado/services/UserService.java | 10 +- src/main/resources/checkstyle.xml | 4 +- .../com/corbado/base/AbstractSdkTest.java | 24 ++++ .../corbado}/integration/UserServiceIT.java | 61 ++++---- .../{ => com/corbado}/util/TestUtils.java | 16 ++- 9 files changed, 298 insertions(+), 180 deletions(-) create mode 100644 src/test/java/com/corbado/base/AbstractSdkTest.java rename src/test/java/{ => com/corbado}/integration/UserServiceIT.java (76%) rename src/test/java/{ => com/corbado}/util/TestUtils.java (91%) diff --git a/pom.xml b/pom.xml index 4b55d6a..0564ff9 100644 --- a/pom.xml +++ b/pom.xml @@ -44,8 +44,29 @@ + + org.apache.maven.plugins + maven-failsafe-plugin + 3.3.1 + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + + integration-test + verify + + + + + - org.apache.maven.plugins + org.apache.maven.plugins maven-enforcer-plugin 3.4.1 @@ -64,10 +85,11 @@ + org.apache.maven.plugins maven-surefire-plugin - 2.22.2 + 3.3.1 @@ -211,7 +233,6 @@ - validate validate true @@ -231,6 +252,13 @@ + + + org.projectlombok + lombok + 1.18.34 + provided + com.google.code.findbugs @@ -296,12 +324,6 @@ ${junit-version} test - - org.junit.platform - junit-platform-runner - ${junit-platform-runner.version} - test - @@ -314,8 +336,8 @@ 3.14.0 0.2.6 1.3.5 - 5.10.2 - 1.10.0 + 5.10.3 + 1.10.3 2.1.1 1.1.1 UTF-8 diff --git a/src/main/java/com/corbado/exceptions/CorbadoServerException.java b/src/main/java/com/corbado/exceptions/CorbadoServerException.java index c57f483..b0635d7 100644 --- a/src/main/java/com/corbado/exceptions/CorbadoServerException.java +++ b/src/main/java/com/corbado/exceptions/CorbadoServerException.java @@ -1,15 +1,30 @@ package com.corbado.exceptions; import com.corbado.generated.invoker.ApiException; +import com.google.gson.Gson; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.NonNull; +import lombok.ToString; -/** Custom exception class for server-related errors. */ // TODO: Complete +/** Custom exception class for server-related errors. */ +@ToString public class CorbadoServerException extends Exception { + /** The Constant serialVersionUID. */ private static final long serialVersionUID = 5970919574670247150L; - private final int httpStatusCode; - private final String body; + /** The http status code. */ + @Getter private final int httpStatusCode; + + /** The body. */ + @NonNull @Getter private final ErrorResponse errorResponse; /** * Convert ApiException to ServerException. @@ -17,20 +32,116 @@ public class CorbadoServerException extends Exception { * @param e ApiException to be converted * @throws StandardException If response body is not a string */ - public CorbadoServerException(final ApiException e) { + public CorbadoServerException(@NonNull final ApiException e) { this(e.getCode(), e.getResponseBody()); } - public CorbadoServerException(final int statusCode, final String body) { + /** + * Instantiates a new corbado server exception. + * + * @param statusCode the status code + * @param body the body + */ + public CorbadoServerException(final int statusCode, @NonNull final String body) { + final Gson gson = new Gson(); httpStatusCode = statusCode; - this.body = body; + this.errorResponse = gson.fromJson(body, ErrorResponse.class); } - public String getBody() { - return body; + /** + * Gets the request id. + * + * @return the request id + */ + public String getRequestId() { + final Optional requestId = + Optional.ofNullable(this.errorResponse) + .map(ErrorResponse::getRequestData) + .map(RequestData::getRequestID); + + if (requestId.isPresent()) { + return requestId.get(); + } else { + // requestId should always be present + return null; + } + } + + /** + * Gets the validation messages. + * + * @return the validation messages + */ + public List getValidationMessages() { + final Optional> validationMessages = + Optional.ofNullable(this.errorResponse) + .map(ErrorResponse::getError) + .map(ErrorDetails::getValidation); + + if (validationMessages.isPresent()) { + return validationMessages.get(); + } else { + return Collections.emptyList(); + } } - public int getHttpStatusCode() { - return httpStatusCode; + /** The Class ErrorResponse. */ + @Data + @AllArgsConstructor + @NoArgsConstructor + public static class ErrorResponse { + + /** The error. */ + private ErrorDetails error; + + /** The http status code. */ + private int httpStatusCode; + + /** The request data. */ + private RequestData requestData; + + /** The runtime. */ + private double runtime; + } + + /** The Class ErrorDetails. */ + @Data + @AllArgsConstructor + public static class ErrorDetails { + + /** The links. */ + private List links; + + /** The type. */ + private String type; + + /** The validation. */ + private List validation; + } + + /** The Class ValidationDetails. */ + @Data + @AllArgsConstructor + @NoArgsConstructor + public static class ValidationMessage { + + /** The field. */ + private String field; + + /** The message. */ + private String message; + } + + /** The Class RequestData. */ + @Data + @AllArgsConstructor + @NoArgsConstructor + public static class RequestData { + + /** The link. */ + private String link; + + /** The request ID. */ + private String requestID; } } diff --git a/src/main/java/com/corbado/sdk/Config.java b/src/main/java/com/corbado/sdk/Config.java index 8d185a7..2878864 100644 --- a/src/main/java/com/corbado/sdk/Config.java +++ b/src/main/java/com/corbado/sdk/Config.java @@ -2,6 +2,8 @@ import java.net.MalformedURLException; import java.net.URL; +import lombok.Getter; +import lombok.Setter; /** * Configuration class for setting up project parameters. @@ -14,31 +16,37 @@ public class Config { // Fields - /** The project id. */ - private String projectId; + /** API secret must begin with this prefix. */ + private static final String API_SERCRET_PREFIX = "corbado1_"; - /** The api secret. */ - private String apiSecret; + /** Project Id must begin with this prefix. */ + private static final String PROJECT_ID_PREFIX = "pro-"; - /** The backend api. */ - private String backendApi = "https://backendapi.corbado.io"; + /** The project id with custom setter. */ + @Getter private String projectId; + + /** The api secret with custom setter. */ + @Getter private String apiSecret; + + /** The backend api with custom setter. */ + @Getter private String backendApi = "https://backendapi.corbado.io"; /** The short session cookie name. */ - private String shortSessionCookieName = "cbo_short_session"; + @Getter @Setter private String shortSessionCookieName = "cbo_short_session"; /** The issuer. */ - private String issuer; + @Getter @Setter private String issuer; - /** The frontend api. */ - private String frontendApi; + /** The frontend api with custom setter. */ + @Getter private String frontendApi; + // Constructors /** * Instantiates a new config. * * @param projectId the project id * @param apiSecret the api secret */ - // Constructors public Config(final String projectId, final String apiSecret) { setProjectId(projectId); // set and validate setApiSecret(apiSecret); @@ -48,67 +56,19 @@ public Config(final String projectId, final String apiSecret) { setIssuer(this.frontendApi); } - // Constructors - public Config(final String projectId, final String apiSecret, final String backendApi) { - this(projectId, apiSecret); - setBackendApi(backendApi); - } - - /** - * Gets the api secret. - * - * @return the api secret - */ - public String getApiSecret() { - return this.apiSecret; - } - - /** - * Gets the backend api. - * - * @return the backend api - */ - public String getBackendApi() { - return this.backendApi; - } - /** - * Gets the frontend api. - * - * @return the frontend api - */ - public String getFrontendApi() { - return this.frontendApi; - } - - /** - * Gets the issuer. + * Instantiates a new config. * - * @return the issuer + * @param projectId the project id + * @param apiSecret the api secret + * @param backendApi the backend api */ - public String getIssuer() { - return this.issuer; + public Config(final String projectId, final String apiSecret, final String backendApi) { + this(projectId, apiSecret); + setBackendApi(backendApi); } // Getters and Setters - /** - * Gets the project id. - * - * @return the project id - */ - public String getProjectId() { - return this.projectId; - } - - /** - * Gets the short session cookie name. - * - * @return the short session cookie name - */ - public String getShortSessionCookieName() { - return this.shortSessionCookieName; - } - /** * Sets the api secret. * @@ -116,7 +76,7 @@ public String getShortSessionCookieName() { * @throws IllegalArgumentException If the API secret does not start with "corbado1_". */ public void setApiSecret(final String apiSecret) { - if (!apiSecret.startsWith("corbado1_")) { + if (!apiSecret.startsWith(API_SERCRET_PREFIX)) { throw new IllegalArgumentException( "Invalid API Secret, must start with 'corbado1_', but was: " + apiSecret); } @@ -153,15 +113,6 @@ public void setFrontendApi(final String frontendApi) { this.frontendApi = frontendApi; } - /** - * Sets the issuer. - * - * @param issuer the new issuer - */ - public void setIssuer(final String issuer) { - this.issuer = issuer; - } - /** * Sets the project id. * @@ -169,19 +120,10 @@ public void setIssuer(final String issuer) { * @throws IllegalArgumentException If the project Id does not start with "pro-". */ public void setProjectId(final String projectId) { - if (!projectId.startsWith("pro-")) { + if (!projectId.startsWith(PROJECT_ID_PREFIX)) { throw new IllegalArgumentException( "Invalid project ID, must start with 'pro-', but was: " + projectId); } this.projectId = projectId; } - - /** - * Sets the short session cookie name. - * - * @param shortSessionCookieName the new short session cookie name - */ - public void setShortSessionCookieName(final String shortSessionCookieName) { - this.shortSessionCookieName = shortSessionCookieName; - } } diff --git a/src/main/java/com/corbado/sdk/CorbadoSdk.java b/src/main/java/com/corbado/sdk/CorbadoSdk.java index 9b0a9df..679d664 100644 --- a/src/main/java/com/corbado/sdk/CorbadoSdk.java +++ b/src/main/java/com/corbado/sdk/CorbadoSdk.java @@ -1,59 +1,49 @@ package com.corbado.sdk; -import java.util.HashMap; -import java.util.Map; - import com.corbado.exceptions.StandardException; import com.corbado.generated.api.UserApi; import com.corbado.generated.invoker.ApiClient; import com.corbado.services.UserService; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import lombok.Getter; +import lombok.NonNull; +import lombok.Setter; /** The Class CorbadoSdk. */ public class CorbadoSdk { - public static final String CORBADO_HEADER_NAME = "X-Corbado-SDK"; + /** The Constant CORBADO_HEADER_NAME. */ + private static final String CORBADO_HEADER_NAME = "X-Corbado-SDK"; /** The configuration class. */ - private Config config; + @Getter @Setter private Config config; - private UserService users; + /** The user API. */ + @Getter(lazy = true) + private final UserService users = new UserService(new UserApi(this.client)); + /** The client. */ private ApiClient client; - public CorbadoSdk(final Config config) throws StandardException { + /** + * Instantiates a new corbado sdk. + * + * @param config the config + * @throws StandardException the standard exception + */ + public CorbadoSdk(final @NonNull Config config) throws StandardException { this.config = config; initializeClient(); } - // Getters /** - * Gets the config. + * Initialize client. * - * @return the config + * @throws StandardException the standard exception */ - public Config getConfig() { - return config; - } - - // TODO: add language version - private String getLanguageVersion() { - return "1.8"; - } - - public UserService getUsers() { - if (users == null) { - this.users = new UserService(new UserApi(client)); - } - return users; - } - - // TODO: sdk version - private String getVersion() { - return "1.0.0"; - } - private void initializeClient() throws StandardException { final ApiClient tempClient = new ApiClient(); tempClient.setBasePath(this.config.getBackendApi()); @@ -78,13 +68,25 @@ private void initializeClient() throws StandardException { this.client = tempClient; } - // Setters + // Getters + /** - * Sets the config. + * Gets the language version. * - * @param config the new config + * @return the language version */ - public void setConfig(final Config config) { - this.config = config; + // TODO: add language version + private String getLanguageVersion() { + return "1.8"; + } + + /** + * Gets the version. + * + * @return the version + */ + // TODO: sdk version + public String getVersion() { + return "1.0.0"; } } diff --git a/src/main/java/com/corbado/services/UserService.java b/src/main/java/com/corbado/services/UserService.java index 8cbfbc8..16cc6b4 100644 --- a/src/main/java/com/corbado/services/UserService.java +++ b/src/main/java/com/corbado/services/UserService.java @@ -10,9 +10,9 @@ import com.corbado.generated.model.UserGetRsp; import com.corbado.generated.model.UserListRsp; import com.corbado.services.base.ApiService; - import java.util.List; +// TODO: Auto-generated Javadoc /** Service for managing users. */ public class UserService extends ApiService { @@ -97,6 +97,7 @@ public UserGetRsp get(final String userId, final String remoteAddr, final String * @param pageSize Page size. Use null if not needed. * @return UserListRsp Response * @throws CorbadoServerException If any server-side error occurs. + * @throws IllegalArgumentException if page or pageSize <=0 */ public UserListRsp listUsers( final String remoteAddr, @@ -105,10 +106,13 @@ public UserListRsp listUsers( final List filterArgs, final Integer page, final Integer pageSize) - throws CorbadoServerException { + throws CorbadoServerException, IllegalArgumentException { try { if (page != null && page <= 0) { - throw new IllegalArgumentException("page can not be <= 0"); + throw new IllegalArgumentException("age can not be <= 0"); + } + if (pageSize != null && pageSize <= 0) { + throw new IllegalArgumentException("Page size can not be <= 0"); } return client.userList(remoteAddr, userAgent, sort, filterArgs, page, pageSize); diff --git a/src/main/resources/checkstyle.xml b/src/main/resources/checkstyle.xml index 038a82b..9e6dc2f 100644 --- a/src/main/resources/checkstyle.xml +++ b/src/main/resources/checkstyle.xml @@ -19,7 +19,7 @@ --> - + @@ -180,6 +180,7 @@ + @@ -189,6 +190,7 @@ + diff --git a/src/test/java/com/corbado/base/AbstractSdkTest.java b/src/test/java/com/corbado/base/AbstractSdkTest.java new file mode 100644 index 0000000..b532a5f --- /dev/null +++ b/src/test/java/com/corbado/base/AbstractSdkTest.java @@ -0,0 +1,24 @@ +package com.corbado.base; + +import com.corbado.exceptions.StandardException; +import com.corbado.sdk.CorbadoSdk; +import com.corbado.util.TestUtils; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.TestInstance; + +/** The Class AbstractSdkTest. */ +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public class AbstractSdkTest { + /** The sdk. */ + protected CorbadoSdk sdk; + + /** + * Sets the sdk up. + * + * @throws StandardException the standard exception + */ + @BeforeAll + public void setUpSdk() throws StandardException { + sdk = TestUtils.instantiateSDK(); + } +} diff --git a/src/test/java/integration/UserServiceIT.java b/src/test/java/com/corbado/integration/UserServiceIT.java similarity index 76% rename from src/test/java/integration/UserServiceIT.java rename to src/test/java/com/corbado/integration/UserServiceIT.java index 8d9809a..e6fe4af 100644 --- a/src/test/java/integration/UserServiceIT.java +++ b/src/test/java/com/corbado/integration/UserServiceIT.java @@ -1,15 +1,13 @@ -package integration; +package com.corbado.integration; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; - -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInstance; - +import com.corbado.base.AbstractSdkTest; import com.corbado.exceptions.CorbadoServerException; +import com.corbado.exceptions.CorbadoServerException.ValidationMessage; import com.corbado.exceptions.StandardException; import com.corbado.generated.model.GenericRsp; import com.corbado.generated.model.UserCreateReq; @@ -17,30 +15,35 @@ import com.corbado.generated.model.UserDeleteReq; import com.corbado.generated.model.UserGetRsp; import com.corbado.generated.model.UserListRsp; -import com.corbado.sdk.CorbadoSdk; import com.corbado.services.UserService; +import com.corbado.util.TestUtils; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; -import util.TestUtils; - -@TestInstance(TestInstance.Lifecycle.PER_CLASS) -class UserServiceIT { +/** The Class UserServiceIT. */ +class UserServiceIT extends AbstractSdkTest { - protected CorbadoSdk sdk; + /** The fixture under test. */ protected UserService fixture; + /** + * Sets the up class. + * + * @throws StandardException the standard exception + */ @BeforeAll public void setUpClass() throws StandardException { - sdk = TestUtils.instantiateSDK(); fixture = sdk.getUsers(); } + /** Test instantiate sdk expect not null. */ @Test void test_InstantiateSdkExpectNotNull() { assertNotNull(sdk); } - @Test /** Test case for user creation with validation error. * */ + @Test void test_UserCreateBlankNameExpectValidationError() { final UserCreateReq req = new UserCreateReq().name("").email(""); @@ -48,13 +51,14 @@ void test_UserCreateBlankNameExpectValidationError() { assertThrows(CorbadoServerException.class, () -> fixture.create(req)); assertNotNull(e); assertEquals(400, e.getHttpStatusCode()); - // TODO: complete - // assertArrayEquals(new String[] {"name: cannot be blank"}, - // e.getValidationMessages().toArray()); + + assertArrayEquals( + new ValidationMessage[] {new ValidationMessage("name", "cannot be blank")}, + e.getValidationMessages().toArray()); } - @Test /** Test case for successful user creation. * */ + @Test void test_UserCreateExpectSuccess() throws CorbadoServerException { final UserCreateReq req = new UserCreateReq() @@ -65,8 +69,8 @@ void test_UserCreateExpectSuccess() throws CorbadoServerException { assertEquals(200, rsp.getHttpStatusCode()); } - @Test /** Test for retrieving a user that does not exist. * */ + @Test void test_UserGetExpectNotFound() { final CorbadoServerException e = assertThrows( @@ -79,39 +83,40 @@ void test_UserGetExpectNotFound() { assertEquals(404, e.getHttpStatusCode()); } - @Test /** Test for successfully retrieving a user. * */ + @Test void test_UserGetExpectSuccess() throws CorbadoServerException, StandardException { final String userId = TestUtils.createUser(); final UserGetRsp rsp = fixture.get(userId); assertEquals(200, rsp.getHttpStatusCode()); } - @Test /** Test for successfully deleting a user. * */ + @Test void test_UserDeleteExpectSuccess() throws CorbadoServerException, StandardException { final String userId = TestUtils.createUser(); final GenericRsp rsp = fixture.delete(userId, new UserDeleteReq()); assertEquals(200, rsp.getHttpStatusCode()); } + /** Test for listing users with validation error. * */ @Test void test_UserListInvalidSortExpectValidationError() { - /** Test for listing users with validation error. * */ final CorbadoServerException e = assertThrows( - CorbadoServerException.class, () -> fixture.listUsers("", "", "foo:bar", null, 0, 0)); + CorbadoServerException.class, + () -> fixture.listUsers("", "", "foo:bar", null, null, null)); assertNotNull(e); assertEquals(422, e.getHttpStatusCode()); - // TODO - // assertArrayEquals( - // new String[] {"sort: Invalid order direction 'bar'"}, - // e.getValidationMessages().toArray()); + + assertArrayEquals( + new ValidationMessage[] {new ValidationMessage("sort", "Invalid order direction 'bar'")}, + e.getValidationMessages().toArray()); } + /** Test for successfully listing users. * */ @Test void test_UserListSuccess() throws CorbadoServerException, StandardException { - /** Test for successfully listing users. * */ final String userId = TestUtils.createUser(); final UserListRsp rsp = fixture.listUsers(null, null, "created:desc", null, null, null); diff --git a/src/test/java/util/TestUtils.java b/src/test/java/com/corbado/util/TestUtils.java similarity index 91% rename from src/test/java/util/TestUtils.java rename to src/test/java/com/corbado/util/TestUtils.java index 80f9830..4a2e712 100644 --- a/src/test/java/util/TestUtils.java +++ b/src/test/java/com/corbado/util/TestUtils.java @@ -1,6 +1,4 @@ -package util; - -import java.util.Random; +package com.corbado.util; import com.corbado.exceptions.CorbadoServerException; import com.corbado.exceptions.StandardException; @@ -8,12 +6,20 @@ import com.corbado.generated.model.UserCreateRsp; import com.corbado.sdk.Config; import com.corbado.sdk.CorbadoSdk; - import io.github.cdimascio.dotenv.Dotenv; +import java.util.Random; -public class TestUtils { // Constants for environment variable names +// TODO: Auto-generated Javadocs +/** The Class TestUtils. */ +public class TestUtils { + /** The Constant CORBADO_API_SECRET. */ + // Constants for environment variable names public static final String CORBADO_API_SECRET = "CORBADO_API_SECRET"; + + /** The Constant CORBADO_PROJECT_ID. */ public static final String CORBADO_PROJECT_ID = "CORBADO_PROJECT_ID"; + + /** The Constant CORBADO_BACKEND_API. */ public static final String CORBADO_BACKEND_API = "CORBADO_BACKEND_API"; /** From e932c903f66d9fd03d7a880a6256f91a3b715924 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 12 Jul 2024 15:19:06 +0200 Subject: [PATCH 18/59] change test phase in ci to verify --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b44d525..b61db22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,5 +92,5 @@ jobs: ${{ runner.os }}-maven- - name: Run test suite - run: mvn test + run: mvn --batch-mode --update-snapshots verify From 0695e9a441b256ddba3a20c4235ecdaa6bfeabdd Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 12 Jul 2024 19:35:39 +0200 Subject: [PATCH 19/59] Partially implemented SessionService/Test --- pom.xml | 45 ++- .../java/com/corbado/entities/UserEntity.java | 107 ++++++ .../com/corbado/services/SessionService.java | 145 ++++++++- .../com/corbado/services/UserService.java | 3 +- .../com/corbado/utils/ValidationUtils.java | 26 ++ .../com/corbado/unit/SessionServiceTest.java | 308 ++++++++++++++++++ src/test/java/com/corbado/unit/data/jwks.json | 1 + .../java/com/corbado/unit/data/rsakey.pem | 28 ++ 8 files changed, 643 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/corbado/entities/UserEntity.java create mode 100644 src/main/java/com/corbado/utils/ValidationUtils.java create mode 100644 src/test/java/com/corbado/unit/SessionServiceTest.java create mode 100644 src/test/java/com/corbado/unit/data/jwks.json create mode 100644 src/test/java/com/corbado/unit/data/rsakey.pem diff --git a/pom.xml b/pom.xml index 0564ff9..2c865fe 100644 --- a/pom.xml +++ b/pom.xml @@ -48,13 +48,6 @@ org.apache.maven.plugins maven-failsafe-plugin 3.3.1 - - - org.junit.jupiter - junit-jupiter-engine - ${junit-version} - - @@ -105,14 +98,6 @@ methods 10 - - - - org.junit.jupiter - junit-jupiter-engine - ${junit-version} - - @@ -251,7 +236,19 @@ - + + + + com.auth0 + java-jwt + 4.4.0 + + + com.auth0 + jwks-rsa + 0.22.1 + + org.projectlombok @@ -318,6 +315,19 @@ ${javax.ws.rs-api-version} + + org.mockito + mockito-junit-jupiter + + ${mockito-version} + test + + + org.junit.jupiter + junit-jupiter-params + ${junit-version} + test + org.junit.jupiter junit-jupiter-engine @@ -336,7 +346,8 @@ 3.14.0 0.2.6 1.3.5 - 5.10.3 + 5.9.1 + 4.11.0 1.10.3 2.1.1 1.1.1 diff --git a/src/main/java/com/corbado/entities/UserEntity.java b/src/main/java/com/corbado/entities/UserEntity.java new file mode 100644 index 0000000..234a7a4 --- /dev/null +++ b/src/main/java/com/corbado/entities/UserEntity.java @@ -0,0 +1,107 @@ +package com.corbado.entities; + +import com.corbado.exceptions.StandardException; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** The Class UserEntity. */ +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class UserEntity { + + /** Text response in case the user is not authenticated. */ + public static final String NO_AUTH = "User is not authenticated"; + + /** Is user authenticated. */ + private boolean authenticated; + + /** The user id. */ + @Builder.Default private String userId = ""; + + /** The name. */ + @Builder.Default private String name = ""; + + /** The email. */ + @Builder.Default private String email = ""; + + /** The phone number. */ + @Builder.Default private String phoneNumber = ""; + + /** + * Gets the user id. + * + * @return the user id + * @throws StandardException the standard exception + */ + public String getUserId() throws StandardException { + if (!authenticated) { + throw new StandardException(NO_AUTH); + } + return userId; + } + + /** + * Gets the name. + * + * @return the name + * @throws StandardException the standard exception + */ + public String getName() throws StandardException { + if (!authenticated) { + throw new StandardException(NO_AUTH); + } + return name; + } + + /** + * Gets the email. + * + * @return the email + * @throws StandardException the standard exception + */ + public String getEmail() throws StandardException { + if (!authenticated) { + throw new StandardException(NO_AUTH); + } + return email; + } + + /** + * Gets the phone number. + * + * @return the phone number + * @throws StandardException the standard exception + */ + public String getPhoneNumber() throws StandardException { + if (!authenticated) { + throw new StandardException(NO_AUTH); + } + return phoneNumber; + } + + /** + * Creates the authenticated user. + * + * @param userId the user id + * @param name the name + * @param email the email + * @param phoneNumber the phone number + * @return the user entity + */ + public static UserEntity createAuthenticatedUser( + final String userId, final String name, final String email, final String phoneNumber) { + return UserEntity.builder() + .name(name) + .authenticated(true) + .userId(userId) + .email(email) + .phoneNumber(phoneNumber) + .build(); + } +} diff --git a/src/main/java/com/corbado/services/SessionService.java b/src/main/java/com/corbado/services/SessionService.java index b704f76..1e5f21d 100644 --- a/src/main/java/com/corbado/services/SessionService.java +++ b/src/main/java/com/corbado/services/SessionService.java @@ -1,3 +1,146 @@ package com.corbado.services; -public class SessionService {} +import com.auth0.jwk.Jwk; +import com.auth0.jwk.JwkException; +import com.auth0.jwk.JwkProvider; +import com.auth0.jwk.JwkProviderBuilder; +import com.auth0.jwt.JWT; +import com.auth0.jwt.JWTVerifier; +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.interfaces.DecodedJWT; +import com.corbado.entities.UserEntity; +import com.corbado.utils.ValidationUtils; +import java.security.interfaces.RSAPublicKey; +import java.util.concurrent.TimeUnit; +import lombok.Getter; +import lombok.NonNull; +import lombok.Setter; + +/** + * This class provides functionality for managing sessions, including validation and retrieval of + * user information from short-term session tokens. + */ +@Getter +@Setter +public class SessionService { + + /** Number of keys that can be cached. */ + private static final int JWK_CACHE_SIZE = 100; + + /** The short session cookie name. */ + private String shortSessionCookieName; + + /** The issuer. */ + private String issuer; + + /** The jwks uri. */ + private String jwksUri; + + /** The last short session validation result. */ + private String lastShortSessionValidationResult; + + /** The short session length. */ + private int shortSessionLength = 300; // Default short session length in seconds + + /** The cache keys. */ + private boolean cacheKeys = false; + + /** The jwk provider. */ + private JwkProvider jwkProvider; + + /** + * Instantiates a new session service. + * + * @param shortSessionCookieName the short session cookie name + * @param issuer the issuer + * @param jwksUri the jwks uri + * @param shortSessionLength the short session length + * @param cacheKeys the cache keys + */ + public SessionService( + final String shortSessionCookieName, + final String issuer, + final String jwksUri, + final int shortSessionLength, + final boolean cacheKeys) { + + ValidationUtils.validateNotEmpty(shortSessionCookieName, issuer, jwksUri); + + this.shortSessionCookieName = shortSessionCookieName; + this.issuer = issuer; + this.jwksUri = jwksUri; + this.shortSessionLength = shortSessionLength; + this.cacheKeys = cacheKeys; + + final JwkProviderBuilder jwkProviderBuilder = new JwkProviderBuilder(this.jwksUri); + if (cacheKeys) { + jwkProviderBuilder.cached(JWK_CACHE_SIZE, shortSessionLength, TimeUnit.SECONDS); + } + this.jwkProvider = jwkProviderBuilder.build(); + } + + /** + * Gets the and validate short session value. + * + * @param shortSession the short session + * @return the and validate short session value + * @throws JwkException if no jwk can be found using the given kid + */ + public UserEntity getAndValidateShortSessionValue(final String shortSession) { + + if (shortSession == null || shortSession.isEmpty()) { + return UserEntity.builder().authenticated(false).build(); + } + try { + // Get the signing key + DecodedJWT decodedJwt = JWT.decode(shortSession); + final Jwk jwk = jwkProvider.get(decodedJwt.getKeyId()); + final RSAPublicKey publicKey = (RSAPublicKey) jwk.getPublicKey(); + + // Verify and decode the JWT using the signing key + final Algorithm algorithm = Algorithm.RSA256(publicKey); + final JWTVerifier verifier = JWT.require(algorithm).build(); + + decodedJwt = verifier.verify(shortSession); + System.out.println(decodedJwt); + + } catch (final JwkException e) { + setValidationError(e); + return UserEntity.builder().authenticated(false).build(); + } + return null; + } + + /** + * Gets the current user. + * + * @param shortSession the short session + * @return the current user + */ + public UserEntity getCurrentUser(final String shortSession) { + if (shortSession == null || shortSession.isEmpty()) { + return UserEntity.builder().authenticated(false).build(); + } + return getAndValidateShortSessionValue(shortSession); + } + + /** + * Sets the issuer mismatch error. + * + * @param issuer the new issuer mismatch error + */ + public void setIssuerMismatchError(final String issuer) { + this.lastShortSessionValidationResult = + String.format("Mismatch in issuer (configured: %s, JWT: %s)", this.issuer, issuer); + } + + /** + * Sets the validation error. + * + * @param error the new validation error + */ + public void setValidationError(@NonNull final Exception error) { + this.lastShortSessionValidationResult = + String.format("JWT validation failed: %s", error.getMessage()); + } +} diff --git a/src/main/java/com/corbado/services/UserService.java b/src/main/java/com/corbado/services/UserService.java index 16cc6b4..4d560d7 100644 --- a/src/main/java/com/corbado/services/UserService.java +++ b/src/main/java/com/corbado/services/UserService.java @@ -12,12 +12,11 @@ import com.corbado.services.base.ApiService; import java.util.List; -// TODO: Auto-generated Javadoc /** Service for managing users. */ public class UserService extends ApiService { /** - * s Constructor for UserService. + * Constructor for UserService. * * @param client User API client */ diff --git a/src/main/java/com/corbado/utils/ValidationUtils.java b/src/main/java/com/corbado/utils/ValidationUtils.java new file mode 100644 index 0000000..2f05155 --- /dev/null +++ b/src/main/java/com/corbado/utils/ValidationUtils.java @@ -0,0 +1,26 @@ +package com.corbado.utils; + +import java.util.stream.Stream; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +/** Utility class for validation logic. */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class ValidationUtils { + + /** + * Validate not empty. + * + * @param args the fields to validate + */ + public static void validateNotEmpty(final String... args) { + Stream.of(args) + .filter(arg -> arg == null || arg.isEmpty()) + .findAny() + .ifPresent( + arg -> { + throw new IllegalArgumentException( + "Argument '" + arg + "' must not be null or empty"); + }); + } +} diff --git a/src/test/java/com/corbado/unit/SessionServiceTest.java b/src/test/java/com/corbado/unit/SessionServiceTest.java new file mode 100644 index 0000000..9b71f0c --- /dev/null +++ b/src/test/java/com/corbado/unit/SessionServiceTest.java @@ -0,0 +1,308 @@ +package com.corbado.unit; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import com.auth0.jwk.JwkProvider; +import com.auth0.jwt.JWT; +import com.auth0.jwt.algorithms.Algorithm; +import com.corbado.services.SessionService; +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.KeyFactory; +import java.security.NoSuchAlgorithmException; +import java.security.interfaces.RSAPrivateKey; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.PKCS8EncodedKeySpec; +import java.util.ArrayList; +import java.util.Base64; +import java.util.Date; +import java.util.List; +import java.util.stream.Stream; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +public class SessionServiceTest { + + /** The Constant PRIVATE_KEY_PATH. */ + private static final String PRIVATE_KEY_PATH = "src/test/java/com/corbado/unit/data/rsakey.pem"; + + /** The Constant JWKS_PATH. */ + private static final String JWKS_PATH = "src/test/java/com/corbado/unit/data/jwks.json"; + + /** The Constant TEST_NAME. */ + private static final String TEST_NAME = "Test Name"; + + /** The Constant TEST_EMAIL. */ + private static final String TEST_EMAIL = "test@email.com"; + + /** The Constant TEST_PHONE_NUMBER. */ + private static final String TEST_PHONE_NUMBER = "+012345678"; + + /** The Constant TEST_USER_ID. */ + private static final String TEST_USER_ID = "12345"; + + /** The jwk provider. */ + @Mock private JwkProvider jwkProvider; + + /** The session service. */ + @InjectMocks private static SessionService sessionService; + + /** The jwks. */ + private static byte[] jwks; + + /** The private key. */ + private static RSAPrivateKey privateKey; + + // ------------------ Set up --------------------- // + /** + * Sets the up class. + * + * @throws IOException Signals that an I/O exception has occurred. + * @throws NoSuchAlgorithmException + * @throws InvalidKeySpecException + */ + @BeforeAll + public static void setUpClass() + throws IOException, NoSuchAlgorithmException, InvalidKeySpecException { + sessionService = createSessionService(); + jwks = Files.readAllBytes(Paths.get(JWKS_PATH)); + + privateKey = readPrivateKey(PRIVATE_KEY_PATH); + } + + /** + * Sets the up. + * + * @throws IOException Signals that an I/O exception has occurred. + */ + @BeforeEach + public void setUp() throws IOException {} + + // ------------------ Tests --------------------- // + + /** + * Test test data is present. + * + * @throws InvalidKeySpecException the invalid key spec exception + * @throws NoSuchAlgorithmException the no such algorithm exception + */ + @Test + void test_testDataIsPresent() throws InvalidKeySpecException, NoSuchAlgorithmException { + assertNotNull(sessionService); + assertNotNull(jwks); + assertNotNull(privateKey); + } + + /** + * Test test generate gwt. + * + * @throws InvalidKeySpecException the invalid key spec exception + * @throws NoSuchAlgorithmException the no such algorithm exception + */ + @Test + void test_testGenerateGwt() throws InvalidKeySpecException, NoSuchAlgorithmException { + assertNotNull(generateJwt("1", 3, 4)); + } + + /** + * Test init parameters validation. + * + * @param issuer the issuer + * @param jwksUri the jwks uri + * @param shortSessionCookieName the short session cookie name + * @param expectValid the expect valid + */ + @ParameterizedTest + @MethodSource("initParametersTestData") + void testInitParametersValidation( + final String issuer, + final String jwksUri, + final String shortSessionCookieName, + final boolean expectValid) { + if (expectValid) { + // No exception should be raised + assertDoesNotThrow( + () -> new SessionService(shortSessionCookieName, issuer, jwksUri, 0, false)); + } else { + // ValidationError should be raised + assertThrows( + IllegalArgumentException.class, + () -> new SessionService(shortSessionCookieName, issuer, jwksUri, 0, false)); + } + } + + /** + * Test get and validate short session value. + * + * @param issuer the issuer + * @param jwksUri the jwks uri + * @param shortSessionCookieName the short session cookie name + * @param expectValid the expect valid + */ + @ParameterizedTest + @MethodSource("provideJwts") + void test_GetAndValidateShortSessionValue(final boolean expectValid, final String jwt) { + assertEquals( + expectValid, sessionService.getAndValidateShortSessionValue(jwt).isAuthenticated()); + } + + // ------------------ Test data --------------------- // + + /** + * Inits the parameters test data. + * + * @return the stream + */ + static Stream initParametersTestData() { + return Stream.of( + // Valid session service + new Object[] {"s", "2", "name", true}, + // Test empty issuer + new Object[] {"", "2", "name", false}, + // Test empty jwks_uri + new Object[] {"s", "", "name", false}, + // Test empty short_session_cookie_name + new Object[] {"s", "2", "", false}); + } + + /** + * Provide jwts. + * + * @return the list + * @throws NoSuchAlgorithmException + * @throws InvalidKeySpecException + */ + static List provideJwts() throws InvalidKeySpecException, NoSuchAlgorithmException { + final List testData = new ArrayList<>(); + + // JWT with invalid format + testData.add(new Object[] {false, "invalid"}); + + // JWT signed with wrong algorithm (HS256 instead of RS256) + final String jwtWithWrongAlgorithm = + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ik" + + "pvaG4gRG9lIiwiYWRtaW4iOnRydWV9.dyt0CoTl4WoVjAHI9Q_CwSKhl6d_9rhM3NrXuJttkao"; + testData.add(new Object[] {false, jwtWithWrongAlgorithm}); + + // Not before (nbf) in future + testData.add( + new Object[] { + false, + generateJwt( + "https://auth.acme.com", + System.currentTimeMillis() / 1000 + 100, + System.currentTimeMillis() / 1000 + 100) + }); + + // Expired (exp) + testData.add( + new Object[] { + false, + generateJwt( + "https://auth.acme.com", + System.currentTimeMillis() / 1000 - 100, + System.currentTimeMillis() / 1000 - 100) + }); + + // Invalid issuer (iss) + testData.add( + new Object[] { + false, + generateJwt( + "https://invalid.com", + System.currentTimeMillis() / 1000 + 100, + System.currentTimeMillis() / 1000 - 100) + }); + + // Success + testData.add( + new Object[] { + true, + generateJwt( + "https://auth.acme.com", + System.currentTimeMillis() / 1000 + 100, + System.currentTimeMillis() / 1000 - 100) + }); + + return testData; + } + + // ------------------ Utility functions--------------------- // + + /** + * Read private key. + * + * @param privateKeyPath the private key path + * @throws IOException Signals that an I/O exception has occurred. + * @throws NoSuchAlgorithmException the no such algorithm exception + * @throws InvalidKeySpecException the invalid key spec exception + */ + private static RSAPrivateKey readPrivateKey(final String privateKeyPath) + throws IOException, NoSuchAlgorithmException, InvalidKeySpecException { + String privateKeyString = + new String(Files.readAllBytes(Paths.get(privateKeyPath)), Charset.defaultCharset()); + + privateKeyString = + privateKeyString + .replace("-----BEGIN PRIVATE KEY-----", "") + .replaceAll(System.lineSeparator(), "") + .replace("\n", "") + .replace("-----END PRIVATE KEY-----", ""); + final byte[] encoded = Base64.getDecoder().decode(privateKeyString); + final KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + final PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(encoded); + return (RSAPrivateKey) keyFactory.generatePrivate(keySpec); + } + + /** + * Generate jwt. + * + * @param iss the iss + * @param exp the exp + * @param nbf the nbf + * @return the string + * @throws InvalidKeySpecException + * @throws NoSuchAlgorithmException + */ + private static String generateJwt(final String iss, final long exp, final long nbf) + throws InvalidKeySpecException, NoSuchAlgorithmException { + + // Now you have RSAPrivateKey, you can use it as needed + final Algorithm algorithm = Algorithm.RSA256(privateKey); + return JWT.create() + .withIssuer(iss) + .withIssuedAt(new Date()) + .withExpiresAt(new Date(exp * 1000L)) + .withNotBefore(new Date(nbf * 1000L)) + .withSubject(TEST_USER_ID) + .withClaim("name", TEST_NAME) + .withClaim("email", TEST_EMAIL) + .withClaim("phone_number", TEST_PHONE_NUMBER) + .sign(algorithm); + } + + /** + * Creates the session service. Warning! You should normally use SessionInterface from CorbadoSDK + * for non-test purposes. + */ + private static SessionService createSessionService() { + return new SessionService( + "cbo_short_session", + "https://auth.acme.com", + "https://example_uri.com", + 10, + false); // URLs do not matter, url access is mocked + } +} diff --git a/src/test/java/com/corbado/unit/data/jwks.json b/src/test/java/com/corbado/unit/data/jwks.json new file mode 100644 index 0000000..caf26f4 --- /dev/null +++ b/src/test/java/com/corbado/unit/data/jwks.json @@ -0,0 +1 @@ +{"keys":[{"alg":"RS256","kty":"RSA","kid":"kid123","n":"uzWHNM5f-amCjQztc5QTfJfzCC5J4nuW-L_aOxZ4f8J3FrewM2c_dufrnmedsApb0By7WhaHlcqCh_ScAPyJhzkPYLae7bTVro3hok0zDITR8F6SJGL42JAEUk-ILkPI-DONM0-3vzk6Kvfe548tu4czCuqU8BGVOlnp6IqBHhAswNMM78pos_2z0CjPM4tbeXqSTTbNkXRboxjU29vSopcT51koWOgiTf3C7nJUoMWZHZI5HqnIhPAG9yv8HAgNk6CMk2CadVHDo4IxjxTzTTqo1SCSH2pooJl9O8at6kkRYsrZWwsKlOFE2LUce7ObnXsYihStBUDoeBQlGG_BwQ","e":"AQAB"}]} \ No newline at end of file diff --git a/src/test/java/com/corbado/unit/data/rsakey.pem b/src/test/java/com/corbado/unit/data/rsakey.pem new file mode 100644 index 0000000..4b29dd5 --- /dev/null +++ b/src/test/java/com/corbado/unit/data/rsakey.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9wUxMacTb6sde +UvU1OkGU80bIkKRQC/7EqU7scwL7yCKZKY7uPg2VH93ggnCzvDusD8dcsEdNetrF +54Tv+aNzZrNHVpficcx/hPTWTIRrhBtefPG20LcKmRGKWmKoiLZ+yGRW9OLQ1OBA ++RvHy8vEUCYLAqC+8909b3ouKt+LASf9qrQVKWdFEgVAoyJFFP+kvYGEK2y6+5Ee +yYng6xW/aa8yC8OyTO6a1g8fELSKupxJrvm2aJubE6UvUxSvUjrX9kd8+nvaV2Uj +xE31Iaer+vvWz5dRTYoi1EMMVEc8h+Z/C+TGm6fhNR3gYi/e+bO+njkMYvUDG8N0 +gEJ5pubfAgMBAAECggEAEFsmCXwgdNhS4QWDj1f7KSyjEEyvbRrrleYGIIl1W2CP +4uXbJRwCLbV2eZCkyElUV2twwsOLEdmiG+bt5YV+Gkdi8qY7J1Cp0OAT/pjP3Tig +508bwqdQ77/r7CIIWQCXwmvhgkFPf7KptdADHgCqCrzh2pcaZfs9ObtvK6WUaTXE ++K0o2hZe6qjfloO9o7Sj9b1NZ4YqjJAhDiTrgpgTLbJ0HHuy1PI4faUVb5ORi8y4 +Wy44gcYpbgEbpO97aYY1jx4LHYWKzY9wd4Wu8T805PkTaiYnnVDZMUgqJZYY7JLn +Qyv1C4jbPw74gHftaT0auIB4Xwjc0OqisnnB7VjuqQKBgQD7upjRn6Og5xc5vHbq +nFSBb/jHNi5TDsykUAV9FXcf85C0JAFG/tZyzu130PlRrPcEMif5956tAKhXpKDY +t5Zw5GrSJlWCi00Ezn6Hg1Zka5/uT5/0HFNdrZdKA85qNb28EYT6khqh6HFUzErm +Qxk3/5QPRgLmXJNMrlGpsWhkYwKBgQDA+YNhszw5Vj1mnxOaV02grPwN4OIK0hVi +E+BjpUTXCS3emSE46/jAmE+YOg+KaXd0BgIv0+Bmgaa6+3DqZT0IBZln2n1Cw6HT +tr6Go+ifSJrXuce8EKggICkaq5xFxVA5G33un7rzCGO7U8nMtKRwb0WUnH2zqZgd +uD+1axPGVQKBgQDbi4SY3shRHvtMqah1Od8h/MxWwlRosDGe5QPEciIxRbZgxj4u +8zeJbhwCMcogh9/wUuY2xtYnQLmRps159bRJxY28tx5A+skzdf04pz2D27HioKN6 +vfGfdDTMosE2NKTED+uQtjhwGVAuivaQGNk307oIECGbVAZMDITAoS/QzQKBgDJN +F9UQvmMHusuULazuktqOHMmVU/aUGmTNX5E51D7lMqKycbl/sQCq8xxwDfr7UNra +chl7diPiKc7VmfJPX2BG7Vzn0/ziN72TBgjcktdqOop+77Ry9xAgsfY0w3BgZW/t +XZ8k3btZ9X0v8ws8Dx0LtCxvukhprbAZhenJNoddAoGAYLEnYHCdy9Yj7qasxvZp +nRW2rmrEG6XKVE5+Ate0tXAJBxfQtELAtWMIDZb+9a1uEkoHpG5s+gz3Zot6woBs +hVlZ/2JY5QxMeugYkd+XsSILHjYCA++CXBsW4C5o9EYkR5ududpaVRGm1BH5VabM +jveX6FQE5DcHR31gGG1Sweo= +-----END PRIVATE KEY----- From f3976d5234f3edb7a21c0c2e9288bb1d9af1dc78 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 2 Aug 2024 15:56:24 +0200 Subject: [PATCH 20/59] Implemented session service --- .../java/com/corbado/entities/UserEntity.java | 2 +- .../com/corbado/services/SessionService.java | 59 ++++++++------ .../com/corbado/unit/SessionServiceTest.java | 78 +++++++++++++++---- src/test/java/com/corbado/unit/data/jwks.json | 2 +- .../java/com/corbado/unit/data/rsakey.pem | 27 +------ 5 files changed, 101 insertions(+), 67 deletions(-) diff --git a/src/main/java/com/corbado/entities/UserEntity.java b/src/main/java/com/corbado/entities/UserEntity.java index 234a7a4..7fd764e 100644 --- a/src/main/java/com/corbado/entities/UserEntity.java +++ b/src/main/java/com/corbado/entities/UserEntity.java @@ -19,7 +19,7 @@ public class UserEntity { public static final String NO_AUTH = "User is not authenticated"; /** Is user authenticated. */ - private boolean authenticated; + @Builder.Default private boolean authenticated = false; /** The user id. */ @Builder.Default private String userId = ""; diff --git a/src/main/java/com/corbado/services/SessionService.java b/src/main/java/com/corbado/services/SessionService.java index 1e5f21d..40aa5a9 100644 --- a/src/main/java/com/corbado/services/SessionService.java +++ b/src/main/java/com/corbado/services/SessionService.java @@ -4,14 +4,17 @@ import com.auth0.jwk.JwkException; import com.auth0.jwk.JwkProvider; import com.auth0.jwk.JwkProviderBuilder; +import com.auth0.jwk.SigningKeyNotFoundException; import com.auth0.jwt.JWT; import com.auth0.jwt.JWTVerifier; import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.exceptions.JWTVerificationException; import com.auth0.jwt.interfaces.DecodedJWT; import com.corbado.entities.UserEntity; import com.corbado.utils.ValidationUtils; import java.security.interfaces.RSAPublicKey; import java.util.concurrent.TimeUnit; +import org.apache.commons.lang3.StringUtils; import lombok.Getter; import lombok.NonNull; import lombok.Setter; @@ -79,59 +82,71 @@ public SessionService( this.jwkProvider = jwkProviderBuilder.build(); } + /** + * Sets the issuer mismatch error. + * + * @param issuer the new issuer mismatch error + */ + public void setIssuerMismatchError(final String issuer) { + this.lastShortSessionValidationResult = + String.format("Mismatch in issuer (configured: %s, JWT: %s)", this.issuer, issuer); + } + /** * Gets the and validate short session value. * * @param shortSession the short session * @return the and validate short session value - * @throws JwkException if no jwk can be found using the given kid */ - public UserEntity getAndValidateShortSessionValue(final String shortSession) { + private UserEntity getAndValidateUserFromShortSessionValue(final String shortSession) { if (shortSession == null || shortSession.isEmpty()) { - return UserEntity.builder().authenticated(false).build(); + throw new IllegalArgumentException("Session value cannot be null or empty"); } try { // Get the signing key DecodedJWT decodedJwt = JWT.decode(shortSession); final Jwk jwk = jwkProvider.get(decodedJwt.getKeyId()); + if (jwk == null) { + throw new SigningKeyNotFoundException(shortSession, null); + } final RSAPublicKey publicKey = (RSAPublicKey) jwk.getPublicKey(); // Verify and decode the JWT using the signing key final Algorithm algorithm = Algorithm.RSA256(publicKey); final JWTVerifier verifier = JWT.require(algorithm).build(); - decodedJwt = verifier.verify(shortSession); - System.out.println(decodedJwt); - } catch (final JwkException e) { + // Verify issuer + if (!StringUtils.equals(decodedJwt.getClaim("iss").asString(), this.issuer)) { + setIssuerMismatchError(decodedJwt.getClaim("iss").asString()); + return UserEntity.builder().authenticated(false).build(); + } + + return UserEntity.builder() + .authenticated(true) + .userId(decodedJwt.getClaim("sub").asString()) + .name(decodedJwt.getClaim("name").asString()) + .email(decodedJwt.getClaim("email").asString()) + .phoneNumber(decodedJwt.getClaim("phone_number").asString()) + .build(); + + } catch (final JwkException | JWTVerificationException e) { setValidationError(e); return UserEntity.builder().authenticated(false).build(); } - return null; } /** - * Gets the current user. + * Gets the current user. Returns empty unauthorized user in the case if token is not valid or + * error occurred. * * @param shortSession the short session * @return the current user */ public UserEntity getCurrentUser(final String shortSession) { - if (shortSession == null || shortSession.isEmpty()) { - return UserEntity.builder().authenticated(false).build(); - } - return getAndValidateShortSessionValue(shortSession); - } - /** - * Sets the issuer mismatch error. - * - * @param issuer the new issuer mismatch error - */ - public void setIssuerMismatchError(final String issuer) { - this.lastShortSessionValidationResult = - String.format("Mismatch in issuer (configured: %s, JWT: %s)", this.issuer, issuer); + return getAndValidateUserFromShortSessionValue(shortSession); } /** @@ -139,7 +154,7 @@ public void setIssuerMismatchError(final String issuer) { * * @param error the new validation error */ - public void setValidationError(@NonNull final Exception error) { + private void setValidationError(@NonNull final Exception error) { this.lastShortSessionValidationResult = String.format("JWT validation failed: %s", error.getMessage()); } diff --git a/src/test/java/com/corbado/unit/SessionServiceTest.java b/src/test/java/com/corbado/unit/SessionServiceTest.java index 9b71f0c..bea0767 100644 --- a/src/test/java/com/corbado/unit/SessionServiceTest.java +++ b/src/test/java/com/corbado/unit/SessionServiceTest.java @@ -4,10 +4,21 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.anyString; +import com.auth0.jwk.Jwk; +import com.auth0.jwk.JwkException; import com.auth0.jwk.JwkProvider; import com.auth0.jwt.JWT; import com.auth0.jwt.algorithms.Algorithm; +import com.corbado.entities.UserEntity; +import com.corbado.exceptions.StandardException; import com.corbado.services.SessionService; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.google.gson.JsonSyntaxException; +import java.io.FileNotFoundException; +import java.io.FileReader; import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Files; @@ -19,8 +30,10 @@ import java.security.spec.PKCS8EncodedKeySpec; import java.util.ArrayList; import java.util.Base64; +import java.util.Collections; import java.util.Date; import java.util.List; +import java.util.Map; import java.util.stream.Stream; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -30,8 +43,10 @@ import org.junit.jupiter.params.provider.MethodSource; import org.mockito.InjectMocks; import org.mockito.Mock; +import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; +/** Unit Test for session service. */ @ExtendWith(MockitoExtension.class) public class SessionServiceTest { @@ -60,35 +75,43 @@ public class SessionServiceTest { @InjectMocks private static SessionService sessionService; /** The jwks. */ - private static byte[] jwks; + private static JsonArray jwks; /** The private key. */ private static RSAPrivateKey privateKey; // ------------------ Set up --------------------- // + /** * Sets the up class. * * @throws IOException Signals that an I/O exception has occurred. - * @throws NoSuchAlgorithmException - * @throws InvalidKeySpecException + * @throws NoSuchAlgorithmException the no such algorithm exception + * @throws InvalidKeySpecException the invalid key spec exception */ @BeforeAll public static void setUpClass() throws IOException, NoSuchAlgorithmException, InvalidKeySpecException { + // generateKeyPair(); sessionService = createSessionService(); - jwks = Files.readAllBytes(Paths.get(JWKS_PATH)); - + jwks = readJwks(); privateKey = readPrivateKey(PRIVATE_KEY_PATH); } /** - * Sets the up. + * Set up before each test. * * @throws IOException Signals that an I/O exception has occurred. + * @throws JsonSyntaxException the json syntax exception + * @throws JwkException the jwk exception */ + @SuppressWarnings("unchecked") @BeforeEach - public void setUp() throws IOException {} + public void setUp() throws IOException, JsonSyntaxException, JwkException { + final Gson gson = new Gson(); + final Jwk ret = Jwk.fromValues(gson.fromJson(jwks.get(0), Map.class)); + Mockito.lenient().when(jwkProvider.get(anyString())).thenReturn(ret); + } // ------------------ Tests --------------------- // @@ -106,13 +129,13 @@ void test_testDataIsPresent() throws InvalidKeySpecException, NoSuchAlgorithmExc } /** - * Test test generate gwt. + * Test test generate jwt. * * @throws InvalidKeySpecException the invalid key spec exception * @throws NoSuchAlgorithmException the no such algorithm exception */ @Test - void test_testGenerateGwt() throws InvalidKeySpecException, NoSuchAlgorithmException { + void test_testGenerateJwt() throws InvalidKeySpecException, NoSuchAlgorithmException { assertNotNull(generateJwt("1", 3, 4)); } @@ -150,12 +173,20 @@ void testInitParametersValidation( * @param jwksUri the jwks uri * @param shortSessionCookieName the short session cookie name * @param expectValid the expect valid + * @throws StandardException */ @ParameterizedTest @MethodSource("provideJwts") - void test_GetAndValidateShortSessionValue(final boolean expectValid, final String jwt) { - assertEquals( - expectValid, sessionService.getAndValidateShortSessionValue(jwt).isAuthenticated()); + void test_getCurrentUser(final boolean expectValid, final String jwt) throws StandardException { + final UserEntity currentUser = sessionService.getCurrentUser(jwt); + assertEquals(expectValid, currentUser.isAuthenticated()); + + if (expectValid) { + assertEquals(TEST_NAME, currentUser.getName()); + assertEquals(TEST_EMAIL, currentUser.getEmail()); + assertEquals(TEST_PHONE_NUMBER, currentUser.getPhoneNumber()); + assertEquals(TEST_USER_ID, currentUser.getUserId()); + } } // ------------------ Test data --------------------- // @@ -181,8 +212,8 @@ static Stream initParametersTestData() { * Provide jwts. * * @return the list - * @throws NoSuchAlgorithmException - * @throws InvalidKeySpecException + * @throws InvalidKeySpecException the invalid key spec exception + * @throws NoSuchAlgorithmException the no such algorithm exception */ static List provideJwts() throws InvalidKeySpecException, NoSuchAlgorithmException { final List testData = new ArrayList<>(); @@ -273,15 +304,15 @@ private static RSAPrivateKey readPrivateKey(final String privateKeyPath) * @param exp the exp * @param nbf the nbf * @return the string - * @throws InvalidKeySpecException - * @throws NoSuchAlgorithmException + * @throws InvalidKeySpecException the invalid key spec exception + * @throws NoSuchAlgorithmException the no such algorithm exception */ private static String generateJwt(final String iss, final long exp, final long nbf) throws InvalidKeySpecException, NoSuchAlgorithmException { - // Now you have RSAPrivateKey, you can use it as needed final Algorithm algorithm = Algorithm.RSA256(privateKey); return JWT.create() + .withHeader(Collections.singletonMap("kid", "kid123")) .withIssuer(iss) .withIssuedAt(new Date()) .withExpiresAt(new Date(exp * 1000L)) @@ -305,4 +336,17 @@ private static SessionService createSessionService() { 10, false); // URLs do not matter, url access is mocked } + + /** + * Read jwks. + * + * @return the json array + * @throws FileNotFoundException the file not found exception + */ + private static JsonArray readJwks() throws FileNotFoundException { + final FileReader reader = new FileReader(JWKS_PATH); + final Gson gson = new Gson(); + final JsonObject jwks = gson.fromJson(reader, JsonObject.class); + return jwks.getAsJsonArray("keys"); + } } diff --git a/src/test/java/com/corbado/unit/data/jwks.json b/src/test/java/com/corbado/unit/data/jwks.json index caf26f4..5be84ec 100644 --- a/src/test/java/com/corbado/unit/data/jwks.json +++ b/src/test/java/com/corbado/unit/data/jwks.json @@ -1 +1 @@ -{"keys":[{"alg":"RS256","kty":"RSA","kid":"kid123","n":"uzWHNM5f-amCjQztc5QTfJfzCC5J4nuW-L_aOxZ4f8J3FrewM2c_dufrnmedsApb0By7WhaHlcqCh_ScAPyJhzkPYLae7bTVro3hok0zDITR8F6SJGL42JAEUk-ILkPI-DONM0-3vzk6Kvfe548tu4czCuqU8BGVOlnp6IqBHhAswNMM78pos_2z0CjPM4tbeXqSTTbNkXRboxjU29vSopcT51koWOgiTf3C7nJUoMWZHZI5HqnIhPAG9yv8HAgNk6CMk2CadVHDo4IxjxTzTTqo1SCSH2pooJl9O8at6kkRYsrZWwsKlOFE2LUce7ObnXsYihStBUDoeBQlGG_BwQ","e":"AQAB"}]} \ No newline at end of file +{"keys":[{"alg":"RS256","kty":"RSA","kid":"kid123","n":"AIQwQ7WmkmLbQTIovOVsqonSzJFkpUb8ylDAo2WculkZFpHLM178qm73hENaeuJTB45Jnrh9rwVlPUqXQKkAtCzovbfjHDZ8pudzNa0SpxAY8sDZZSsW3y14sEEShJsoWqJp6Zn-7ActnjuHoq4tEImUBu5Cgrk5qU1I2hCiARwrzslaUyAXySPixA9YDOODXsNiRnLGLLImvQ0nJUiwah-Iy4an0ZqTkljsuQoNzxcF-QKRelXNApyaKdbj_IDWK3-s2QfexDf-d4zHt_wGeJJDVoErsIZHZpqK67ytXY2Sc7xM213-w12klhHgzkewVIL-FmP5WcQ6UVvueO2hvy8","e":"AQAB"}]} \ No newline at end of file diff --git a/src/test/java/com/corbado/unit/data/rsakey.pem b/src/test/java/com/corbado/unit/data/rsakey.pem index 4b29dd5..90c2840 100644 --- a/src/test/java/com/corbado/unit/data/rsakey.pem +++ b/src/test/java/com/corbado/unit/data/rsakey.pem @@ -1,28 +1,3 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9wUxMacTb6sde -UvU1OkGU80bIkKRQC/7EqU7scwL7yCKZKY7uPg2VH93ggnCzvDusD8dcsEdNetrF -54Tv+aNzZrNHVpficcx/hPTWTIRrhBtefPG20LcKmRGKWmKoiLZ+yGRW9OLQ1OBA -+RvHy8vEUCYLAqC+8909b3ouKt+LASf9qrQVKWdFEgVAoyJFFP+kvYGEK2y6+5Ee -yYng6xW/aa8yC8OyTO6a1g8fELSKupxJrvm2aJubE6UvUxSvUjrX9kd8+nvaV2Uj -xE31Iaer+vvWz5dRTYoi1EMMVEc8h+Z/C+TGm6fhNR3gYi/e+bO+njkMYvUDG8N0 -gEJ5pubfAgMBAAECggEAEFsmCXwgdNhS4QWDj1f7KSyjEEyvbRrrleYGIIl1W2CP -4uXbJRwCLbV2eZCkyElUV2twwsOLEdmiG+bt5YV+Gkdi8qY7J1Cp0OAT/pjP3Tig -508bwqdQ77/r7CIIWQCXwmvhgkFPf7KptdADHgCqCrzh2pcaZfs9ObtvK6WUaTXE -+K0o2hZe6qjfloO9o7Sj9b1NZ4YqjJAhDiTrgpgTLbJ0HHuy1PI4faUVb5ORi8y4 -Wy44gcYpbgEbpO97aYY1jx4LHYWKzY9wd4Wu8T805PkTaiYnnVDZMUgqJZYY7JLn -Qyv1C4jbPw74gHftaT0auIB4Xwjc0OqisnnB7VjuqQKBgQD7upjRn6Og5xc5vHbq -nFSBb/jHNi5TDsykUAV9FXcf85C0JAFG/tZyzu130PlRrPcEMif5956tAKhXpKDY -t5Zw5GrSJlWCi00Ezn6Hg1Zka5/uT5/0HFNdrZdKA85qNb28EYT6khqh6HFUzErm -Qxk3/5QPRgLmXJNMrlGpsWhkYwKBgQDA+YNhszw5Vj1mnxOaV02grPwN4OIK0hVi -E+BjpUTXCS3emSE46/jAmE+YOg+KaXd0BgIv0+Bmgaa6+3DqZT0IBZln2n1Cw6HT -tr6Go+ifSJrXuce8EKggICkaq5xFxVA5G33un7rzCGO7U8nMtKRwb0WUnH2zqZgd -uD+1axPGVQKBgQDbi4SY3shRHvtMqah1Od8h/MxWwlRosDGe5QPEciIxRbZgxj4u -8zeJbhwCMcogh9/wUuY2xtYnQLmRps159bRJxY28tx5A+skzdf04pz2D27HioKN6 -vfGfdDTMosE2NKTED+uQtjhwGVAuivaQGNk307oIECGbVAZMDITAoS/QzQKBgDJN -F9UQvmMHusuULazuktqOHMmVU/aUGmTNX5E51D7lMqKycbl/sQCq8xxwDfr7UNra -chl7diPiKc7VmfJPX2BG7Vzn0/ziN72TBgjcktdqOop+77Ry9xAgsfY0w3BgZW/t -XZ8k3btZ9X0v8ws8Dx0LtCxvukhprbAZhenJNoddAoGAYLEnYHCdy9Yj7qasxvZp -nRW2rmrEG6XKVE5+Ate0tXAJBxfQtELAtWMIDZb+9a1uEkoHpG5s+gz3Zot6woBs -hVlZ/2JY5QxMeugYkd+XsSILHjYCA++CXBsW4C5o9EYkR5ududpaVRGm1BH5VabM -jveX6FQE5DcHR31gGG1Sweo= +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCEMEO1ppJi20EyKLzlbKqJ0syRZKVG/MpQwKNlnLpZGRaRyzNe/Kpu94RDWnriUweOSZ64fa8FZT1Kl0CpALQs6L234xw2fKbnczWtEqcQGPLA2WUrFt8teLBBEoSbKFqiaemZ/uwHLZ47h6KuLRCJlAbuQoK5OalNSNoQogEcK87JWlMgF8kj4sQPWAzjg17DYkZyxiyyJr0NJyVIsGofiMuGp9Gak5JY7LkKDc8XBfkCkXpVzQKcminW4/yA1it/rNkH3sQ3/neMx7f8BniSQ1aBK7CGR2aaiuu8rV2NknO8TNtd/sNdpJYR4M5HsFSC/hZj+VnEOlFb7njtob8vAgMBAAECggEAYHODBCkNSNpoYLv+0HwQl03be/7u5bQPvwpAbyUDh31ZzXlx+03q4dryg96iKT+iFL089aqnKQ2swh9Iy8e6r8YGoAUzkcI0Wk7jDGy+v20ku3gkbGNc5qXYHTLw1PGF6FnVXEr4V2h+uzsFhYdWOLxsri6Tiak8EislCdvbaXyz0KD6qUicjyBwHCmGgYABLDEcDhd33+CrVajxFBh2umBBJ4kGMZ8HTdmlZKU8mz8IdqfcdGybLxv6c8ICW20q5bWbTixCJfx3sLof9AZnxhn1+/84+V7yEay71QSGHvH01TpHAd5Etyjq2nQUvcLCqgkyQ6FxjXzL4CxIEHtVuQKBgQDKZ/B9RSFvOqQNZxlARrRgirbYJSR0xGke9fLNGTm/CS6tcH0gIyh1hT+IF4e/2VEpx7uwJctvKVW8K5Csi3q+cCPPrkkj34+H65zbcEW5Oy5NPEj+pkQL/Ccljd9QK3hRMNf6Fjz7f2zgpZHLV64HudWI4xjIBsuV0XCuc0+AdQKBgQCnMKTZ3RuMXpP+av4GAIwaQbcw9Mgpi2o++8xeqxbpLEZYGTTkpIamyakNN2YQx7+tvsa4EzWQ7MfX9v1YSqFr68mCRsTpivZA3OMOc1xAkOrsyeBnVxTIXi+fb3Ubr3BKU2Y1yOt8pLeoYqE8Mxt5q7hbf0MUFR8QnStBIm+MkwKBgCgu+HS2S8v8VWN/y2iSYO8luuUwgotYDxKhe4Gyd19w4D54ra66rCagvJs1KLMy3sUvrRhseHXqO+Yus/s9ebHjK4jorgacNK+kXDDIml8K28djp44+zhWfCtqOzv3ok2tzCf3RemvnwWLcHBTFpHxOLZGOnHXhu3tT6E4KAIedAoGAfGdAsu/IeNlDK9N28wZjOYJeimoJqogXZYg9GNAbuyL7sMAI0HzvyJlTVgc7xg6rvN+ww/VfLVhSl4ssFg9qL4CCL5LzIIgLFlaGCRGjulNayxioBp0QVMtoii0IKbKQTm3iJvE68EMseXnyWXX54r347vQx+HaC5/za25uA/0sCgYEAwzuVx086qNPfherDZvaCJXokDK4TPiJ/NWpacqSPrb4jvdMtvz1Sgkc8XzqQ4trMWkhNpyRz9yeYT0ZyGrCcDs8zSOY70OfBEL0ZZd2q2Pbbv/Gy7rd0FkFjnRV/AFx+UWH+/OnoJhWN2MAvnkhgXoptz7qtDc332FK4uo4yK14= -----END PRIVATE KEY----- From ff8c6dc0374d243c797b89b5a8682f7cedf4e219 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 2 Aug 2024 18:45:21 +0200 Subject: [PATCH 21/59] Migrated to v2 of backend api --- scripts/generate-openapi.sh | 4 +- .../entities/SessionValidationResult.java | 25 + .../java/com/corbado/entities/UserEntity.java | 110 +- .../corbado/generated/api/AnalyzerApi.java | 1578 --------- .../generated/api/AndroidAppConfigApi.java | 591 ---- .../corbado/generated/api/ApiSecretsApi.java | 451 --- .../generated/api/AssociationTokensApi.java | 204 -- .../corbado/generated/api/AuthEventsApi.java | 209 ++ .../corbado/generated/api/AuthMethodsApi.java | 204 -- .../corbado/generated/api/AuthTokensApi.java | 204 -- .../corbado/generated/api/ChallengesApi.java | 352 ++ .../generated/api/ConnectTokensApi.java | 610 ++++ .../generated/api/EmailMagicLinksApi.java | 604 ---- .../corbado/generated/api/EmailOtpApi.java | 471 --- .../generated/api/EmailTemplatesApi.java | 343 -- .../corbado/generated/api/ExamplesApi.java | 203 -- .../generated/api/IOsAppConfigApi.java | 590 ---- .../corbado/generated/api/IdentifiersApi.java | 640 ++++ .../generated/api/LongSessionsApi.java | 499 --- .../generated/api/PasskeyEventsApi.java | 369 ++ .../corbado/generated/api/PasskeysApi.java | 819 +++++ .../generated/api/PasskeysBiometricsApi.java | 2607 -------------- .../generated/api/ProjectConfigApi.java | 427 +-- .../corbado/generated/api/RequestLogsApi.java | 385 -- .../generated/api/SessionConfigApi.java | 331 -- .../corbado/generated/api/SessionsApi.java | 760 ++++ .../com/corbado/generated/api/SmsOtpApi.java | 343 -- .../generated/api/SmsTemplatesApi.java | 343 -- .../com/corbado/generated/api/UserApi.java | 2757 --------------- .../com/corbado/generated/api/UsersApi.java | 1327 +++++++ .../corbado/generated/api/ValidationApi.java | 333 -- .../corbado/generated/api/WebhookLogsApi.java | 241 -- .../generated/invoker/ApiCallback.java | 4 +- .../corbado/generated/invoker/ApiClient.java | 3131 ++++++++--------- .../generated/invoker/ApiException.java | 6 +- .../generated/invoker/ApiResponse.java | 4 +- .../generated/invoker/Configuration.java | 6 +- .../invoker/GzipRequestInterceptor.java | 4 +- .../com/corbado/generated/invoker/JSON.java | 247 +- .../com/corbado/generated/invoker/Pair.java | 6 +- .../invoker/ProgressRequestBody.java | 4 +- .../invoker/ProgressResponseBody.java | 4 +- .../invoker/ServerConfiguration.java | 2 +- .../generated/invoker/ServerVariable.java | 2 +- .../corbado/generated/invoker/StringUtil.java | 6 +- .../generated/invoker/auth/ApiKeyAuth.java | 6 +- .../invoker/auth/Authentication.java | 4 +- .../generated/invoker/auth/HttpBasicAuth.java | 4 +- .../invoker/auth/HttpBearerAuth.java | 6 +- .../model/AbstractOpenApiSchema.java | 6 +- .../model/AndroidAppConfigDeleteReq.java | 237 -- .../generated/model/AndroidAppConfigItem.java | 394 --- .../model/AndroidAppConfigListRsp.java | 378 -- .../model/AndroidAppConfigSaveReq.java | 304 -- .../model/AndroidAppConfigSaveRsp.java | 510 --- .../model/AndroidAppConfigUpdateReq.java | 304 -- .../model/AndroidAppConfigUpdateRsp.java | 510 --- .../com/corbado/generated/model/AppType.java | 4 +- .../model/AssociationTokenCreateReq.java | 303 -- .../model/AssociationTokenCreateRsp.java | 330 -- .../AssociationTokenCreateRspAllOfData.java | 235 -- .../corbado/generated/model/AuthEvent.java | 394 +++ .../generated/model/AuthEventCreateReq.java | 334 ++ .../generated/model/AuthEventMethod.java | 90 + .../generated/model/AuthEventStatus.java | 78 + .../generated/model/AuthEventType.java | 80 + .../corbado/generated/model/AuthMethod.java | 82 - .../generated/model/AuthMethodsListReq.java | 273 -- .../generated/model/AuthMethodsListRsp.java | 330 -- .../model/AuthMethodsListRspAllOfData.java | 299 -- .../generated/model/AuthTokenValidateReq.java | 273 -- .../generated/model/AuthTokenValidateRsp.java | 330 -- .../corbado/generated/model/Challenge.java | 334 ++ .../generated/model/ChallengeCreateReq.java | 300 ++ .../generated/model/ChallengeStatus.java | 80 + .../generated/model/ChallengeType.java | 80 + .../generated/model/ChallengeUpdateReq.java | 214 ++ .../corbado/generated/model/ClientInfo.java | 244 -- .../generated/model/ClientInformation.java | 412 +++ .../corbado/generated/model/ConnectToken.java | 360 ++ .../model/ConnectTokenCreateReq.java | 270 ++ .../generated/model/ConnectTokenData.java | 318 ++ .../model/ConnectTokenDataPasskeyAppend.java | 244 ++ .../model/ConnectTokenDataPasskeyDelete.java | 214 ++ .../model/ConnectTokenDataPasskeyList.java | 214 ++ .../generated/model/ConnectTokenList.java | 262 ++ .../generated/model/ConnectTokenStatus.java | 78 + .../generated/model/ConnectTokenType.java | 80 + .../model/ConnectTokenUpdateReq.java | 214 ++ .../corbado/generated/model/Credential.java | 665 ++++ .../generated/model/CredentialList.java | 262 ++ .../CrossDeviceAuthenticationStrategy.java | 80 + .../model/CustomLoginIdentifier.java | 333 -- .../corbado/generated/model/DecisionTag.java | 110 + .../corbado/generated/model/DetectionTag.java | 302 ++ .../com/corbado/generated/model/Email.java | 363 -- .../corbado/generated/model/EmailCode.java | 477 --- .../generated/model/EmailCodeGetRsp.java | 330 -- .../model/EmailCodeGetRspAllOfData.java | 214 -- .../generated/model/EmailCodeSendReq.java | 417 --- .../generated/model/EmailCodeSendRsp.java | 330 -- .../model/EmailCodeSendRspAllOfData.java | 214 -- .../generated/model/EmailCodeValidateReq.java | 300 -- .../generated/model/EmailCodeValidateRsp.java | 448 --- .../corbado/generated/model/EmailLink.java | 506 --- .../generated/model/EmailLinkGetRsp.java | 330 -- .../model/EmailLinkGetRspAllOfData.java | 214 -- .../generated/model/EmailLinkSendReq.java | 535 --- .../generated/model/EmailLinkSendRsp.java | 330 -- .../model/EmailLinkSendRspAllOfData.java | 214 -- .../generated/model/EmailLinkValidateRsp.java | 448 --- .../generated/model/EmailLinksDeleteReq.java | 245 -- .../model/EmailLinksValidateReq.java | 300 -- .../model/EmailTemplateCreateReq.java | 806 ----- .../model/EmailTemplateCreateRsp.java | 330 -- .../EmailTemplateCreateRspAllOfData.java | 214 -- .../model/EmailTemplateDeleteReq.java | 237 -- .../model/EmailValidationResult.java | 361 -- .../com/corbado/generated/model/EmptyReq.java | 237 -- .../com/corbado/generated/model/ErrorRsp.java | 66 +- .../generated/model/ErrorRspAllOfError.java | 58 +- .../model/ErrorRspAllOfErrorValidation.java | 50 +- .../generated/model/ExampleGetRsp.java | 414 --- .../com/corbado/generated/model/FullUser.java | 550 --- .../corbado/generated/model/GenericRsp.java | 58 +- .../model/IOSAppConfigDeleteReq.java | 237 -- .../generated/model/IOSAppConfigItem.java | 364 -- .../generated/model/IOSAppConfigListRsp.java | 378 -- .../generated/model/IOSAppConfigSaveReq.java | 304 -- .../generated/model/IOSAppConfigSaveRsp.java | 480 --- .../model/IOSAppConfigUpdateReq.java | 304 -- .../model/IOSAppConfigUpdateRsp.java | 480 --- .../corbado/generated/model/Identifier.java | 334 ++ .../generated/model/IdentifierCreateReq.java | 274 ++ .../generated/model/IdentifierList.java | 262 ++ .../generated/model/IdentifierStatus.java | 80 + .../generated/model/IdentifierType.java | 80 + .../generated/model/IdentifierUpdateReq.java | 214 ++ .../model/JavaScriptHighEntropy.java | 271 ++ .../generated/model/LoginIdentifierType.java | 80 - .../corbado/generated/model/LongSession.java | 354 +- .../generated/model/LongSessionCreateReq.java | 244 ++ .../generated/model/LongSessionGetRsp.java | 330 -- .../model/LongSessionGetRspAllOfData.java | 214 -- .../generated/model/LongSessionListRsp.java | 330 -- .../model/LongSessionListRspAllOfData.java | 262 -- .../generated/model/LongSessionRevokeReq.java | 237 -- .../generated/model/LongSessionStatus.java | 84 + .../generated/model/LongSessionUpdateReq.java | 214 ++ .../com/corbado/generated/model/Paging.java | 54 +- .../model/PasskeyAppendFinishReq.java | 330 ++ .../model/PasskeyAppendFinishRsp.java | 214 ++ .../model/PasskeyAppendStartReq.java | 334 ++ .../model/PasskeyAppendStartRsp.java | 319 ++ .../corbado/generated/model/PasskeyData.java | 301 ++ .../corbado/generated/model/PasskeyEvent.java | 417 +++ .../model/PasskeyEventCreateReq.java | 240 ++ .../generated/model/PasskeyEventList.java | 262 ++ .../generated/model/PasskeyEventType.java | 76 + .../generated/model/PasskeyIntelFlags.java | 211 ++ .../model/PasskeyLoginFinishReq.java | 304 ++ .../model/PasskeyLoginFinishRsp.java | 214 ++ .../generated/model/PasskeyLoginStartReq.java | 304 ++ .../generated/model/PasskeyLoginStartRsp.java | 319 ++ .../model/PasskeyMediationFinishReq.java | 244 ++ .../model/PasskeyMediationFinishRsp.java | 214 ++ .../model/PasskeyMediationStartReq.java | 214 ++ .../model/PasskeyMediationStartRsp.java | 241 ++ .../corbado/generated/model/PhoneNumber.java | 334 -- .../model/PhoneNumberValidationResult.java | 330 -- .../generated/model/ProjectConfig.java | 2294 ------------ .../generated/model/ProjectConfigGetRsp.java | 330 -- .../generated/model/ProjectConfigSaveReq.java | 2036 ----------- .../model/ProjectConfigUpdateCnameReq.java | 214 ++ .../model/ProjectConfigWebhookTestReq.java | 328 -- .../model/ProjectConfigWebhookTestRsp.java | 330 -- .../ProjectConfigWebhookTestRspAllOfData.java | 272 -- .../model/ProjectSecretCreateReq.java | 237 -- .../model/ProjectSecretCreateRsp.java | 419 --- .../model/ProjectSecretDeleteReq.java | 237 -- .../generated/model/ProjectSecretItem.java | 303 -- .../generated/model/ProjectSecretListRsp.java | 378 -- .../corbado/generated/model/RequestData.java | 50 +- .../corbado/generated/model/RequestLog.java | 706 ---- .../generated/model/RequestLogGetRsp.java | 330 -- .../generated/model/RequestLogsListRsp.java | 330 -- .../model/RequestLogsListRspAllOfData.java | 262 -- .../generated/model/SessionConfig.java | 756 ---- .../generated/model/SessionConfigGetRsp.java | 330 -- .../model/SessionConfigUpdateReq.java | 719 ---- .../model/SessionTokenCreateReq.java | 303 -- .../model/SessionTokenCreateRsp.java | 330 -- .../model/SessionTokenCreateRspAllOfData.java | 214 -- .../model/SessionTokenVerifyReq.java | 273 -- .../model/SessionTokenVerifyRsp.java | 330 -- .../model/SessionTokenVerifyRspAllOfData.java | 274 -- .../corbado/generated/model/ShortSession.java | 214 ++ .../model/ShortSessionCreateReq.java | 244 ++ .../generated/model/SmsCodeSendReq.java | 359 -- .../generated/model/SmsCodeSendRsp.java | 330 -- .../model/SmsCodeSendRspAllOfData.java | 214 -- .../generated/model/SmsCodeValidateReq.java | 300 -- .../generated/model/SmsCodeValidateRsp.java | 329 -- .../generated/model/SmsTemplateCreateReq.java | 415 --- .../generated/model/SmsTemplateCreateRsp.java | 330 -- .../model/SmsTemplateCreateRspAllOfData.java | 214 -- .../generated/model/SmsTemplateDeleteReq.java | 237 -- .../generated/model/SocialAccount.java | 394 +++ .../model/SocialAccountCreateReq.java | 334 ++ .../generated/model/SocialAccountList.java | 262 ++ .../generated/model/SocialProviderType.java | 4 +- .../com/corbado/generated/model/Status.java | 80 - .../generated/model/TrackingBackupState.java | 238 -- .../model/TrackingBackupStateGetRsp.java | 330 -- .../model/TrackingBrowserDetailedStats.java | 382 -- .../TrackingBrowserDetailedStatsListRsp.java | 330 -- ...gBrowserDetailedStatsListRspAllOfData.java | 262 -- .../generated/model/TrackingBrowserStats.java | 349 -- .../model/TrackingBrowserStatsListRsp.java | 330 -- .../TrackingBrowserStatsListRspAllOfData.java | 262 -- .../model/TrackingDetailedStats.java | 322 -- .../model/TrackingDetailedStatsListRsp.java | 330 -- ...TrackingDetailedStatsListRspAllOfData.java | 262 -- .../generated/model/TrackingEnums.java | 309 -- .../generated/model/TrackingEnumsGetRsp.java | 330 -- .../model/TrackingOSDetailedStats.java | 468 --- .../model/TrackingOSDetailedStatsListRsp.java | 330 -- ...ackingOSDetailedStatsListRspAllOfData.java | 262 -- .../generated/model/TrackingOSStats.java | 349 -- .../model/TrackingOSStatsListRsp.java | 330 -- .../TrackingOSStatsListRspAllOfData.java | 262 -- .../generated/model/TrackingRawListRow.java | 355 -- .../generated/model/TrackingRawListRsp.java | 378 -- .../generated/model/TrackingStats.java | 322 -- .../generated/model/TrackingStatsListRsp.java | 330 -- .../model/TrackingStatsListRspAllOfData.java | 262 -- .../com/corbado/generated/model/User.java | 224 +- .../corbado/generated/model/UserAuthLog.java | 364 -- .../generated/model/UserAuthLogListRsp.java | 330 -- .../model/UserAuthLogListRspAllOfData.java | 262 -- .../generated/model/UserCreateReq.java | 217 +- .../generated/model/UserCreateRsp.java | 330 -- .../model/UserCreateRspAllOfData.java | 274 -- .../UserCustomLoginIdentifierCreateReq.java | 303 -- .../UserCustomLoginIdentifierCreateRsp.java | 330 -- ...stomLoginIdentifierCreateRspAllOfData.java | 214 -- .../UserCustomLoginIdentifierDeleteReq.java | 237 -- .../UserCustomLoginIdentifierGetRsp.java | 330 -- ...rCustomLoginIdentifierGetRspAllOfData.java | 214 -- .../generated/model/UserDeleteReq.java | 237 -- .../corbado/generated/model/UserDevice.java | 454 --- .../generated/model/UserDeviceListRsp.java | 378 -- .../corbado/generated/model/UserEmail.java | 334 -- .../generated/model/UserEmailCreateReq.java | 274 -- .../generated/model/UserEmailCreateRsp.java | 330 -- .../model/UserEmailCreateRspAllOfData.java | 214 -- .../generated/model/UserEmailDeleteReq.java | 237 -- .../generated/model/UserEmailGetRsp.java | 330 -- .../model/UserEmailGetRspAllOfData.java | 214 -- .../generated/model/UserExistsReq.java | 304 -- .../generated/model/UserExistsRsp.java | 327 -- .../corbado/generated/model/UserGetRsp.java | 330 -- .../corbado/generated/model/UserListRsp.java | 330 -- .../generated/model/UserListRspAllOfData.java | 262 -- .../generated/model/UserPhoneNumber.java | 334 -- .../model/UserPhoneNumberCreateReq.java | 274 -- .../model/UserPhoneNumberCreateRsp.java | 330 -- .../UserPhoneNumberCreateRspAllOfData.java | 214 -- .../model/UserPhoneNumberDeleteReq.java | 237 -- .../model/UserPhoneNumberGetRsp.java | 330 -- .../model/UserPhoneNumberGetRspAllOfData.java | 214 -- .../generated/model/UserSocialAccount.java | 304 -- .../corbado/generated/model/UserStats.java | 430 --- .../generated/model/UserStatsListRsp.java | 330 -- .../model/UserStatsListRspAllOfData.java | 262 -- .../corbado/generated/model/UserStatus.java | 80 + .../generated/model/UserUpdateReq.java | 211 +- .../generated/model/UserUpdateRsp.java | 330 -- .../corbado/generated/model/UserUsername.java | 334 -- .../generated/model/ValidateEmailReq.java | 326 -- .../generated/model/ValidateEmailRsp.java | 330 -- .../model/ValidatePhoneNumberReq.java | 303 -- .../model/ValidatePhoneNumberRsp.java | 330 -- .../generated/model/ValidationEmail.java | 355 -- .../model/ValidationPhoneNumber.java | 328 -- .../model/WebAuthnAssociateStartReq.java | 274 -- .../model/WebAuthnAssociateStartRsp.java | 414 --- .../model/WebAuthnAuthenticateFinishRsp.java | 503 --- .../model/WebAuthnAuthenticateStartReq.java | 273 -- .../model/WebAuthnAuthenticateStartRsp.java | 416 --- .../model/WebAuthnAuthenticateSuccess.java | 419 --- .../model/WebAuthnAuthenticatorUpdateReq.java | 274 -- .../model/WebAuthnCredentialExistsReq.java | 303 -- .../model/WebAuthnCredentialExistsRsp.java | 327 -- .../model/WebAuthnCredentialItemRsp.java | 840 ----- .../model/WebAuthnCredentialListRsp.java | 378 -- .../model/WebAuthnCredentialReq.java | 330 -- .../model/WebAuthnCredentialRsp.java | 386 -- .../generated/model/WebAuthnFinishReq.java | 273 -- .../model/WebAuthnMediationStartReq.java | 272 -- .../model/WebAuthnMediationStartRsp.java | 330 -- .../model/WebAuthnRegisterFinishRsp.java | 503 --- .../model/WebAuthnRegisterStartReq.java | 387 -- .../model/WebAuthnRegisterStartRsp.java | 414 --- .../model/WebauthnSettingCreate.java | 244 -- .../model/WebauthnSettingCreateReq.java | 304 -- .../model/WebauthnSettingCreateRsp.java | 450 --- .../model/WebauthnSettingDeleteReq.java | 237 -- .../model/WebauthnSettingGetRsp.java | 450 --- .../generated/model/WebauthnSettingItem.java | 334 -- .../model/WebauthnSettingListRsp.java | 378 -- .../model/WebauthnSettingUpdateReq.java | 304 -- .../model/WebauthnSettingUpdateRsp.java | 450 --- .../model/WebauthnStatsAuthenticator.java | 241 -- .../model/WebauthnStatsAuthenticatorRsp.java | 330 -- ...ebauthnStatsAuthenticatorRspAllOfData.java | 262 -- .../generated/model/WebauthnStatsType.java | 291 -- .../generated/model/WebauthnStatsTypeRsp.java | 330 -- .../model/WebauthnStatsTypeRspAllOfData.java | 262 -- .../corbado/generated/model/WebhookLog.java | 535 --- .../generated/model/WebhookLogsListRsp.java | 330 -- .../model/WebhookLogsListRspAllOfData.java | 262 -- .../com/corbado/generated/package-info.java | 4 - src/main/java/com/corbado/sdk/CorbadoSdk.java | 8 +- .../com/corbado/services/SessionService.java | 24 +- .../com/corbado/services/UserService.java | 76 +- .../corbado/integration/UserServiceIT.java | 54 +- .../com/corbado/unit/SessionServiceTest.java | 20 +- src/test/java/com/corbado/util/TestUtils.java | 9 +- 329 files changed, 21866 insertions(+), 86149 deletions(-) create mode 100644 src/main/java/com/corbado/entities/SessionValidationResult.java delete mode 100644 src/main/java/com/corbado/generated/api/AnalyzerApi.java delete mode 100644 src/main/java/com/corbado/generated/api/AndroidAppConfigApi.java delete mode 100644 src/main/java/com/corbado/generated/api/ApiSecretsApi.java delete mode 100644 src/main/java/com/corbado/generated/api/AssociationTokensApi.java create mode 100644 src/main/java/com/corbado/generated/api/AuthEventsApi.java delete mode 100644 src/main/java/com/corbado/generated/api/AuthMethodsApi.java delete mode 100644 src/main/java/com/corbado/generated/api/AuthTokensApi.java create mode 100644 src/main/java/com/corbado/generated/api/ChallengesApi.java create mode 100644 src/main/java/com/corbado/generated/api/ConnectTokensApi.java delete mode 100644 src/main/java/com/corbado/generated/api/EmailMagicLinksApi.java delete mode 100644 src/main/java/com/corbado/generated/api/EmailOtpApi.java delete mode 100644 src/main/java/com/corbado/generated/api/EmailTemplatesApi.java delete mode 100644 src/main/java/com/corbado/generated/api/ExamplesApi.java delete mode 100644 src/main/java/com/corbado/generated/api/IOsAppConfigApi.java create mode 100644 src/main/java/com/corbado/generated/api/IdentifiersApi.java delete mode 100644 src/main/java/com/corbado/generated/api/LongSessionsApi.java create mode 100644 src/main/java/com/corbado/generated/api/PasskeyEventsApi.java create mode 100644 src/main/java/com/corbado/generated/api/PasskeysApi.java delete mode 100644 src/main/java/com/corbado/generated/api/PasskeysBiometricsApi.java delete mode 100644 src/main/java/com/corbado/generated/api/RequestLogsApi.java delete mode 100644 src/main/java/com/corbado/generated/api/SessionConfigApi.java create mode 100644 src/main/java/com/corbado/generated/api/SessionsApi.java delete mode 100644 src/main/java/com/corbado/generated/api/SmsOtpApi.java delete mode 100644 src/main/java/com/corbado/generated/api/SmsTemplatesApi.java delete mode 100644 src/main/java/com/corbado/generated/api/UserApi.java create mode 100644 src/main/java/com/corbado/generated/api/UsersApi.java delete mode 100644 src/main/java/com/corbado/generated/api/ValidationApi.java delete mode 100644 src/main/java/com/corbado/generated/api/WebhookLogsApi.java delete mode 100644 src/main/java/com/corbado/generated/model/AndroidAppConfigDeleteReq.java delete mode 100644 src/main/java/com/corbado/generated/model/AndroidAppConfigItem.java delete mode 100644 src/main/java/com/corbado/generated/model/AndroidAppConfigListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/AndroidAppConfigSaveReq.java delete mode 100644 src/main/java/com/corbado/generated/model/AndroidAppConfigSaveRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/AssociationTokenCreateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/AssociationTokenCreateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/AssociationTokenCreateRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/AuthEvent.java create mode 100644 src/main/java/com/corbado/generated/model/AuthEventCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/AuthEventMethod.java create mode 100644 src/main/java/com/corbado/generated/model/AuthEventStatus.java create mode 100644 src/main/java/com/corbado/generated/model/AuthEventType.java delete mode 100644 src/main/java/com/corbado/generated/model/AuthMethod.java delete mode 100644 src/main/java/com/corbado/generated/model/AuthMethodsListReq.java delete mode 100644 src/main/java/com/corbado/generated/model/AuthMethodsListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/AuthMethodsListRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/AuthTokenValidateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/AuthTokenValidateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/Challenge.java create mode 100644 src/main/java/com/corbado/generated/model/ChallengeCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/ChallengeStatus.java create mode 100644 src/main/java/com/corbado/generated/model/ChallengeType.java create mode 100644 src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/ClientInfo.java create mode 100644 src/main/java/com/corbado/generated/model/ClientInformation.java create mode 100644 src/main/java/com/corbado/generated/model/ConnectToken.java create mode 100644 src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/ConnectTokenData.java create mode 100644 src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java create mode 100644 src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java create mode 100644 src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java create mode 100644 src/main/java/com/corbado/generated/model/ConnectTokenList.java create mode 100644 src/main/java/com/corbado/generated/model/ConnectTokenStatus.java create mode 100644 src/main/java/com/corbado/generated/model/ConnectTokenType.java create mode 100644 src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java create mode 100644 src/main/java/com/corbado/generated/model/Credential.java create mode 100644 src/main/java/com/corbado/generated/model/CredentialList.java create mode 100644 src/main/java/com/corbado/generated/model/CrossDeviceAuthenticationStrategy.java delete mode 100644 src/main/java/com/corbado/generated/model/CustomLoginIdentifier.java create mode 100644 src/main/java/com/corbado/generated/model/DecisionTag.java create mode 100644 src/main/java/com/corbado/generated/model/DetectionTag.java delete mode 100644 src/main/java/com/corbado/generated/model/Email.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailCode.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailCodeGetRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailCodeGetRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailCodeSendReq.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailCodeSendRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailCodeSendRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailCodeValidateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailCodeValidateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailLink.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailLinkGetRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailLinkGetRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailLinkSendReq.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailLinkSendRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailLinkSendRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailLinkValidateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailLinksDeleteReq.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailLinksValidateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailTemplateCreateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailTemplateCreateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailTemplateCreateRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailTemplateDeleteReq.java delete mode 100644 src/main/java/com/corbado/generated/model/EmailValidationResult.java delete mode 100644 src/main/java/com/corbado/generated/model/EmptyReq.java delete mode 100644 src/main/java/com/corbado/generated/model/ExampleGetRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/FullUser.java delete mode 100644 src/main/java/com/corbado/generated/model/IOSAppConfigDeleteReq.java delete mode 100644 src/main/java/com/corbado/generated/model/IOSAppConfigItem.java delete mode 100644 src/main/java/com/corbado/generated/model/IOSAppConfigListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/IOSAppConfigSaveReq.java delete mode 100644 src/main/java/com/corbado/generated/model/IOSAppConfigSaveRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/IOSAppConfigUpdateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/IOSAppConfigUpdateRsp.java create mode 100644 src/main/java/com/corbado/generated/model/Identifier.java create mode 100644 src/main/java/com/corbado/generated/model/IdentifierCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/IdentifierList.java create mode 100644 src/main/java/com/corbado/generated/model/IdentifierStatus.java create mode 100644 src/main/java/com/corbado/generated/model/IdentifierType.java create mode 100644 src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java create mode 100644 src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java delete mode 100644 src/main/java/com/corbado/generated/model/LoginIdentifierType.java create mode 100644 src/main/java/com/corbado/generated/model/LongSessionCreateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/LongSessionGetRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/LongSessionGetRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/LongSessionListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/LongSessionListRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/LongSessionRevokeReq.java create mode 100644 src/main/java/com/corbado/generated/model/LongSessionStatus.java create mode 100644 src/main/java/com/corbado/generated/model/LongSessionUpdateReq.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyData.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyEvent.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyEventList.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyEventType.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/PhoneNumber.java delete mode 100644 src/main/java/com/corbado/generated/model/PhoneNumberValidationResult.java delete mode 100644 src/main/java/com/corbado/generated/model/ProjectConfig.java delete mode 100644 src/main/java/com/corbado/generated/model/ProjectConfigGetRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/ProjectConfigSaveReq.java create mode 100644 src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java delete mode 100644 src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestReq.java delete mode 100644 src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/ProjectSecretCreateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/ProjectSecretCreateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/ProjectSecretDeleteReq.java delete mode 100644 src/main/java/com/corbado/generated/model/ProjectSecretItem.java delete mode 100644 src/main/java/com/corbado/generated/model/ProjectSecretListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/RequestLog.java delete mode 100644 src/main/java/com/corbado/generated/model/RequestLogGetRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/RequestLogsListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/RequestLogsListRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/SessionConfig.java delete mode 100644 src/main/java/com/corbado/generated/model/SessionConfigGetRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/SessionConfigUpdateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/SessionTokenCreateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/SessionTokenCreateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/SessionTokenCreateRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/SessionTokenVerifyReq.java delete mode 100644 src/main/java/com/corbado/generated/model/SessionTokenVerifyRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/SessionTokenVerifyRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/ShortSession.java create mode 100644 src/main/java/com/corbado/generated/model/ShortSessionCreateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/SmsCodeSendReq.java delete mode 100644 src/main/java/com/corbado/generated/model/SmsCodeSendRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/SmsCodeSendRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/SmsCodeValidateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/SmsCodeValidateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/SmsTemplateCreateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/SmsTemplateCreateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/SmsTemplateCreateRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/SmsTemplateDeleteReq.java create mode 100644 src/main/java/com/corbado/generated/model/SocialAccount.java create mode 100644 src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java create mode 100644 src/main/java/com/corbado/generated/model/SocialAccountList.java delete mode 100644 src/main/java/com/corbado/generated/model/Status.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingBackupState.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingBackupStateGetRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStats.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingBrowserStats.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingDetailedStats.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingEnums.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingEnumsGetRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingOSDetailedStats.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingOSStats.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingOSStatsListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingOSStatsListRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingRawListRow.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingRawListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingStats.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingStatsListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/TrackingStatsListRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/UserAuthLog.java delete mode 100644 src/main/java/com/corbado/generated/model/UserAuthLogListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/UserAuthLogListRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/UserCreateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/UserCreateRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierDeleteReq.java delete mode 100644 src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/UserDeleteReq.java delete mode 100644 src/main/java/com/corbado/generated/model/UserDevice.java delete mode 100644 src/main/java/com/corbado/generated/model/UserDeviceListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/UserEmail.java delete mode 100644 src/main/java/com/corbado/generated/model/UserEmailCreateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/UserEmailCreateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/UserEmailCreateRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/UserEmailDeleteReq.java delete mode 100644 src/main/java/com/corbado/generated/model/UserEmailGetRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/UserEmailGetRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/UserExistsReq.java delete mode 100644 src/main/java/com/corbado/generated/model/UserExistsRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/UserGetRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/UserListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/UserListRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/UserPhoneNumber.java delete mode 100644 src/main/java/com/corbado/generated/model/UserPhoneNumberCreateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/UserPhoneNumberDeleteReq.java delete mode 100644 src/main/java/com/corbado/generated/model/UserPhoneNumberGetRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/UserPhoneNumberGetRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/UserSocialAccount.java delete mode 100644 src/main/java/com/corbado/generated/model/UserStats.java delete mode 100644 src/main/java/com/corbado/generated/model/UserStatsListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/UserStatsListRspAllOfData.java create mode 100644 src/main/java/com/corbado/generated/model/UserStatus.java delete mode 100644 src/main/java/com/corbado/generated/model/UserUpdateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/UserUsername.java delete mode 100644 src/main/java/com/corbado/generated/model/ValidateEmailReq.java delete mode 100644 src/main/java/com/corbado/generated/model/ValidateEmailRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/ValidatePhoneNumberReq.java delete mode 100644 src/main/java/com/corbado/generated/model/ValidatePhoneNumberRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/ValidationEmail.java delete mode 100644 src/main/java/com/corbado/generated/model/ValidationPhoneNumber.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnAssociateStartReq.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnAssociateStartRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnAuthenticateFinishRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartReq.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnAuthenticateSuccess.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnAuthenticatorUpdateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsReq.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnCredentialItemRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnCredentialListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnCredentialReq.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnCredentialRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnFinishReq.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnMediationStartReq.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnMediationStartRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnRegisterFinishRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnRegisterStartReq.java delete mode 100644 src/main/java/com/corbado/generated/model/WebAuthnRegisterStartRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingCreate.java delete mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingCreateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingCreateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingDeleteReq.java delete mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingGetRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingItem.java delete mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingUpdateReq.java delete mode 100644 src/main/java/com/corbado/generated/model/WebauthnSettingUpdateRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticator.java delete mode 100644 src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/WebauthnStatsType.java delete mode 100644 src/main/java/com/corbado/generated/model/WebauthnStatsTypeRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebauthnStatsTypeRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/model/WebhookLog.java delete mode 100644 src/main/java/com/corbado/generated/model/WebhookLogsListRsp.java delete mode 100644 src/main/java/com/corbado/generated/model/WebhookLogsListRspAllOfData.java delete mode 100644 src/main/java/com/corbado/generated/package-info.java diff --git a/scripts/generate-openapi.sh b/scripts/generate-openapi.sh index d71b80b..10c9328 100644 --- a/scripts/generate-openapi.sh +++ b/scripts/generate-openapi.sh @@ -13,10 +13,10 @@ cd .gen rm -rf ../../src/main/java/$SDK_PACKAGE_NAME/$GENERATED_PACKAGE_NAME mkdir -p ../../src/main/java/$SDK_PACKAGE_NAME/$GENERATED_PACKAGE_NAME -curl -s -O https://api.corbado.com/docs/api/openapi/backend_api_public.yml +curl -s -O https://apireference.cloud.corbado.io/backendapi-v2/backend_api.yml docker pull openapitools/openapi-generator-cli docker run -v ${PWD}:/local --user $(id -u):$(id -g) openapitools/openapi-generator-cli generate \ - -i /local/backend_api_public.yml \ + -i /local/backend_api.yml \ -g java \ -o /local \ --additional-properties=packageName=com.corbado.generated \ diff --git a/src/main/java/com/corbado/entities/SessionValidationResult.java b/src/main/java/com/corbado/entities/SessionValidationResult.java new file mode 100644 index 0000000..6b73b35 --- /dev/null +++ b/src/main/java/com/corbado/entities/SessionValidationResult.java @@ -0,0 +1,25 @@ +package com.corbado.entities; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +/** Result class for SessionService validation. */ +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class SessionValidationResult { + + /** Indicates success of validation by session service. */ + @Builder.Default boolean authenticated = false; + + /** The user ID. */ + private String userID; + + /** The full name. */ + private String fullName; +} diff --git a/src/main/java/com/corbado/entities/UserEntity.java b/src/main/java/com/corbado/entities/UserEntity.java index 7fd764e..aa699d7 100644 --- a/src/main/java/com/corbado/entities/UserEntity.java +++ b/src/main/java/com/corbado/entities/UserEntity.java @@ -1,107 +1,43 @@ package com.corbado.entities; -import com.corbado.exceptions.StandardException; -import lombok.AllArgsConstructor; -import lombok.Builder; +import com.corbado.generated.model.User; +import com.corbado.generated.model.UserStatus; +import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.NonNull; import lombok.Setter; -/** The Class UserEntity. */ +/** The wrapper around generated {@link User} class to be used by SDK. */ @Getter @Setter -@AllArgsConstructor @NoArgsConstructor -@Builder -public class UserEntity { - - /** Text response in case the user is not authenticated. */ - public static final String NO_AUTH = "User is not authenticated"; - - /** Is user authenticated. */ - @Builder.Default private boolean authenticated = false; - - /** The user id. */ - @Builder.Default private String userId = ""; - - /** The name. */ - @Builder.Default private String name = ""; - - /** The email. */ - @Builder.Default private String email = ""; - - /** The phone number. */ - @Builder.Default private String phoneNumber = ""; - - /** - * Gets the user id. - * - * @return the user id - * @throws StandardException the standard exception - */ - public String getUserId() throws StandardException { - if (!authenticated) { - throw new StandardException(NO_AUTH); - } - return userId; - } - - /** - * Gets the name. - * - * @return the name - * @throws StandardException the standard exception - */ - public String getName() throws StandardException { - if (!authenticated) { - throw new StandardException(NO_AUTH); - } - return name; - } - - /** - * Gets the email. - * - * @return the email - * @throws StandardException the standard exception - */ - public String getEmail() throws StandardException { - if (!authenticated) { - throw new StandardException(NO_AUTH); - } - return email; - } +@EqualsAndHashCode(callSuper = false) +public class UserEntity extends User { /** - * Gets the phone number. + * Instantiates a new user entity. * - * @return the phone number - * @throws StandardException the standard exception + * @param authenticated the authenticated */ - public String getPhoneNumber() throws StandardException { - if (!authenticated) { - throw new StandardException(NO_AUTH); - } - return phoneNumber; + public UserEntity( + @NonNull final String userID, + final String explicitWebauthnID, + final String fullName, + final UserStatus status) { + + setUserID(userID); + setExplicitWebauthnID(explicitWebauthnID); + setFullName(fullName); + setStatus(status); } /** - * Creates the authenticated user. + * Instantiates a new user entity. * - * @param userId the user id - * @param name the name - * @param email the email - * @param phoneNumber the phone number - * @return the user entity + * @param user the user */ - public static UserEntity createAuthenticatedUser( - final String userId, final String name, final String email, final String phoneNumber) { - return UserEntity.builder() - .name(name) - .authenticated(true) - .userId(userId) - .email(email) - .phoneNumber(phoneNumber) - .build(); + public UserEntity(final User user) { + this(user.getUserID(), user.getExplicitWebauthnID(), user.getFullName(), user.getStatus()); } } diff --git a/src/main/java/com/corbado/generated/api/AnalyzerApi.java b/src/main/java/com/corbado/generated/api/AnalyzerApi.java deleted file mode 100644 index cda8aad..0000000 --- a/src/main/java/com/corbado/generated/api/AnalyzerApi.java +++ /dev/null @@ -1,1578 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.TrackingBackupStateGetRsp; -import com.corbado.generated.model.TrackingBrowserDetailedStatsListRsp; -import com.corbado.generated.model.TrackingBrowserStatsListRsp; -import com.corbado.generated.model.TrackingDetailedStatsListRsp; -import com.corbado.generated.model.TrackingEnumsGetRsp; -import com.corbado.generated.model.TrackingOSDetailedStatsListRsp; -import com.corbado.generated.model.TrackingOSStatsListRsp; -import com.corbado.generated.model.TrackingRawListRsp; -import com.corbado.generated.model.TrackingStatsListRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AnalyzerApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public AnalyzerApi() { - this(Configuration.getDefaultApiClient()); - } - - public AnalyzerApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for trackingAllRequest - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of raw tracking data per vistor -
- */ - public okhttp3.Call trackingAllRequestCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/tracking"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call trackingAllRequestValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - return trackingAllRequestCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Provides project's passkeys raw tracking data per visitor - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return TrackingRawListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of raw tracking data per vistor -
- */ - public TrackingRawListRsp trackingAllRequest(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = trackingAllRequestWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Provides project's passkeys raw tracking data per visitor - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<TrackingRawListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of raw tracking data per vistor -
- */ - public ApiResponse trackingAllRequestWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = trackingAllRequestValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Provides project's passkeys raw tracking data per visitor - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of raw tracking data per vistor -
- */ - public okhttp3.Call trackingAllRequestAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = trackingAllRequestValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for trackingBackupStateGet - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains tracking credential backup state data -
- */ - public okhttp3.Call trackingBackupStateGetCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/tracking/backupState"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call trackingBackupStateGetValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - return trackingBackupStateGetCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Provides tracking credential backup state data - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return TrackingBackupStateGetRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains tracking credential backup state data -
- */ - public TrackingBackupStateGetRsp trackingBackupStateGet(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = trackingBackupStateGetWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Provides tracking credential backup state data - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<TrackingBackupStateGetRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains tracking credential backup state data -
- */ - public ApiResponse trackingBackupStateGetWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = trackingBackupStateGetValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Provides tracking credential backup state data - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains tracking credential backup state data -
- */ - public okhttp3.Call trackingBackupStateGetAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = trackingBackupStateGetValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for trackingBrowserDetailedStatsList - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all browser tracking data -
- */ - public okhttp3.Call trackingBrowserDetailedStatsListCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/tracking/browser/stats/detailed"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - if (granularity != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call trackingBrowserDetailedStatsListValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'granularity' is set - if (granularity == null) { - throw new ApiException("Missing the required parameter 'granularity' when calling trackingBrowserDetailedStatsList(Async)"); - } - - return trackingBrowserDetailedStatsListCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Provides detailed browser tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return TrackingBrowserDetailedStatsListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all browser tracking data -
- */ - public TrackingBrowserDetailedStatsListRsp trackingBrowserDetailedStatsList(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = trackingBrowserDetailedStatsListWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Provides detailed browser tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<TrackingBrowserDetailedStatsListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all browser tracking data -
- */ - public ApiResponse trackingBrowserDetailedStatsListWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = trackingBrowserDetailedStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Provides detailed browser tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all browser tracking data -
- */ - public okhttp3.Call trackingBrowserDetailedStatsListAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = trackingBrowserDetailedStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for trackingBrowserStatsList - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of aggregated browser tracking data -
- */ - public okhttp3.Call trackingBrowserStatsListCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/tracking/browser/stats"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - if (granularity != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call trackingBrowserStatsListValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'granularity' is set - if (granularity == null) { - throw new ApiException("Missing the required parameter 'granularity' when calling trackingBrowserStatsList(Async)"); - } - - return trackingBrowserStatsListCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Provides browser tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return TrackingBrowserStatsListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of aggregated browser tracking data -
- */ - public TrackingBrowserStatsListRsp trackingBrowserStatsList(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = trackingBrowserStatsListWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Provides browser tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<TrackingBrowserStatsListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of aggregated browser tracking data -
- */ - public ApiResponse trackingBrowserStatsListWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = trackingBrowserStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Provides browser tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of aggregated browser tracking data -
- */ - public okhttp3.Call trackingBrowserStatsListAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = trackingBrowserStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for trackingDetailedStatsList - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all tracking data -
- */ - public okhttp3.Call trackingDetailedStatsListCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/tracking/stats/detailed"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - if (granularity != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call trackingDetailedStatsListValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'granularity' is set - if (granularity == null) { - throw new ApiException("Missing the required parameter 'granularity' when calling trackingDetailedStatsList(Async)"); - } - - return trackingDetailedStatsListCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Provides detailed tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return TrackingDetailedStatsListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all tracking data -
- */ - public TrackingDetailedStatsListRsp trackingDetailedStatsList(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = trackingDetailedStatsListWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Provides detailed tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<TrackingDetailedStatsListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all tracking data -
- */ - public ApiResponse trackingDetailedStatsListWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = trackingDetailedStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Provides detailed tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all tracking data -
- */ - public okhttp3.Call trackingDetailedStatsListAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = trackingDetailedStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for trackingEnumsGet - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains tracking enum values -
- */ - public okhttp3.Call trackingEnumsGetCall(String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/tracking/enums"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call trackingEnumsGetValidateBeforeCall(String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - return trackingEnumsGetCall(remoteAddress, userAgent, _callback); - - } - - /** - * - * Provides tracking enum values - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @return TrackingEnumsGetRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains tracking enum values -
- */ - public TrackingEnumsGetRsp trackingEnumsGet(String remoteAddress, String userAgent) throws ApiException { - ApiResponse localVarResp = trackingEnumsGetWithHttpInfo(remoteAddress, userAgent); - return localVarResp.getData(); - } - - /** - * - * Provides tracking enum values - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @return ApiResponse<TrackingEnumsGetRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains tracking enum values -
- */ - public ApiResponse trackingEnumsGetWithHttpInfo(String remoteAddress, String userAgent) throws ApiException { - okhttp3.Call localVarCall = trackingEnumsGetValidateBeforeCall(remoteAddress, userAgent, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Provides tracking enum values - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains tracking enum values -
- */ - public okhttp3.Call trackingEnumsGetAsync(String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = trackingEnumsGetValidateBeforeCall(remoteAddress, userAgent, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for trackingOSDetailedStatsList - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all OS tracking data -
- */ - public okhttp3.Call trackingOSDetailedStatsListCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/tracking/os/stats/detailed"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - if (granularity != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call trackingOSDetailedStatsListValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'granularity' is set - if (granularity == null) { - throw new ApiException("Missing the required parameter 'granularity' when calling trackingOSDetailedStatsList(Async)"); - } - - return trackingOSDetailedStatsListCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Provides detailed OS tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return TrackingOSDetailedStatsListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all OS tracking data -
- */ - public TrackingOSDetailedStatsListRsp trackingOSDetailedStatsList(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = trackingOSDetailedStatsListWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Provides detailed OS tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<TrackingOSDetailedStatsListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all OS tracking data -
- */ - public ApiResponse trackingOSDetailedStatsListWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = trackingOSDetailedStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Provides detailed OS tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all OS tracking data -
- */ - public okhttp3.Call trackingOSDetailedStatsListAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = trackingOSDetailedStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for trackingOSStatsList - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of aggregated OS tracking data -
- */ - public okhttp3.Call trackingOSStatsListCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/tracking/os/stats"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - if (granularity != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call trackingOSStatsListValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'granularity' is set - if (granularity == null) { - throw new ApiException("Missing the required parameter 'granularity' when calling trackingOSStatsList(Async)"); - } - - return trackingOSStatsListCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Provides os tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return TrackingOSStatsListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of aggregated OS tracking data -
- */ - public TrackingOSStatsListRsp trackingOSStatsList(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = trackingOSStatsListWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Provides os tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<TrackingOSStatsListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of aggregated OS tracking data -
- */ - public ApiResponse trackingOSStatsListWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = trackingOSStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Provides os tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of aggregated OS tracking data -
- */ - public okhttp3.Call trackingOSStatsListAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = trackingOSStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for trackingStatsList - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for tracking data -
- */ - public okhttp3.Call trackingStatsListCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/tracking/stats"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - if (granularity != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call trackingStatsListValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'granularity' is set - if (granularity == null) { - throw new ApiException("Missing the required parameter 'granularity' when calling trackingStatsList(Async)"); - } - - return trackingStatsListCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Provides aggregated statstics for project's passkeys tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return TrackingStatsListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for tracking data -
- */ - public TrackingStatsListRsp trackingStatsList(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = trackingStatsListWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Provides aggregated statstics for project's passkeys tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<TrackingStatsListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for tracking data -
- */ - public ApiResponse trackingStatsListWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = trackingStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Provides aggregated statstics for project's passkeys tracking data - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for tracking data -
- */ - public okhttp3.Call trackingStatsListAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = trackingStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/AndroidAppConfigApi.java b/src/main/java/com/corbado/generated/api/AndroidAppConfigApi.java deleted file mode 100644 index 6771c92..0000000 --- a/src/main/java/com/corbado/generated/api/AndroidAppConfigApi.java +++ /dev/null @@ -1,591 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.AndroidAppConfigDeleteReq; -import com.corbado.generated.model.AndroidAppConfigListRsp; -import com.corbado.generated.model.AndroidAppConfigSaveReq; -import com.corbado.generated.model.AndroidAppConfigSaveRsp; -import com.corbado.generated.model.AndroidAppConfigUpdateReq; -import com.corbado.generated.model.AndroidAppConfigUpdateRsp; -import com.corbado.generated.model.ErrorRsp; -import com.corbado.generated.model.GenericRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AndroidAppConfigApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public AndroidAppConfigApi() { - this(Configuration.getDefaultApiClient()); - } - - public AndroidAppConfigApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for androidAppConfigCreate - * @param androidAppConfigSaveReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Android App Config successfully created -
0 Error -
- */ - public okhttp3.Call androidAppConfigCreateCall(AndroidAppConfigSaveReq androidAppConfigSaveReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = androidAppConfigSaveReq; - - // create path and map variables - String localVarPath = "/v1/androidappconfig"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call androidAppConfigCreateValidateBeforeCall(AndroidAppConfigSaveReq androidAppConfigSaveReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'androidAppConfigSaveReq' is set - if (androidAppConfigSaveReq == null) { - throw new ApiException("Missing the required parameter 'androidAppConfigSaveReq' when calling androidAppConfigCreate(Async)"); - } - - return androidAppConfigCreateCall(androidAppConfigSaveReq, _callback); - - } - - /** - * - * Creates a new Android App Configuration - * @param androidAppConfigSaveReq (required) - * @return AndroidAppConfigSaveRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Android App Config successfully created -
0 Error -
- */ - public AndroidAppConfigSaveRsp androidAppConfigCreate(AndroidAppConfigSaveReq androidAppConfigSaveReq) throws ApiException { - ApiResponse localVarResp = androidAppConfigCreateWithHttpInfo(androidAppConfigSaveReq); - return localVarResp.getData(); - } - - /** - * - * Creates a new Android App Configuration - * @param androidAppConfigSaveReq (required) - * @return ApiResponse<AndroidAppConfigSaveRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Android App Config successfully created -
0 Error -
- */ - public ApiResponse androidAppConfigCreateWithHttpInfo(AndroidAppConfigSaveReq androidAppConfigSaveReq) throws ApiException { - okhttp3.Call localVarCall = androidAppConfigCreateValidateBeforeCall(androidAppConfigSaveReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Creates a new Android App Configuration - * @param androidAppConfigSaveReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Android App Config successfully created -
0 Error -
- */ - public okhttp3.Call androidAppConfigCreateAsync(AndroidAppConfigSaveReq androidAppConfigSaveReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = androidAppConfigCreateValidateBeforeCall(androidAppConfigSaveReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for androidAppConfigDelete - * @param androidAppConfigID Android App Config ID from create (required) - * @param androidAppConfigDeleteReq (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call androidAppConfigDeleteCall(String androidAppConfigID, AndroidAppConfigDeleteReq androidAppConfigDeleteReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = androidAppConfigDeleteReq; - - // create path and map variables - String localVarPath = "/v1/androidappconfig/{androidAppConfigID}" - .replace("{" + "androidAppConfigID" + "}", localVarApiClient.escapeString(androidAppConfigID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call androidAppConfigDeleteValidateBeforeCall(String androidAppConfigID, AndroidAppConfigDeleteReq androidAppConfigDeleteReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'androidAppConfigID' is set - if (androidAppConfigID == null) { - throw new ApiException("Missing the required parameter 'androidAppConfigID' when calling androidAppConfigDelete(Async)"); - } - - return androidAppConfigDeleteCall(androidAppConfigID, androidAppConfigDeleteReq, _callback); - - } - - /** - * - * Deletes an Android App Config - * @param androidAppConfigID Android App Config ID from create (required) - * @param androidAppConfigDeleteReq (optional) - * @return GenericRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public GenericRsp androidAppConfigDelete(String androidAppConfigID, AndroidAppConfigDeleteReq androidAppConfigDeleteReq) throws ApiException { - ApiResponse localVarResp = androidAppConfigDeleteWithHttpInfo(androidAppConfigID, androidAppConfigDeleteReq); - return localVarResp.getData(); - } - - /** - * - * Deletes an Android App Config - * @param androidAppConfigID Android App Config ID from create (required) - * @param androidAppConfigDeleteReq (optional) - * @return ApiResponse<GenericRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public ApiResponse androidAppConfigDeleteWithHttpInfo(String androidAppConfigID, AndroidAppConfigDeleteReq androidAppConfigDeleteReq) throws ApiException { - okhttp3.Call localVarCall = androidAppConfigDeleteValidateBeforeCall(androidAppConfigID, androidAppConfigDeleteReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Deletes an Android App Config - * @param androidAppConfigID Android App Config ID from create (required) - * @param androidAppConfigDeleteReq (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call androidAppConfigDeleteAsync(String androidAppConfigID, AndroidAppConfigDeleteReq androidAppConfigDeleteReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = androidAppConfigDeleteValidateBeforeCall(androidAppConfigID, androidAppConfigDeleteReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for androidAppConfigGet - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Android App Config List successfully retrieved -
0 Error -
- */ - public okhttp3.Call androidAppConfigGetCall(final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/androidappconfig"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call androidAppConfigGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return androidAppConfigGetCall(_callback); - - } - - /** - * - * Lists Android App Configurations for a project - * @return AndroidAppConfigListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Android App Config List successfully retrieved -
0 Error -
- */ - public AndroidAppConfigListRsp androidAppConfigGet() throws ApiException { - ApiResponse localVarResp = androidAppConfigGetWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * - * Lists Android App Configurations for a project - * @return ApiResponse<AndroidAppConfigListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Android App Config List successfully retrieved -
0 Error -
- */ - public ApiResponse androidAppConfigGetWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = androidAppConfigGetValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Lists Android App Configurations for a project - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Android App Config List successfully retrieved -
0 Error -
- */ - public okhttp3.Call androidAppConfigGetAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = androidAppConfigGetValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for androidAppConfigPut - * @param androidAppConfigID ID from Android config create (required) - * @param androidAppConfigUpdateReq (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains Android app config -
0 Error -
- */ - public okhttp3.Call androidAppConfigPutCall(String androidAppConfigID, AndroidAppConfigUpdateReq androidAppConfigUpdateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = androidAppConfigUpdateReq; - - // create path and map variables - String localVarPath = "/v1/androidappconfig/{androidAppConfigID}" - .replace("{" + "androidAppConfigID" + "}", localVarApiClient.escapeString(androidAppConfigID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call androidAppConfigPutValidateBeforeCall(String androidAppConfigID, AndroidAppConfigUpdateReq androidAppConfigUpdateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'androidAppConfigID' is set - if (androidAppConfigID == null) { - throw new ApiException("Missing the required parameter 'androidAppConfigID' when calling androidAppConfigPut(Async)"); - } - - return androidAppConfigPutCall(androidAppConfigID, androidAppConfigUpdateReq, _callback); - - } - - /** - * - * Updates an Android app config by id - * @param androidAppConfigID ID from Android config create (required) - * @param androidAppConfigUpdateReq (optional) - * @return AndroidAppConfigUpdateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains Android app config -
0 Error -
- */ - public AndroidAppConfigUpdateRsp androidAppConfigPut(String androidAppConfigID, AndroidAppConfigUpdateReq androidAppConfigUpdateReq) throws ApiException { - ApiResponse localVarResp = androidAppConfigPutWithHttpInfo(androidAppConfigID, androidAppConfigUpdateReq); - return localVarResp.getData(); - } - - /** - * - * Updates an Android app config by id - * @param androidAppConfigID ID from Android config create (required) - * @param androidAppConfigUpdateReq (optional) - * @return ApiResponse<AndroidAppConfigUpdateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains Android app config -
0 Error -
- */ - public ApiResponse androidAppConfigPutWithHttpInfo(String androidAppConfigID, AndroidAppConfigUpdateReq androidAppConfigUpdateReq) throws ApiException { - okhttp3.Call localVarCall = androidAppConfigPutValidateBeforeCall(androidAppConfigID, androidAppConfigUpdateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Updates an Android app config by id - * @param androidAppConfigID ID from Android config create (required) - * @param androidAppConfigUpdateReq (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains Android app config -
0 Error -
- */ - public okhttp3.Call androidAppConfigPutAsync(String androidAppConfigID, AndroidAppConfigUpdateReq androidAppConfigUpdateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = androidAppConfigPutValidateBeforeCall(androidAppConfigID, androidAppConfigUpdateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/ApiSecretsApi.java b/src/main/java/com/corbado/generated/api/ApiSecretsApi.java deleted file mode 100644 index 9d0e975..0000000 --- a/src/main/java/com/corbado/generated/api/ApiSecretsApi.java +++ /dev/null @@ -1,451 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.ErrorRsp; -import com.corbado.generated.model.GenericRsp; -import com.corbado.generated.model.ProjectSecretCreateReq; -import com.corbado.generated.model.ProjectSecretCreateRsp; -import com.corbado.generated.model.ProjectSecretDeleteReq; -import com.corbado.generated.model.ProjectSecretListRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class ApiSecretsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public ApiSecretsApi() { - this(Configuration.getDefaultApiClient()); - } - - public ApiSecretsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for projectSecretCreate - * @param projectSecretCreateReq (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 API secret successfully created -
0 Error -
- */ - public okhttp3.Call projectSecretCreateCall(ProjectSecretCreateReq projectSecretCreateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = projectSecretCreateReq; - - // create path and map variables - String localVarPath = "/v1/projectSecrets"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call projectSecretCreateValidateBeforeCall(ProjectSecretCreateReq projectSecretCreateReq, final ApiCallback _callback) throws ApiException { - return projectSecretCreateCall(projectSecretCreateReq, _callback); - - } - - /** - * - * Creates an API secret - * @param projectSecretCreateReq (optional) - * @return ProjectSecretCreateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 API secret successfully created -
0 Error -
- */ - public ProjectSecretCreateRsp projectSecretCreate(ProjectSecretCreateReq projectSecretCreateReq) throws ApiException { - ApiResponse localVarResp = projectSecretCreateWithHttpInfo(projectSecretCreateReq); - return localVarResp.getData(); - } - - /** - * - * Creates an API secret - * @param projectSecretCreateReq (optional) - * @return ApiResponse<ProjectSecretCreateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 API secret successfully created -
0 Error -
- */ - public ApiResponse projectSecretCreateWithHttpInfo(ProjectSecretCreateReq projectSecretCreateReq) throws ApiException { - okhttp3.Call localVarCall = projectSecretCreateValidateBeforeCall(projectSecretCreateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Creates an API secret - * @param projectSecretCreateReq (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 API secret successfully created -
0 Error -
- */ - public okhttp3.Call projectSecretCreateAsync(ProjectSecretCreateReq projectSecretCreateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = projectSecretCreateValidateBeforeCall(projectSecretCreateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for projectSecretDelete - * @param secretID Secret ID from create (required) - * @param projectSecretDeleteReq (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call projectSecretDeleteCall(String secretID, ProjectSecretDeleteReq projectSecretDeleteReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = projectSecretDeleteReq; - - // create path and map variables - String localVarPath = "/v1/projectSecrets/{secretID}" - .replace("{" + "secretID" + "}", localVarApiClient.escapeString(secretID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call projectSecretDeleteValidateBeforeCall(String secretID, ProjectSecretDeleteReq projectSecretDeleteReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'secretID' is set - if (secretID == null) { - throw new ApiException("Missing the required parameter 'secretID' when calling projectSecretDelete(Async)"); - } - - return projectSecretDeleteCall(secretID, projectSecretDeleteReq, _callback); - - } - - /** - * - * Deletes API secret - * @param secretID Secret ID from create (required) - * @param projectSecretDeleteReq (optional) - * @return GenericRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public GenericRsp projectSecretDelete(String secretID, ProjectSecretDeleteReq projectSecretDeleteReq) throws ApiException { - ApiResponse localVarResp = projectSecretDeleteWithHttpInfo(secretID, projectSecretDeleteReq); - return localVarResp.getData(); - } - - /** - * - * Deletes API secret - * @param secretID Secret ID from create (required) - * @param projectSecretDeleteReq (optional) - * @return ApiResponse<GenericRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public ApiResponse projectSecretDeleteWithHttpInfo(String secretID, ProjectSecretDeleteReq projectSecretDeleteReq) throws ApiException { - okhttp3.Call localVarCall = projectSecretDeleteValidateBeforeCall(secretID, projectSecretDeleteReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Deletes API secret - * @param secretID Secret ID from create (required) - * @param projectSecretDeleteReq (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call projectSecretDeleteAsync(String secretID, ProjectSecretDeleteReq projectSecretDeleteReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = projectSecretDeleteValidateBeforeCall(secretID, projectSecretDeleteReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for projectSecretList - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 List of API secrets -
0 Error -
- */ - public okhttp3.Call projectSecretListCall(final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/projectSecrets"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call projectSecretListValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return projectSecretListCall(_callback); - - } - - /** - * - * Lists API secrets - * @return ProjectSecretListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 List of API secrets -
0 Error -
- */ - public ProjectSecretListRsp projectSecretList() throws ApiException { - ApiResponse localVarResp = projectSecretListWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * - * Lists API secrets - * @return ApiResponse<ProjectSecretListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 List of API secrets -
0 Error -
- */ - public ApiResponse projectSecretListWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = projectSecretListValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Lists API secrets - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 List of API secrets -
0 Error -
- */ - public okhttp3.Call projectSecretListAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = projectSecretListValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/AssociationTokensApi.java b/src/main/java/com/corbado/generated/api/AssociationTokensApi.java deleted file mode 100644 index f78fb1f..0000000 --- a/src/main/java/com/corbado/generated/api/AssociationTokensApi.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.AssociationTokenCreateReq; -import com.corbado.generated.model.AssociationTokenCreateRsp; -import com.corbado.generated.model.ErrorRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AssociationTokensApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public AssociationTokensApi() { - this(Configuration.getDefaultApiClient()); - } - - public AssociationTokensApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for associationTokenCreate - * @param associationTokenCreateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Association token successfully created -
0 Error -
- */ - public okhttp3.Call associationTokenCreateCall(AssociationTokenCreateReq associationTokenCreateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = associationTokenCreateReq; - - // create path and map variables - String localVarPath = "/v1/associationTokens"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call associationTokenCreateValidateBeforeCall(AssociationTokenCreateReq associationTokenCreateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'associationTokenCreateReq' is set - if (associationTokenCreateReq == null) { - throw new ApiException("Missing the required parameter 'associationTokenCreateReq' when calling associationTokenCreate(Async)"); - } - - return associationTokenCreateCall(associationTokenCreateReq, _callback); - - } - - /** - * - * Creates a new association token - * @param associationTokenCreateReq (required) - * @return AssociationTokenCreateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Association token successfully created -
0 Error -
- */ - public AssociationTokenCreateRsp associationTokenCreate(AssociationTokenCreateReq associationTokenCreateReq) throws ApiException { - ApiResponse localVarResp = associationTokenCreateWithHttpInfo(associationTokenCreateReq); - return localVarResp.getData(); - } - - /** - * - * Creates a new association token - * @param associationTokenCreateReq (required) - * @return ApiResponse<AssociationTokenCreateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Association token successfully created -
0 Error -
- */ - public ApiResponse associationTokenCreateWithHttpInfo(AssociationTokenCreateReq associationTokenCreateReq) throws ApiException { - okhttp3.Call localVarCall = associationTokenCreateValidateBeforeCall(associationTokenCreateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Creates a new association token - * @param associationTokenCreateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Association token successfully created -
0 Error -
- */ - public okhttp3.Call associationTokenCreateAsync(AssociationTokenCreateReq associationTokenCreateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = associationTokenCreateValidateBeforeCall(associationTokenCreateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/AuthEventsApi.java b/src/main/java/com/corbado/generated/api/AuthEventsApi.java new file mode 100644 index 0000000..cc1d0e4 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/AuthEventsApi.java @@ -0,0 +1,209 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.AuthEvent; +import com.corbado.generated.model.AuthEventCreateReq; +import com.corbado.generated.model.ErrorRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AuthEventsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AuthEventsApi() { + this(Configuration.getDefaultApiClient()); + } + + public AuthEventsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for authEventCreate + * @param userID ID of user (required) + * @param authEventCreateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth event has been created -
0 Error -
+ */ + public okhttp3.Call authEventCreateCall(String userID, AuthEventCreateReq authEventCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = authEventCreateReq; + + // create path and map variables + String localVarPath = "/users/{userID}/authEvents" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call authEventCreateValidateBeforeCall(String userID, AuthEventCreateReq authEventCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling authEventCreate(Async)"); + } + + return authEventCreateCall(userID, authEventCreateReq, _callback); + + } + + /** + * + * Create a new authentication event for a user + * @param userID ID of user (required) + * @param authEventCreateReq (optional) + * @return AuthEvent + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth event has been created -
0 Error -
+ */ + public AuthEvent authEventCreate(String userID, AuthEventCreateReq authEventCreateReq) throws ApiException { + ApiResponse localVarResp = authEventCreateWithHttpInfo(userID, authEventCreateReq); + return localVarResp.getData(); + } + + /** + * + * Create a new authentication event for a user + * @param userID ID of user (required) + * @param authEventCreateReq (optional) + * @return ApiResponse<AuthEvent> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth event has been created -
0 Error -
+ */ + public ApiResponse authEventCreateWithHttpInfo(String userID, AuthEventCreateReq authEventCreateReq) throws ApiException { + okhttp3.Call localVarCall = authEventCreateValidateBeforeCall(userID, authEventCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Create a new authentication event for a user + * @param userID ID of user (required) + * @param authEventCreateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Auth event has been created -
0 Error -
+ */ + public okhttp3.Call authEventCreateAsync(String userID, AuthEventCreateReq authEventCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = authEventCreateValidateBeforeCall(userID, authEventCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/AuthMethodsApi.java b/src/main/java/com/corbado/generated/api/AuthMethodsApi.java deleted file mode 100644 index e9b8a72..0000000 --- a/src/main/java/com/corbado/generated/api/AuthMethodsApi.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.AuthMethodsListReq; -import com.corbado.generated.model.AuthMethodsListRsp; -import com.corbado.generated.model.ErrorRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AuthMethodsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public AuthMethodsApi() { - this(Configuration.getDefaultApiClient()); - } - - public AuthMethodsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for authMethodsList - * @param authMethodsListReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
- */ - public okhttp3.Call authMethodsListCall(AuthMethodsListReq authMethodsListReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = authMethodsListReq; - - // create path and map variables - String localVarPath = "/v1/authMethods"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call authMethodsListValidateBeforeCall(AuthMethodsListReq authMethodsListReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'authMethodsListReq' is set - if (authMethodsListReq == null) { - throw new ApiException("Missing the required parameter 'authMethodsListReq' when calling authMethodsList(Async)"); - } - - return authMethodsListCall(authMethodsListReq, _callback); - - } - - /** - * - * Retrieves possible authentication methods for provided username - * @param authMethodsListReq (required) - * @return AuthMethodsListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
- */ - public AuthMethodsListRsp authMethodsList(AuthMethodsListReq authMethodsListReq) throws ApiException { - ApiResponse localVarResp = authMethodsListWithHttpInfo(authMethodsListReq); - return localVarResp.getData(); - } - - /** - * - * Retrieves possible authentication methods for provided username - * @param authMethodsListReq (required) - * @return ApiResponse<AuthMethodsListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
- */ - public ApiResponse authMethodsListWithHttpInfo(AuthMethodsListReq authMethodsListReq) throws ApiException { - okhttp3.Call localVarCall = authMethodsListValidateBeforeCall(authMethodsListReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Retrieves possible authentication methods for provided username - * @param authMethodsListReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
- */ - public okhttp3.Call authMethodsListAsync(AuthMethodsListReq authMethodsListReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = authMethodsListValidateBeforeCall(authMethodsListReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/AuthTokensApi.java b/src/main/java/com/corbado/generated/api/AuthTokensApi.java deleted file mode 100644 index 3ff45a2..0000000 --- a/src/main/java/com/corbado/generated/api/AuthTokensApi.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.AuthTokenValidateReq; -import com.corbado.generated.model.AuthTokenValidateRsp; -import com.corbado.generated.model.ErrorRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AuthTokensApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public AuthTokensApi() { - this(Configuration.getDefaultApiClient()); - } - - public AuthTokensApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for authTokenValidate - * @param authTokenValidateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Auth token successfully validated -
0 Error -
- */ - public okhttp3.Call authTokenValidateCall(AuthTokenValidateReq authTokenValidateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = authTokenValidateReq; - - // create path and map variables - String localVarPath = "/v1/authTokens/validate"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call authTokenValidateValidateBeforeCall(AuthTokenValidateReq authTokenValidateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'authTokenValidateReq' is set - if (authTokenValidateReq == null) { - throw new ApiException("Missing the required parameter 'authTokenValidateReq' when calling authTokenValidate(Async)"); - } - - return authTokenValidateCall(authTokenValidateReq, _callback); - - } - - /** - * - * Validates auth token and returns attached user data - * @param authTokenValidateReq (required) - * @return AuthTokenValidateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Auth token successfully validated -
0 Error -
- */ - public AuthTokenValidateRsp authTokenValidate(AuthTokenValidateReq authTokenValidateReq) throws ApiException { - ApiResponse localVarResp = authTokenValidateWithHttpInfo(authTokenValidateReq); - return localVarResp.getData(); - } - - /** - * - * Validates auth token and returns attached user data - * @param authTokenValidateReq (required) - * @return ApiResponse<AuthTokenValidateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Auth token successfully validated -
0 Error -
- */ - public ApiResponse authTokenValidateWithHttpInfo(AuthTokenValidateReq authTokenValidateReq) throws ApiException { - okhttp3.Call localVarCall = authTokenValidateValidateBeforeCall(authTokenValidateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Validates auth token and returns attached user data - * @param authTokenValidateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Auth token successfully validated -
0 Error -
- */ - public okhttp3.Call authTokenValidateAsync(AuthTokenValidateReq authTokenValidateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = authTokenValidateValidateBeforeCall(authTokenValidateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/ChallengesApi.java b/src/main/java/com/corbado/generated/api/ChallengesApi.java new file mode 100644 index 0000000..e152727 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/ChallengesApi.java @@ -0,0 +1,352 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.Challenge; +import com.corbado.generated.model.ChallengeCreateReq; +import com.corbado.generated.model.ChallengeUpdateReq; +import com.corbado.generated.model.ErrorRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ChallengesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ChallengesApi() { + this(Configuration.getDefaultApiClient()); + } + + public ChallengesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for challengeCreate + * @param userID ID of user (required) + * @param challengeCreateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Challenge has been created -
0 Error -
+ */ + public okhttp3.Call challengeCreateCall(String userID, ChallengeCreateReq challengeCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = challengeCreateReq; + + // create path and map variables + String localVarPath = "/users/{userID}/challenges" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call challengeCreateValidateBeforeCall(String userID, ChallengeCreateReq challengeCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling challengeCreate(Async)"); + } + + return challengeCreateCall(userID, challengeCreateReq, _callback); + + } + + /** + * + * Create a new challenge to verify a login identifier + * @param userID ID of user (required) + * @param challengeCreateReq (optional) + * @return Challenge + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Challenge has been created -
0 Error -
+ */ + public Challenge challengeCreate(String userID, ChallengeCreateReq challengeCreateReq) throws ApiException { + ApiResponse localVarResp = challengeCreateWithHttpInfo(userID, challengeCreateReq); + return localVarResp.getData(); + } + + /** + * + * Create a new challenge to verify a login identifier + * @param userID ID of user (required) + * @param challengeCreateReq (optional) + * @return ApiResponse<Challenge> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Challenge has been created -
0 Error -
+ */ + public ApiResponse challengeCreateWithHttpInfo(String userID, ChallengeCreateReq challengeCreateReq) throws ApiException { + okhttp3.Call localVarCall = challengeCreateValidateBeforeCall(userID, challengeCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Create a new challenge to verify a login identifier + * @param userID ID of user (required) + * @param challengeCreateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Challenge has been created -
0 Error -
+ */ + public okhttp3.Call challengeCreateAsync(String userID, ChallengeCreateReq challengeCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = challengeCreateValidateBeforeCall(userID, challengeCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for challengeUpdate + * @param userID ID of user (required) + * @param challengeID ID of challenge (required) + * @param challengeUpdateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Challenge has been updated -
0 Error -
+ */ + public okhttp3.Call challengeUpdateCall(String userID, String challengeID, ChallengeUpdateReq challengeUpdateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = challengeUpdateReq; + + // create path and map variables + String localVarPath = "/users/{userID}/challenges/{challengeID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "challengeID" + "}", localVarApiClient.escapeString(challengeID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call challengeUpdateValidateBeforeCall(String userID, String challengeID, ChallengeUpdateReq challengeUpdateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling challengeUpdate(Async)"); + } + + // verify the required parameter 'challengeID' is set + if (challengeID == null) { + throw new ApiException("Missing the required parameter 'challengeID' when calling challengeUpdate(Async)"); + } + + return challengeUpdateCall(userID, challengeID, challengeUpdateReq, _callback); + + } + + /** + * + * Updates a challenge (e.g. from pending to completed) + * @param userID ID of user (required) + * @param challengeID ID of challenge (required) + * @param challengeUpdateReq (optional) + * @return Challenge + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Challenge has been updated -
0 Error -
+ */ + public Challenge challengeUpdate(String userID, String challengeID, ChallengeUpdateReq challengeUpdateReq) throws ApiException { + ApiResponse localVarResp = challengeUpdateWithHttpInfo(userID, challengeID, challengeUpdateReq); + return localVarResp.getData(); + } + + /** + * + * Updates a challenge (e.g. from pending to completed) + * @param userID ID of user (required) + * @param challengeID ID of challenge (required) + * @param challengeUpdateReq (optional) + * @return ApiResponse<Challenge> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Challenge has been updated -
0 Error -
+ */ + public ApiResponse challengeUpdateWithHttpInfo(String userID, String challengeID, ChallengeUpdateReq challengeUpdateReq) throws ApiException { + okhttp3.Call localVarCall = challengeUpdateValidateBeforeCall(userID, challengeID, challengeUpdateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Updates a challenge (e.g. from pending to completed) + * @param userID ID of user (required) + * @param challengeID ID of challenge (required) + * @param challengeUpdateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Challenge has been updated -
0 Error -
+ */ + public okhttp3.Call challengeUpdateAsync(String userID, String challengeID, ChallengeUpdateReq challengeUpdateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = challengeUpdateValidateBeforeCall(userID, challengeID, challengeUpdateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/ConnectTokensApi.java b/src/main/java/com/corbado/generated/api/ConnectTokensApi.java new file mode 100644 index 0000000..f4a33df --- /dev/null +++ b/src/main/java/com/corbado/generated/api/ConnectTokensApi.java @@ -0,0 +1,610 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ConnectToken; +import com.corbado.generated.model.ConnectTokenCreateReq; +import com.corbado.generated.model.ConnectTokenList; +import com.corbado.generated.model.ConnectTokenUpdateReq; +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.GenericRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ConnectTokensApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ConnectTokensApi() { + this(Configuration.getDefaultApiClient()); + } + + public ConnectTokensApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for connectTokenCreate + * @param connectTokenCreateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Connect token has been created -
0 Error -
+ */ + public okhttp3.Call connectTokenCreateCall(ConnectTokenCreateReq connectTokenCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = connectTokenCreateReq; + + // create path and map variables + String localVarPath = "/connectTokens"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call connectTokenCreateValidateBeforeCall(ConnectTokenCreateReq connectTokenCreateReq, final ApiCallback _callback) throws ApiException { + return connectTokenCreateCall(connectTokenCreateReq, _callback); + + } + + /** + * + * Create a new connect token + * @param connectTokenCreateReq (optional) + * @return ConnectToken + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Connect token has been created -
0 Error -
+ */ + public ConnectToken connectTokenCreate(ConnectTokenCreateReq connectTokenCreateReq) throws ApiException { + ApiResponse localVarResp = connectTokenCreateWithHttpInfo(connectTokenCreateReq); + return localVarResp.getData(); + } + + /** + * + * Create a new connect token + * @param connectTokenCreateReq (optional) + * @return ApiResponse<ConnectToken> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Connect token has been created -
0 Error -
+ */ + public ApiResponse connectTokenCreateWithHttpInfo(ConnectTokenCreateReq connectTokenCreateReq) throws ApiException { + okhttp3.Call localVarCall = connectTokenCreateValidateBeforeCall(connectTokenCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Create a new connect token + * @param connectTokenCreateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Connect token has been created -
0 Error -
+ */ + public okhttp3.Call connectTokenCreateAsync(ConnectTokenCreateReq connectTokenCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = connectTokenCreateValidateBeforeCall(connectTokenCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for connectTokenDelete + * @param connectTokenID ID of an append token (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call connectTokenDeleteCall(String connectTokenID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/connectTokens/{connectTokenID}" + .replace("{" + "connectTokenID" + "}", localVarApiClient.escapeString(connectTokenID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call connectTokenDeleteValidateBeforeCall(String connectTokenID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'connectTokenID' is set + if (connectTokenID == null) { + throw new ApiException("Missing the required parameter 'connectTokenID' when calling connectTokenDelete(Async)"); + } + + return connectTokenDeleteCall(connectTokenID, _callback); + + } + + /** + * + * Deletes an existing append token + * @param connectTokenID ID of an append token (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp connectTokenDelete(String connectTokenID) throws ApiException { + ApiResponse localVarResp = connectTokenDeleteWithHttpInfo(connectTokenID); + return localVarResp.getData(); + } + + /** + * + * Deletes an existing append token + * @param connectTokenID ID of an append token (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse connectTokenDeleteWithHttpInfo(String connectTokenID) throws ApiException { + okhttp3.Call localVarCall = connectTokenDeleteValidateBeforeCall(connectTokenID, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Deletes an existing append token + * @param connectTokenID ID of an append token (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call connectTokenDeleteAsync(String connectTokenID, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = connectTokenDeleteValidateBeforeCall(connectTokenID, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for connectTokenList + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching append tokens -
0 Error -
+ */ + public okhttp3.Call connectTokenListCall(String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/connectTokens"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call connectTokenListValidateBeforeCall(String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + return connectTokenListCall(sort, filter, page, pageSize, _callback); + + } + + /** + * + * Returns a list of matching append tokens + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ConnectTokenList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching append tokens -
0 Error -
+ */ + public ConnectTokenList connectTokenList(String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = connectTokenListWithHttpInfo(sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Returns a list of matching append tokens + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<ConnectTokenList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching append tokens -
0 Error -
+ */ + public ApiResponse connectTokenListWithHttpInfo(String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = connectTokenListValidateBeforeCall(sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Returns a list of matching append tokens + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching append tokens -
0 Error -
+ */ + public okhttp3.Call connectTokenListAsync(String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = connectTokenListValidateBeforeCall(sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for connectTokenUpdate + * @param connectTokenID ID of an append token (required) + * @param connectTokenUpdateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call connectTokenUpdateCall(String connectTokenID, ConnectTokenUpdateReq connectTokenUpdateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = connectTokenUpdateReq; + + // create path and map variables + String localVarPath = "/connectTokens/{connectTokenID}" + .replace("{" + "connectTokenID" + "}", localVarApiClient.escapeString(connectTokenID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call connectTokenUpdateValidateBeforeCall(String connectTokenID, ConnectTokenUpdateReq connectTokenUpdateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'connectTokenID' is set + if (connectTokenID == null) { + throw new ApiException("Missing the required parameter 'connectTokenID' when calling connectTokenUpdate(Async)"); + } + + return connectTokenUpdateCall(connectTokenID, connectTokenUpdateReq, _callback); + + } + + /** + * + * Updates an existing append token + * @param connectTokenID ID of an append token (required) + * @param connectTokenUpdateReq (optional) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp connectTokenUpdate(String connectTokenID, ConnectTokenUpdateReq connectTokenUpdateReq) throws ApiException { + ApiResponse localVarResp = connectTokenUpdateWithHttpInfo(connectTokenID, connectTokenUpdateReq); + return localVarResp.getData(); + } + + /** + * + * Updates an existing append token + * @param connectTokenID ID of an append token (required) + * @param connectTokenUpdateReq (optional) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse connectTokenUpdateWithHttpInfo(String connectTokenID, ConnectTokenUpdateReq connectTokenUpdateReq) throws ApiException { + okhttp3.Call localVarCall = connectTokenUpdateValidateBeforeCall(connectTokenID, connectTokenUpdateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Updates an existing append token + * @param connectTokenID ID of an append token (required) + * @param connectTokenUpdateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call connectTokenUpdateAsync(String connectTokenID, ConnectTokenUpdateReq connectTokenUpdateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = connectTokenUpdateValidateBeforeCall(connectTokenID, connectTokenUpdateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/EmailMagicLinksApi.java b/src/main/java/com/corbado/generated/api/EmailMagicLinksApi.java deleted file mode 100644 index c2e0999..0000000 --- a/src/main/java/com/corbado/generated/api/EmailMagicLinksApi.java +++ /dev/null @@ -1,604 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.EmailLinkGetRsp; -import com.corbado.generated.model.EmailLinkSendReq; -import com.corbado.generated.model.EmailLinkSendRsp; -import com.corbado.generated.model.EmailLinkValidateRsp; -import com.corbado.generated.model.EmailLinksDeleteReq; -import com.corbado.generated.model.EmailLinksValidateReq; -import com.corbado.generated.model.ErrorRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class EmailMagicLinksApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public EmailMagicLinksApi() { - this(Configuration.getDefaultApiClient()); - } - - public EmailMagicLinksApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for emailLinkDelete - * @param emailLinkID ID of email magic link (required) - * @param emailLinksDeleteReq (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public okhttp3.Call emailLinkDeleteCall(String emailLinkID, EmailLinksDeleteReq emailLinksDeleteReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = emailLinksDeleteReq; - - // create path and map variables - String localVarPath = "/v1/emailLinks/{emailLinkID}" - .replace("{" + "emailLinkID" + "}", localVarApiClient.escapeString(emailLinkID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call emailLinkDeleteValidateBeforeCall(String emailLinkID, EmailLinksDeleteReq emailLinksDeleteReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'emailLinkID' is set - if (emailLinkID == null) { - throw new ApiException("Missing the required parameter 'emailLinkID' when calling emailLinkDelete(Async)"); - } - - return emailLinkDeleteCall(emailLinkID, emailLinksDeleteReq, _callback); - - } - - /** - * - * Deletes an email magic link - * @param emailLinkID ID of email magic link (required) - * @param emailLinksDeleteReq (optional) - * @return EmailLinkValidateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public EmailLinkValidateRsp emailLinkDelete(String emailLinkID, EmailLinksDeleteReq emailLinksDeleteReq) throws ApiException { - ApiResponse localVarResp = emailLinkDeleteWithHttpInfo(emailLinkID, emailLinksDeleteReq); - return localVarResp.getData(); - } - - /** - * - * Deletes an email magic link - * @param emailLinkID ID of email magic link (required) - * @param emailLinksDeleteReq (optional) - * @return ApiResponse<EmailLinkValidateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public ApiResponse emailLinkDeleteWithHttpInfo(String emailLinkID, EmailLinksDeleteReq emailLinksDeleteReq) throws ApiException { - okhttp3.Call localVarCall = emailLinkDeleteValidateBeforeCall(emailLinkID, emailLinksDeleteReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Deletes an email magic link - * @param emailLinkID ID of email magic link (required) - * @param emailLinksDeleteReq (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public okhttp3.Call emailLinkDeleteAsync(String emailLinkID, EmailLinksDeleteReq emailLinksDeleteReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = emailLinkDeleteValidateBeforeCall(emailLinkID, emailLinksDeleteReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for emailLinkGet - * @param emailLinkID ID of email magic link (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains details of an email link -
0 Error -
- */ - public okhttp3.Call emailLinkGetCall(String emailLinkID, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/emailLinks/{emailLinkID}" - .replace("{" + "emailLinkID" + "}", localVarApiClient.escapeString(emailLinkID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call emailLinkGetValidateBeforeCall(String emailLinkID, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'emailLinkID' is set - if (emailLinkID == null) { - throw new ApiException("Missing the required parameter 'emailLinkID' when calling emailLinkGet(Async)"); - } - - return emailLinkGetCall(emailLinkID, _callback); - - } - - /** - * - * Get an email magic link only one time after confirmed - * @param emailLinkID ID of email magic link (required) - * @return EmailLinkGetRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains details of an email link -
0 Error -
- */ - public EmailLinkGetRsp emailLinkGet(String emailLinkID) throws ApiException { - ApiResponse localVarResp = emailLinkGetWithHttpInfo(emailLinkID); - return localVarResp.getData(); - } - - /** - * - * Get an email magic link only one time after confirmed - * @param emailLinkID ID of email magic link (required) - * @return ApiResponse<EmailLinkGetRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains details of an email link -
0 Error -
- */ - public ApiResponse emailLinkGetWithHttpInfo(String emailLinkID) throws ApiException { - okhttp3.Call localVarCall = emailLinkGetValidateBeforeCall(emailLinkID, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Get an email magic link only one time after confirmed - * @param emailLinkID ID of email magic link (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains details of an email link -
0 Error -
- */ - public okhttp3.Call emailLinkGetAsync(String emailLinkID, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = emailLinkGetValidateBeforeCall(emailLinkID, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for emailLinkSend - * @param emailLinkSendReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
- */ - public okhttp3.Call emailLinkSendCall(EmailLinkSendReq emailLinkSendReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = emailLinkSendReq; - - // create path and map variables - String localVarPath = "/v1/emailLinks"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call emailLinkSendValidateBeforeCall(EmailLinkSendReq emailLinkSendReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'emailLinkSendReq' is set - if (emailLinkSendReq == null) { - throw new ApiException("Missing the required parameter 'emailLinkSendReq' when calling emailLinkSend(Async)"); - } - - return emailLinkSendCall(emailLinkSendReq, _callback); - - } - - /** - * - * Creates email magic link and sends it to given email address - * @param emailLinkSendReq (required) - * @return EmailLinkSendRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
- */ - public EmailLinkSendRsp emailLinkSend(EmailLinkSendReq emailLinkSendReq) throws ApiException { - ApiResponse localVarResp = emailLinkSendWithHttpInfo(emailLinkSendReq); - return localVarResp.getData(); - } - - /** - * - * Creates email magic link and sends it to given email address - * @param emailLinkSendReq (required) - * @return ApiResponse<EmailLinkSendRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
- */ - public ApiResponse emailLinkSendWithHttpInfo(EmailLinkSendReq emailLinkSendReq) throws ApiException { - okhttp3.Call localVarCall = emailLinkSendValidateBeforeCall(emailLinkSendReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Creates email magic link and sends it to given email address - * @param emailLinkSendReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
- */ - public okhttp3.Call emailLinkSendAsync(EmailLinkSendReq emailLinkSendReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = emailLinkSendValidateBeforeCall(emailLinkSendReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for emailLinkValidate - * @param emailLinkID ID of email magic link (required) - * @param emailLinksValidateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public okhttp3.Call emailLinkValidateCall(String emailLinkID, EmailLinksValidateReq emailLinksValidateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = emailLinksValidateReq; - - // create path and map variables - String localVarPath = "/v1/emailLinks/{emailLinkID}/validate" - .replace("{" + "emailLinkID" + "}", localVarApiClient.escapeString(emailLinkID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call emailLinkValidateValidateBeforeCall(String emailLinkID, EmailLinksValidateReq emailLinksValidateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'emailLinkID' is set - if (emailLinkID == null) { - throw new ApiException("Missing the required parameter 'emailLinkID' when calling emailLinkValidate(Async)"); - } - - // verify the required parameter 'emailLinksValidateReq' is set - if (emailLinksValidateReq == null) { - throw new ApiException("Missing the required parameter 'emailLinksValidateReq' when calling emailLinkValidate(Async)"); - } - - return emailLinkValidateCall(emailLinkID, emailLinksValidateReq, _callback); - - } - - /** - * - * Validates email magic link token - * @param emailLinkID ID of email magic link (required) - * @param emailLinksValidateReq (required) - * @return EmailLinkValidateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public EmailLinkValidateRsp emailLinkValidate(String emailLinkID, EmailLinksValidateReq emailLinksValidateReq) throws ApiException { - ApiResponse localVarResp = emailLinkValidateWithHttpInfo(emailLinkID, emailLinksValidateReq); - return localVarResp.getData(); - } - - /** - * - * Validates email magic link token - * @param emailLinkID ID of email magic link (required) - * @param emailLinksValidateReq (required) - * @return ApiResponse<EmailLinkValidateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public ApiResponse emailLinkValidateWithHttpInfo(String emailLinkID, EmailLinksValidateReq emailLinksValidateReq) throws ApiException { - okhttp3.Call localVarCall = emailLinkValidateValidateBeforeCall(emailLinkID, emailLinksValidateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Validates email magic link token - * @param emailLinkID ID of email magic link (required) - * @param emailLinksValidateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public okhttp3.Call emailLinkValidateAsync(String emailLinkID, EmailLinksValidateReq emailLinksValidateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = emailLinkValidateValidateBeforeCall(emailLinkID, emailLinksValidateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/EmailOtpApi.java b/src/main/java/com/corbado/generated/api/EmailOtpApi.java deleted file mode 100644 index f004b0d..0000000 --- a/src/main/java/com/corbado/generated/api/EmailOtpApi.java +++ /dev/null @@ -1,471 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.EmailCodeGetRsp; -import com.corbado.generated.model.EmailCodeSendReq; -import com.corbado.generated.model.EmailCodeSendRsp; -import com.corbado.generated.model.EmailCodeValidateReq; -import com.corbado.generated.model.EmailCodeValidateRsp; -import com.corbado.generated.model.ErrorRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class EmailOtpApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public EmailOtpApi() { - this(Configuration.getDefaultApiClient()); - } - - public EmailOtpApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for emailCodeGet - * @param emailCodeID ID of email OTP (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains details of an email OTP -
0 Error -
- */ - public okhttp3.Call emailCodeGetCall(String emailCodeID, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/emailCodes/{emailCodeID}" - .replace("{" + "emailCodeID" + "}", localVarApiClient.escapeString(emailCodeID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call emailCodeGetValidateBeforeCall(String emailCodeID, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'emailCodeID' is set - if (emailCodeID == null) { - throw new ApiException("Missing the required parameter 'emailCodeID' when calling emailCodeGet(Async)"); - } - - return emailCodeGetCall(emailCodeID, _callback); - - } - - /** - * - * Get an email OTP only one time after confirmed - * @param emailCodeID ID of email OTP (required) - * @return EmailCodeGetRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains details of an email OTP -
0 Error -
- */ - public EmailCodeGetRsp emailCodeGet(String emailCodeID) throws ApiException { - ApiResponse localVarResp = emailCodeGetWithHttpInfo(emailCodeID); - return localVarResp.getData(); - } - - /** - * - * Get an email OTP only one time after confirmed - * @param emailCodeID ID of email OTP (required) - * @return ApiResponse<EmailCodeGetRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains details of an email OTP -
0 Error -
- */ - public ApiResponse emailCodeGetWithHttpInfo(String emailCodeID) throws ApiException { - okhttp3.Call localVarCall = emailCodeGetValidateBeforeCall(emailCodeID, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Get an email OTP only one time after confirmed - * @param emailCodeID ID of email OTP (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains details of an email OTP -
0 Error -
- */ - public okhttp3.Call emailCodeGetAsync(String emailCodeID, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = emailCodeGetValidateBeforeCall(emailCodeID, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for emailCodeSend - * @param emailCodeSendReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
- */ - public okhttp3.Call emailCodeSendCall(EmailCodeSendReq emailCodeSendReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = emailCodeSendReq; - - // create path and map variables - String localVarPath = "/v1/emailCodes"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call emailCodeSendValidateBeforeCall(EmailCodeSendReq emailCodeSendReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'emailCodeSendReq' is set - if (emailCodeSendReq == null) { - throw new ApiException("Missing the required parameter 'emailCodeSendReq' when calling emailCodeSend(Async)"); - } - - return emailCodeSendCall(emailCodeSendReq, _callback); - - } - - /** - * - * Creates email code and sends it to given email address - * @param emailCodeSendReq (required) - * @return EmailCodeSendRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
- */ - public EmailCodeSendRsp emailCodeSend(EmailCodeSendReq emailCodeSendReq) throws ApiException { - ApiResponse localVarResp = emailCodeSendWithHttpInfo(emailCodeSendReq); - return localVarResp.getData(); - } - - /** - * - * Creates email code and sends it to given email address - * @param emailCodeSendReq (required) - * @return ApiResponse<EmailCodeSendRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
- */ - public ApiResponse emailCodeSendWithHttpInfo(EmailCodeSendReq emailCodeSendReq) throws ApiException { - okhttp3.Call localVarCall = emailCodeSendValidateBeforeCall(emailCodeSendReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Creates email code and sends it to given email address - * @param emailCodeSendReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email successfully sent -
0 Error -
- */ - public okhttp3.Call emailCodeSendAsync(EmailCodeSendReq emailCodeSendReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = emailCodeSendValidateBeforeCall(emailCodeSendReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for emailCodeValidate - * @param emailCodeID ID of email OTP (required) - * @param emailCodeValidateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public okhttp3.Call emailCodeValidateCall(String emailCodeID, EmailCodeValidateReq emailCodeValidateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = emailCodeValidateReq; - - // create path and map variables - String localVarPath = "/v1/emailCodes/{emailCodeID}/validate" - .replace("{" + "emailCodeID" + "}", localVarApiClient.escapeString(emailCodeID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call emailCodeValidateValidateBeforeCall(String emailCodeID, EmailCodeValidateReq emailCodeValidateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'emailCodeID' is set - if (emailCodeID == null) { - throw new ApiException("Missing the required parameter 'emailCodeID' when calling emailCodeValidate(Async)"); - } - - // verify the required parameter 'emailCodeValidateReq' is set - if (emailCodeValidateReq == null) { - throw new ApiException("Missing the required parameter 'emailCodeValidateReq' when calling emailCodeValidate(Async)"); - } - - return emailCodeValidateCall(emailCodeID, emailCodeValidateReq, _callback); - - } - - /** - * - * Validates email code - * @param emailCodeID ID of email OTP (required) - * @param emailCodeValidateReq (required) - * @return EmailCodeValidateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public EmailCodeValidateRsp emailCodeValidate(String emailCodeID, EmailCodeValidateReq emailCodeValidateReq) throws ApiException { - ApiResponse localVarResp = emailCodeValidateWithHttpInfo(emailCodeID, emailCodeValidateReq); - return localVarResp.getData(); - } - - /** - * - * Validates email code - * @param emailCodeID ID of email OTP (required) - * @param emailCodeValidateReq (required) - * @return ApiResponse<EmailCodeValidateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public ApiResponse emailCodeValidateWithHttpInfo(String emailCodeID, EmailCodeValidateReq emailCodeValidateReq) throws ApiException { - okhttp3.Call localVarCall = emailCodeValidateValidateBeforeCall(emailCodeID, emailCodeValidateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Validates email code - * @param emailCodeID ID of email OTP (required) - * @param emailCodeValidateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public okhttp3.Call emailCodeValidateAsync(String emailCodeID, EmailCodeValidateReq emailCodeValidateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = emailCodeValidateValidateBeforeCall(emailCodeID, emailCodeValidateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/EmailTemplatesApi.java b/src/main/java/com/corbado/generated/api/EmailTemplatesApi.java deleted file mode 100644 index 359bbf9..0000000 --- a/src/main/java/com/corbado/generated/api/EmailTemplatesApi.java +++ /dev/null @@ -1,343 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.EmailTemplateCreateReq; -import com.corbado.generated.model.EmailTemplateCreateRsp; -import com.corbado.generated.model.EmailTemplateDeleteReq; -import com.corbado.generated.model.ErrorRsp; -import com.corbado.generated.model.GenericRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class EmailTemplatesApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public EmailTemplatesApi() { - this(Configuration.getDefaultApiClient()); - } - - public EmailTemplatesApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for emailTemplateCreate - * @param emailTemplateCreateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email template successfully created -
0 Error -
- */ - public okhttp3.Call emailTemplateCreateCall(EmailTemplateCreateReq emailTemplateCreateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = emailTemplateCreateReq; - - // create path and map variables - String localVarPath = "/v1/emailTemplates"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call emailTemplateCreateValidateBeforeCall(EmailTemplateCreateReq emailTemplateCreateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'emailTemplateCreateReq' is set - if (emailTemplateCreateReq == null) { - throw new ApiException("Missing the required parameter 'emailTemplateCreateReq' when calling emailTemplateCreate(Async)"); - } - - return emailTemplateCreateCall(emailTemplateCreateReq, _callback); - - } - - /** - * - * Creates a new email template - * @param emailTemplateCreateReq (required) - * @return EmailTemplateCreateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email template successfully created -
0 Error -
- */ - public EmailTemplateCreateRsp emailTemplateCreate(EmailTemplateCreateReq emailTemplateCreateReq) throws ApiException { - ApiResponse localVarResp = emailTemplateCreateWithHttpInfo(emailTemplateCreateReq); - return localVarResp.getData(); - } - - /** - * - * Creates a new email template - * @param emailTemplateCreateReq (required) - * @return ApiResponse<EmailTemplateCreateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email template successfully created -
0 Error -
- */ - public ApiResponse emailTemplateCreateWithHttpInfo(EmailTemplateCreateReq emailTemplateCreateReq) throws ApiException { - okhttp3.Call localVarCall = emailTemplateCreateValidateBeforeCall(emailTemplateCreateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Creates a new email template - * @param emailTemplateCreateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email template successfully created -
0 Error -
- */ - public okhttp3.Call emailTemplateCreateAsync(EmailTemplateCreateReq emailTemplateCreateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = emailTemplateCreateValidateBeforeCall(emailTemplateCreateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for emailTemplateDelete - * @param emailTemplateID ID of email template (required) - * @param emailTemplateDeleteReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call emailTemplateDeleteCall(String emailTemplateID, EmailTemplateDeleteReq emailTemplateDeleteReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = emailTemplateDeleteReq; - - // create path and map variables - String localVarPath = "/v1/emailTemplates/{emailTemplateID}" - .replace("{" + "emailTemplateID" + "}", localVarApiClient.escapeString(emailTemplateID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call emailTemplateDeleteValidateBeforeCall(String emailTemplateID, EmailTemplateDeleteReq emailTemplateDeleteReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'emailTemplateID' is set - if (emailTemplateID == null) { - throw new ApiException("Missing the required parameter 'emailTemplateID' when calling emailTemplateDelete(Async)"); - } - - // verify the required parameter 'emailTemplateDeleteReq' is set - if (emailTemplateDeleteReq == null) { - throw new ApiException("Missing the required parameter 'emailTemplateDeleteReq' when calling emailTemplateDelete(Async)"); - } - - return emailTemplateDeleteCall(emailTemplateID, emailTemplateDeleteReq, _callback); - - } - - /** - * - * Deletes an email template - * @param emailTemplateID ID of email template (required) - * @param emailTemplateDeleteReq (required) - * @return GenericRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public GenericRsp emailTemplateDelete(String emailTemplateID, EmailTemplateDeleteReq emailTemplateDeleteReq) throws ApiException { - ApiResponse localVarResp = emailTemplateDeleteWithHttpInfo(emailTemplateID, emailTemplateDeleteReq); - return localVarResp.getData(); - } - - /** - * - * Deletes an email template - * @param emailTemplateID ID of email template (required) - * @param emailTemplateDeleteReq (required) - * @return ApiResponse<GenericRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public ApiResponse emailTemplateDeleteWithHttpInfo(String emailTemplateID, EmailTemplateDeleteReq emailTemplateDeleteReq) throws ApiException { - okhttp3.Call localVarCall = emailTemplateDeleteValidateBeforeCall(emailTemplateID, emailTemplateDeleteReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Deletes an email template - * @param emailTemplateID ID of email template (required) - * @param emailTemplateDeleteReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call emailTemplateDeleteAsync(String emailTemplateID, EmailTemplateDeleteReq emailTemplateDeleteReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = emailTemplateDeleteValidateBeforeCall(emailTemplateID, emailTemplateDeleteReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/ExamplesApi.java b/src/main/java/com/corbado/generated/api/ExamplesApi.java deleted file mode 100644 index 3ccc8ef..0000000 --- a/src/main/java/com/corbado/generated/api/ExamplesApi.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.ErrorRsp; -import com.corbado.generated.model.ExampleGetRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class ExamplesApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public ExamplesApi() { - this(Configuration.getDefaultApiClient()); - } - - public ExamplesApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for exampleGet - * @param fileName Name of the example to get (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Example project successfully retrieved -
0 Error -
- */ - public okhttp3.Call exampleGetCall(String fileName, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/examples/{fileName}" - .replace("{" + "fileName" + "}", localVarApiClient.escapeString(fileName.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call exampleGetValidateBeforeCall(String fileName, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'fileName' is set - if (fileName == null) { - throw new ApiException("Missing the required parameter 'fileName' when calling exampleGet(Async)"); - } - - return exampleGetCall(fileName, _callback); - - } - - /** - * - * Retrieves file containing the named example project - * @param fileName Name of the example to get (required) - * @return ExampleGetRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Example project successfully retrieved -
0 Error -
- */ - public ExampleGetRsp exampleGet(String fileName) throws ApiException { - ApiResponse localVarResp = exampleGetWithHttpInfo(fileName); - return localVarResp.getData(); - } - - /** - * - * Retrieves file containing the named example project - * @param fileName Name of the example to get (required) - * @return ApiResponse<ExampleGetRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Example project successfully retrieved -
0 Error -
- */ - public ApiResponse exampleGetWithHttpInfo(String fileName) throws ApiException { - okhttp3.Call localVarCall = exampleGetValidateBeforeCall(fileName, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Retrieves file containing the named example project - * @param fileName Name of the example to get (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Example project successfully retrieved -
0 Error -
- */ - public okhttp3.Call exampleGetAsync(String fileName, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = exampleGetValidateBeforeCall(fileName, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/IOsAppConfigApi.java b/src/main/java/com/corbado/generated/api/IOsAppConfigApi.java deleted file mode 100644 index bc2681d..0000000 --- a/src/main/java/com/corbado/generated/api/IOsAppConfigApi.java +++ /dev/null @@ -1,590 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.ErrorRsp; -import com.corbado.generated.model.GenericRsp; -import com.corbado.generated.model.IOSAppConfigDeleteReq; -import com.corbado.generated.model.IOSAppConfigListRsp; -import com.corbado.generated.model.IOSAppConfigSaveReq; -import com.corbado.generated.model.IOSAppConfigSaveRsp; -import com.corbado.generated.model.IOSAppConfigUpdateReq; -import com.corbado.generated.model.IOSAppConfigUpdateRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class IOsAppConfigApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public IOsAppConfigApi() { - this(Configuration.getDefaultApiClient()); - } - - public IOsAppConfigApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for iOSAppConfigCreate - * @param ioSAppConfigSaveReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 iOS App successfully created -
0 Error -
- */ - public okhttp3.Call iOSAppConfigCreateCall(IOSAppConfigSaveReq ioSAppConfigSaveReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = ioSAppConfigSaveReq; - - // create path and map variables - String localVarPath = "/v1/iosappconfig"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call iOSAppConfigCreateValidateBeforeCall(IOSAppConfigSaveReq ioSAppConfigSaveReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'ioSAppConfigSaveReq' is set - if (ioSAppConfigSaveReq == null) { - throw new ApiException("Missing the required parameter 'ioSAppConfigSaveReq' when calling iOSAppConfigCreate(Async)"); - } - - return iOSAppConfigCreateCall(ioSAppConfigSaveReq, _callback); - - } - - /** - * - * Creates a new iOS App Config - * @param ioSAppConfigSaveReq (required) - * @return IOSAppConfigSaveRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 iOS App successfully created -
0 Error -
- */ - public IOSAppConfigSaveRsp iOSAppConfigCreate(IOSAppConfigSaveReq ioSAppConfigSaveReq) throws ApiException { - ApiResponse localVarResp = iOSAppConfigCreateWithHttpInfo(ioSAppConfigSaveReq); - return localVarResp.getData(); - } - - /** - * - * Creates a new iOS App Config - * @param ioSAppConfigSaveReq (required) - * @return ApiResponse<IOSAppConfigSaveRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 iOS App successfully created -
0 Error -
- */ - public ApiResponse iOSAppConfigCreateWithHttpInfo(IOSAppConfigSaveReq ioSAppConfigSaveReq) throws ApiException { - okhttp3.Call localVarCall = iOSAppConfigCreateValidateBeforeCall(ioSAppConfigSaveReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Creates a new iOS App Config - * @param ioSAppConfigSaveReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 iOS App successfully created -
0 Error -
- */ - public okhttp3.Call iOSAppConfigCreateAsync(IOSAppConfigSaveReq ioSAppConfigSaveReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = iOSAppConfigCreateValidateBeforeCall(ioSAppConfigSaveReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for iOSAppConfigDelete - * @param iosAppConfigID iOS App Config ID from create (required) - * @param ioSAppConfigDeleteReq (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call iOSAppConfigDeleteCall(String iosAppConfigID, IOSAppConfigDeleteReq ioSAppConfigDeleteReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = ioSAppConfigDeleteReq; - - // create path and map variables - String localVarPath = "/v1/iosappconfig/{iosAppConfigID}" - .replace("{" + "iosAppConfigID" + "}", localVarApiClient.escapeString(iosAppConfigID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call iOSAppConfigDeleteValidateBeforeCall(String iosAppConfigID, IOSAppConfigDeleteReq ioSAppConfigDeleteReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'iosAppConfigID' is set - if (iosAppConfigID == null) { - throw new ApiException("Missing the required parameter 'iosAppConfigID' when calling iOSAppConfigDelete(Async)"); - } - - return iOSAppConfigDeleteCall(iosAppConfigID, ioSAppConfigDeleteReq, _callback); - - } - - /** - * - * Deletes an iOS App Config - * @param iosAppConfigID iOS App Config ID from create (required) - * @param ioSAppConfigDeleteReq (optional) - * @return GenericRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public GenericRsp iOSAppConfigDelete(String iosAppConfigID, IOSAppConfigDeleteReq ioSAppConfigDeleteReq) throws ApiException { - ApiResponse localVarResp = iOSAppConfigDeleteWithHttpInfo(iosAppConfigID, ioSAppConfigDeleteReq); - return localVarResp.getData(); - } - - /** - * - * Deletes an iOS App Config - * @param iosAppConfigID iOS App Config ID from create (required) - * @param ioSAppConfigDeleteReq (optional) - * @return ApiResponse<GenericRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public ApiResponse iOSAppConfigDeleteWithHttpInfo(String iosAppConfigID, IOSAppConfigDeleteReq ioSAppConfigDeleteReq) throws ApiException { - okhttp3.Call localVarCall = iOSAppConfigDeleteValidateBeforeCall(iosAppConfigID, ioSAppConfigDeleteReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Deletes an iOS App Config - * @param iosAppConfigID iOS App Config ID from create (required) - * @param ioSAppConfigDeleteReq (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call iOSAppConfigDeleteAsync(String iosAppConfigID, IOSAppConfigDeleteReq ioSAppConfigDeleteReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = iOSAppConfigDeleteValidateBeforeCall(iosAppConfigID, ioSAppConfigDeleteReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for iOSAppConfigGet - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 iOS App Config List successfully retrieved -
0 Error -
- */ - public okhttp3.Call iOSAppConfigGetCall(final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/iosappconfig"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call iOSAppConfigGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return iOSAppConfigGetCall(_callback); - - } - - /** - * - * Lists iOS App Configs for a project - * @return IOSAppConfigListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 iOS App Config List successfully retrieved -
0 Error -
- */ - public IOSAppConfigListRsp iOSAppConfigGet() throws ApiException { - ApiResponse localVarResp = iOSAppConfigGetWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * - * Lists iOS App Configs for a project - * @return ApiResponse<IOSAppConfigListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 iOS App Config List successfully retrieved -
0 Error -
- */ - public ApiResponse iOSAppConfigGetWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = iOSAppConfigGetValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Lists iOS App Configs for a project - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 iOS App Config List successfully retrieved -
0 Error -
- */ - public okhttp3.Call iOSAppConfigGetAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = iOSAppConfigGetValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for iOSAppConfigPut - * @param iosAppConfigID ID from iOS config create (required) - * @param ioSAppConfigUpdateReq (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains iOS app config -
0 Error -
- */ - public okhttp3.Call iOSAppConfigPutCall(String iosAppConfigID, IOSAppConfigUpdateReq ioSAppConfigUpdateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = ioSAppConfigUpdateReq; - - // create path and map variables - String localVarPath = "/v1/iosappconfig/{iosAppConfigID}" - .replace("{" + "iosAppConfigID" + "}", localVarApiClient.escapeString(iosAppConfigID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call iOSAppConfigPutValidateBeforeCall(String iosAppConfigID, IOSAppConfigUpdateReq ioSAppConfigUpdateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'iosAppConfigID' is set - if (iosAppConfigID == null) { - throw new ApiException("Missing the required parameter 'iosAppConfigID' when calling iOSAppConfigPut(Async)"); - } - - return iOSAppConfigPutCall(iosAppConfigID, ioSAppConfigUpdateReq, _callback); - - } - - /** - * - * Updates an iOS app config by id - * @param iosAppConfigID ID from iOS config create (required) - * @param ioSAppConfigUpdateReq (optional) - * @return IOSAppConfigUpdateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains iOS app config -
0 Error -
- */ - public IOSAppConfigUpdateRsp iOSAppConfigPut(String iosAppConfigID, IOSAppConfigUpdateReq ioSAppConfigUpdateReq) throws ApiException { - ApiResponse localVarResp = iOSAppConfigPutWithHttpInfo(iosAppConfigID, ioSAppConfigUpdateReq); - return localVarResp.getData(); - } - - /** - * - * Updates an iOS app config by id - * @param iosAppConfigID ID from iOS config create (required) - * @param ioSAppConfigUpdateReq (optional) - * @return ApiResponse<IOSAppConfigUpdateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains iOS app config -
0 Error -
- */ - public ApiResponse iOSAppConfigPutWithHttpInfo(String iosAppConfigID, IOSAppConfigUpdateReq ioSAppConfigUpdateReq) throws ApiException { - okhttp3.Call localVarCall = iOSAppConfigPutValidateBeforeCall(iosAppConfigID, ioSAppConfigUpdateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Updates an iOS app config by id - * @param iosAppConfigID ID from iOS config create (required) - * @param ioSAppConfigUpdateReq (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains iOS app config -
0 Error -
- */ - public okhttp3.Call iOSAppConfigPutAsync(String iosAppConfigID, IOSAppConfigUpdateReq ioSAppConfigUpdateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = iOSAppConfigPutValidateBeforeCall(iosAppConfigID, ioSAppConfigUpdateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/IdentifiersApi.java b/src/main/java/com/corbado/generated/api/IdentifiersApi.java new file mode 100644 index 0000000..9922a08 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/IdentifiersApi.java @@ -0,0 +1,640 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.GenericRsp; +import com.corbado.generated.model.Identifier; +import com.corbado.generated.model.IdentifierCreateReq; +import com.corbado.generated.model.IdentifierList; +import com.corbado.generated.model.IdentifierUpdateReq; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class IdentifiersApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public IdentifiersApi() { + this(Configuration.getDefaultApiClient()); + } + + public IdentifiersApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for identifierCreate + * @param userID ID of user (required) + * @param identifierCreateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Identifier has been created -
0 Error -
+ */ + public okhttp3.Call identifierCreateCall(String userID, IdentifierCreateReq identifierCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = identifierCreateReq; + + // create path and map variables + String localVarPath = "/users/{userID}/identifiers" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call identifierCreateValidateBeforeCall(String userID, IdentifierCreateReq identifierCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling identifierCreate(Async)"); + } + + return identifierCreateCall(userID, identifierCreateReq, _callback); + + } + + /** + * + * Create a new login identifier + * @param userID ID of user (required) + * @param identifierCreateReq (optional) + * @return Identifier + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Identifier has been created -
0 Error -
+ */ + public Identifier identifierCreate(String userID, IdentifierCreateReq identifierCreateReq) throws ApiException { + ApiResponse localVarResp = identifierCreateWithHttpInfo(userID, identifierCreateReq); + return localVarResp.getData(); + } + + /** + * + * Create a new login identifier + * @param userID ID of user (required) + * @param identifierCreateReq (optional) + * @return ApiResponse<Identifier> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Identifier has been created -
0 Error -
+ */ + public ApiResponse identifierCreateWithHttpInfo(String userID, IdentifierCreateReq identifierCreateReq) throws ApiException { + okhttp3.Call localVarCall = identifierCreateValidateBeforeCall(userID, identifierCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Create a new login identifier + * @param userID ID of user (required) + * @param identifierCreateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Identifier has been created -
0 Error -
+ */ + public okhttp3.Call identifierCreateAsync(String userID, IdentifierCreateReq identifierCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = identifierCreateValidateBeforeCall(userID, identifierCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for identifierDelete + * @param userID ID of user (required) + * @param identifierID ID of login identifier (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call identifierDeleteCall(String userID, String identifierID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/users/{userID}/identifiers/{identifierID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "identifierID" + "}", localVarApiClient.escapeString(identifierID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call identifierDeleteValidateBeforeCall(String userID, String identifierID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling identifierDelete(Async)"); + } + + // verify the required parameter 'identifierID' is set + if (identifierID == null) { + throw new ApiException("Missing the required parameter 'identifierID' when calling identifierDelete(Async)"); + } + + return identifierDeleteCall(userID, identifierID, _callback); + + } + + /** + * + * Delete an existing login identifier + * @param userID ID of user (required) + * @param identifierID ID of login identifier (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp identifierDelete(String userID, String identifierID) throws ApiException { + ApiResponse localVarResp = identifierDeleteWithHttpInfo(userID, identifierID); + return localVarResp.getData(); + } + + /** + * + * Delete an existing login identifier + * @param userID ID of user (required) + * @param identifierID ID of login identifier (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse identifierDeleteWithHttpInfo(String userID, String identifierID) throws ApiException { + okhttp3.Call localVarCall = identifierDeleteValidateBeforeCall(userID, identifierID, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Delete an existing login identifier + * @param userID ID of user (required) + * @param identifierID ID of login identifier (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call identifierDeleteAsync(String userID, String identifierID, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = identifierDeleteValidateBeforeCall(userID, identifierID, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for identifierList + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching identifiers -
0 Error -
+ */ + public okhttp3.Call identifierListCall(String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/identifiers"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call identifierListValidateBeforeCall(String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + return identifierListCall(sort, filter, page, pageSize, _callback); + + } + + /** + * + * Returns a list of matching identifiers + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return IdentifierList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching identifiers -
0 Error -
+ */ + public IdentifierList identifierList(String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = identifierListWithHttpInfo(sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Returns a list of matching identifiers + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<IdentifierList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching identifiers -
0 Error -
+ */ + public ApiResponse identifierListWithHttpInfo(String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = identifierListValidateBeforeCall(sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Returns a list of matching identifiers + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching identifiers -
0 Error -
+ */ + public okhttp3.Call identifierListAsync(String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = identifierListValidateBeforeCall(sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for identifierUpdate + * @param userID ID of user (required) + * @param identifierID ID of login identifier (required) + * @param identifierUpdateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Identifier has been updated -
0 Error -
+ */ + public okhttp3.Call identifierUpdateCall(String userID, String identifierID, IdentifierUpdateReq identifierUpdateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = identifierUpdateReq; + + // create path and map variables + String localVarPath = "/users/{userID}/identifiers/{identifierID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "identifierID" + "}", localVarApiClient.escapeString(identifierID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call identifierUpdateValidateBeforeCall(String userID, String identifierID, IdentifierUpdateReq identifierUpdateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling identifierUpdate(Async)"); + } + + // verify the required parameter 'identifierID' is set + if (identifierID == null) { + throw new ApiException("Missing the required parameter 'identifierID' when calling identifierUpdate(Async)"); + } + + return identifierUpdateCall(userID, identifierID, identifierUpdateReq, _callback); + + } + + /** + * + * Updates a login identifier (e.g. from pending to verified) + * @param userID ID of user (required) + * @param identifierID ID of login identifier (required) + * @param identifierUpdateReq (optional) + * @return Identifier + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Identifier has been updated -
0 Error -
+ */ + public Identifier identifierUpdate(String userID, String identifierID, IdentifierUpdateReq identifierUpdateReq) throws ApiException { + ApiResponse localVarResp = identifierUpdateWithHttpInfo(userID, identifierID, identifierUpdateReq); + return localVarResp.getData(); + } + + /** + * + * Updates a login identifier (e.g. from pending to verified) + * @param userID ID of user (required) + * @param identifierID ID of login identifier (required) + * @param identifierUpdateReq (optional) + * @return ApiResponse<Identifier> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Identifier has been updated -
0 Error -
+ */ + public ApiResponse identifierUpdateWithHttpInfo(String userID, String identifierID, IdentifierUpdateReq identifierUpdateReq) throws ApiException { + okhttp3.Call localVarCall = identifierUpdateValidateBeforeCall(userID, identifierID, identifierUpdateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Updates a login identifier (e.g. from pending to verified) + * @param userID ID of user (required) + * @param identifierID ID of login identifier (required) + * @param identifierUpdateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Identifier has been updated -
0 Error -
+ */ + public okhttp3.Call identifierUpdateAsync(String userID, String identifierID, IdentifierUpdateReq identifierUpdateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = identifierUpdateValidateBeforeCall(userID, identifierID, identifierUpdateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/LongSessionsApi.java b/src/main/java/com/corbado/generated/api/LongSessionsApi.java deleted file mode 100644 index b0062de..0000000 --- a/src/main/java/com/corbado/generated/api/LongSessionsApi.java +++ /dev/null @@ -1,499 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.ErrorRsp; -import com.corbado.generated.model.GenericRsp; -import com.corbado.generated.model.LongSessionGetRsp; -import com.corbado.generated.model.LongSessionListRsp; -import com.corbado.generated.model.LongSessionRevokeReq; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class LongSessionsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public LongSessionsApi() { - this(Configuration.getDefaultApiClient()); - } - - public LongSessionsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for longSessionGet - * @param sessionID ID of session (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains details of a long session -
0 Error -
- */ - public okhttp3.Call longSessionGetCall(String sessionID, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/longSessions/{sessionID}" - .replace("{" + "sessionID" + "}", localVarApiClient.escapeString(sessionID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call longSessionGetValidateBeforeCall(String sessionID, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sessionID' is set - if (sessionID == null) { - throw new ApiException("Missing the required parameter 'sessionID' when calling longSessionGet(Async)"); - } - - return longSessionGetCall(sessionID, _callback); - - } - - /** - * - * Get a long session by sessionID - * @param sessionID ID of session (required) - * @return LongSessionGetRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains details of a long session -
0 Error -
- */ - public LongSessionGetRsp longSessionGet(String sessionID) throws ApiException { - ApiResponse localVarResp = longSessionGetWithHttpInfo(sessionID); - return localVarResp.getData(); - } - - /** - * - * Get a long session by sessionID - * @param sessionID ID of session (required) - * @return ApiResponse<LongSessionGetRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains details of a long session -
0 Error -
- */ - public ApiResponse longSessionGetWithHttpInfo(String sessionID) throws ApiException { - okhttp3.Call localVarCall = longSessionGetValidateBeforeCall(sessionID, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Get a long session by sessionID - * @param sessionID ID of session (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains details of a long session -
0 Error -
- */ - public okhttp3.Call longSessionGetAsync(String sessionID, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = longSessionGetValidateBeforeCall(sessionID, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for longSessionList - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of long sessions -
- */ - public okhttp3.Call longSessionListCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/longSessions"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call longSessionListValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - return longSessionListCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Lists long sessions by provided filters - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return LongSessionListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of long sessions -
- */ - public LongSessionListRsp longSessionList(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = longSessionListWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Lists long sessions by provided filters - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<LongSessionListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of long sessions -
- */ - public ApiResponse longSessionListWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = longSessionListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Lists long sessions by provided filters - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of long sessions -
- */ - public okhttp3.Call longSessionListAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = longSessionListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for longSessionRevoke - * @param sessionID ID of session (required) - * @param longSessionRevokeReq (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call longSessionRevokeCall(String sessionID, LongSessionRevokeReq longSessionRevokeReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = longSessionRevokeReq; - - // create path and map variables - String localVarPath = "/v1/longSessions/{sessionID}/revoke" - .replace("{" + "sessionID" + "}", localVarApiClient.escapeString(sessionID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call longSessionRevokeValidateBeforeCall(String sessionID, LongSessionRevokeReq longSessionRevokeReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sessionID' is set - if (sessionID == null) { - throw new ApiException("Missing the required parameter 'sessionID' when calling longSessionRevoke(Async)"); - } - - return longSessionRevokeCall(sessionID, longSessionRevokeReq, _callback); - - } - - /** - * - * Revokes an active long session by sessionID - * @param sessionID ID of session (required) - * @param longSessionRevokeReq (optional) - * @return GenericRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public GenericRsp longSessionRevoke(String sessionID, LongSessionRevokeReq longSessionRevokeReq) throws ApiException { - ApiResponse localVarResp = longSessionRevokeWithHttpInfo(sessionID, longSessionRevokeReq); - return localVarResp.getData(); - } - - /** - * - * Revokes an active long session by sessionID - * @param sessionID ID of session (required) - * @param longSessionRevokeReq (optional) - * @return ApiResponse<GenericRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public ApiResponse longSessionRevokeWithHttpInfo(String sessionID, LongSessionRevokeReq longSessionRevokeReq) throws ApiException { - okhttp3.Call localVarCall = longSessionRevokeValidateBeforeCall(sessionID, longSessionRevokeReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Revokes an active long session by sessionID - * @param sessionID ID of session (required) - * @param longSessionRevokeReq (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call longSessionRevokeAsync(String sessionID, LongSessionRevokeReq longSessionRevokeReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = longSessionRevokeValidateBeforeCall(sessionID, longSessionRevokeReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/PasskeyEventsApi.java b/src/main/java/com/corbado/generated/api/PasskeyEventsApi.java new file mode 100644 index 0000000..2d4b519 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/PasskeyEventsApi.java @@ -0,0 +1,369 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.PasskeyEvent; +import com.corbado.generated.model.PasskeyEventCreateReq; +import com.corbado.generated.model.PasskeyEventList; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PasskeyEventsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PasskeyEventsApi() { + this(Configuration.getDefaultApiClient()); + } + + public PasskeyEventsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for passkeyEventCreate + * @param userID ID of user (required) + * @param passkeyEventCreateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey event has been created -
0 Error -
+ */ + public okhttp3.Call passkeyEventCreateCall(String userID, PasskeyEventCreateReq passkeyEventCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = passkeyEventCreateReq; + + // create path and map variables + String localVarPath = "/users/{userID}/passkeyEvents" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passkeyEventCreateValidateBeforeCall(String userID, PasskeyEventCreateReq passkeyEventCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling passkeyEventCreate(Async)"); + } + + return passkeyEventCreateCall(userID, passkeyEventCreateReq, _callback); + + } + + /** + * + * Create a new passkey event for a user + * @param userID ID of user (required) + * @param passkeyEventCreateReq (optional) + * @return PasskeyEvent + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey event has been created -
0 Error -
+ */ + public PasskeyEvent passkeyEventCreate(String userID, PasskeyEventCreateReq passkeyEventCreateReq) throws ApiException { + ApiResponse localVarResp = passkeyEventCreateWithHttpInfo(userID, passkeyEventCreateReq); + return localVarResp.getData(); + } + + /** + * + * Create a new passkey event for a user + * @param userID ID of user (required) + * @param passkeyEventCreateReq (optional) + * @return ApiResponse<PasskeyEvent> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey event has been created -
0 Error -
+ */ + public ApiResponse passkeyEventCreateWithHttpInfo(String userID, PasskeyEventCreateReq passkeyEventCreateReq) throws ApiException { + okhttp3.Call localVarCall = passkeyEventCreateValidateBeforeCall(userID, passkeyEventCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Create a new passkey event for a user + * @param userID ID of user (required) + * @param passkeyEventCreateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey event has been created -
0 Error -
+ */ + public okhttp3.Call passkeyEventCreateAsync(String userID, PasskeyEventCreateReq passkeyEventCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = passkeyEventCreateValidateBeforeCall(userID, passkeyEventCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passkeyEventList + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching passkey events -
0 Error -
+ */ + public okhttp3.Call passkeyEventListCall(String userID, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/users/{userID}/passkeyEvents" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passkeyEventListValidateBeforeCall(String userID, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling passkeyEventList(Async)"); + } + + return passkeyEventListCall(userID, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Returns a list of matching passkey events + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return PasskeyEventList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching passkey events -
0 Error -
+ */ + public PasskeyEventList passkeyEventList(String userID, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = passkeyEventListWithHttpInfo(userID, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Returns a list of matching passkey events + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<PasskeyEventList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching passkey events -
0 Error -
+ */ + public ApiResponse passkeyEventListWithHttpInfo(String userID, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = passkeyEventListValidateBeforeCall(userID, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Returns a list of matching passkey events + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching passkey events -
0 Error -
+ */ + public okhttp3.Call passkeyEventListAsync(String userID, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = passkeyEventListValidateBeforeCall(userID, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/PasskeysApi.java b/src/main/java/com/corbado/generated/api/PasskeysApi.java new file mode 100644 index 0000000..e83aaf5 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/PasskeysApi.java @@ -0,0 +1,819 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.PasskeyAppendFinishReq; +import com.corbado.generated.model.PasskeyAppendFinishRsp; +import com.corbado.generated.model.PasskeyAppendStartReq; +import com.corbado.generated.model.PasskeyAppendStartRsp; +import com.corbado.generated.model.PasskeyLoginFinishReq; +import com.corbado.generated.model.PasskeyLoginFinishRsp; +import com.corbado.generated.model.PasskeyLoginStartReq; +import com.corbado.generated.model.PasskeyLoginStartRsp; +import com.corbado.generated.model.PasskeyMediationFinishReq; +import com.corbado.generated.model.PasskeyMediationFinishRsp; +import com.corbado.generated.model.PasskeyMediationStartReq; +import com.corbado.generated.model.PasskeyMediationStartRsp; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PasskeysApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PasskeysApi() { + this(Configuration.getDefaultApiClient()); + } + + public PasskeysApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for passkeyAppendFinish + * @param passkeyAppendFinishReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey append succeeded -
0 Error -
+ */ + public okhttp3.Call passkeyAppendFinishCall(PasskeyAppendFinishReq passkeyAppendFinishReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = passkeyAppendFinishReq; + + // create path and map variables + String localVarPath = "/passkey/append/finish"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passkeyAppendFinishValidateBeforeCall(PasskeyAppendFinishReq passkeyAppendFinishReq, final ApiCallback _callback) throws ApiException { + return passkeyAppendFinishCall(passkeyAppendFinishReq, _callback); + + } + + /** + * + * Completes a challenge for creating a new passkey + * @param passkeyAppendFinishReq (optional) + * @return PasskeyAppendFinishRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey append succeeded -
0 Error -
+ */ + public PasskeyAppendFinishRsp passkeyAppendFinish(PasskeyAppendFinishReq passkeyAppendFinishReq) throws ApiException { + ApiResponse localVarResp = passkeyAppendFinishWithHttpInfo(passkeyAppendFinishReq); + return localVarResp.getData(); + } + + /** + * + * Completes a challenge for creating a new passkey + * @param passkeyAppendFinishReq (optional) + * @return ApiResponse<PasskeyAppendFinishRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey append succeeded -
0 Error -
+ */ + public ApiResponse passkeyAppendFinishWithHttpInfo(PasskeyAppendFinishReq passkeyAppendFinishReq) throws ApiException { + okhttp3.Call localVarCall = passkeyAppendFinishValidateBeforeCall(passkeyAppendFinishReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Completes a challenge for creating a new passkey + * @param passkeyAppendFinishReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey append succeeded -
0 Error -
+ */ + public okhttp3.Call passkeyAppendFinishAsync(PasskeyAppendFinishReq passkeyAppendFinishReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = passkeyAppendFinishValidateBeforeCall(passkeyAppendFinishReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passkeyAppendStart + * @param passkeyAppendStartReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey append challenge has been created -
0 Error -
+ */ + public okhttp3.Call passkeyAppendStartCall(PasskeyAppendStartReq passkeyAppendStartReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = passkeyAppendStartReq; + + // create path and map variables + String localVarPath = "/passkey/append/start"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passkeyAppendStartValidateBeforeCall(PasskeyAppendStartReq passkeyAppendStartReq, final ApiCallback _callback) throws ApiException { + return passkeyAppendStartCall(passkeyAppendStartReq, _callback); + + } + + /** + * + * Starts a challenge for creating a new passkey + * @param passkeyAppendStartReq (optional) + * @return PasskeyAppendStartRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey append challenge has been created -
0 Error -
+ */ + public PasskeyAppendStartRsp passkeyAppendStart(PasskeyAppendStartReq passkeyAppendStartReq) throws ApiException { + ApiResponse localVarResp = passkeyAppendStartWithHttpInfo(passkeyAppendStartReq); + return localVarResp.getData(); + } + + /** + * + * Starts a challenge for creating a new passkey + * @param passkeyAppendStartReq (optional) + * @return ApiResponse<PasskeyAppendStartRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey append challenge has been created -
0 Error -
+ */ + public ApiResponse passkeyAppendStartWithHttpInfo(PasskeyAppendStartReq passkeyAppendStartReq) throws ApiException { + okhttp3.Call localVarCall = passkeyAppendStartValidateBeforeCall(passkeyAppendStartReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Starts a challenge for creating a new passkey + * @param passkeyAppendStartReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey append challenge has been created -
0 Error -
+ */ + public okhttp3.Call passkeyAppendStartAsync(PasskeyAppendStartReq passkeyAppendStartReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = passkeyAppendStartValidateBeforeCall(passkeyAppendStartReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passkeyLoginFinish + * @param passkeyLoginFinishReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey login succeeded -
0 Error -
+ */ + public okhttp3.Call passkeyLoginFinishCall(PasskeyLoginFinishReq passkeyLoginFinishReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = passkeyLoginFinishReq; + + // create path and map variables + String localVarPath = "/passkey/login/finish"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passkeyLoginFinishValidateBeforeCall(PasskeyLoginFinishReq passkeyLoginFinishReq, final ApiCallback _callback) throws ApiException { + return passkeyLoginFinishCall(passkeyLoginFinishReq, _callback); + + } + + /** + * + * Completes a challenge for an existing passkey + * @param passkeyLoginFinishReq (optional) + * @return PasskeyLoginFinishRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey login succeeded -
0 Error -
+ */ + public PasskeyLoginFinishRsp passkeyLoginFinish(PasskeyLoginFinishReq passkeyLoginFinishReq) throws ApiException { + ApiResponse localVarResp = passkeyLoginFinishWithHttpInfo(passkeyLoginFinishReq); + return localVarResp.getData(); + } + + /** + * + * Completes a challenge for an existing passkey + * @param passkeyLoginFinishReq (optional) + * @return ApiResponse<PasskeyLoginFinishRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey login succeeded -
0 Error -
+ */ + public ApiResponse passkeyLoginFinishWithHttpInfo(PasskeyLoginFinishReq passkeyLoginFinishReq) throws ApiException { + okhttp3.Call localVarCall = passkeyLoginFinishValidateBeforeCall(passkeyLoginFinishReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Completes a challenge for an existing passkey + * @param passkeyLoginFinishReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey login succeeded -
0 Error -
+ */ + public okhttp3.Call passkeyLoginFinishAsync(PasskeyLoginFinishReq passkeyLoginFinishReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = passkeyLoginFinishValidateBeforeCall(passkeyLoginFinishReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passkeyLoginStart + * @param passkeyLoginStartReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+ */ + public okhttp3.Call passkeyLoginStartCall(PasskeyLoginStartReq passkeyLoginStartReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = passkeyLoginStartReq; + + // create path and map variables + String localVarPath = "/passkey/login/start"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passkeyLoginStartValidateBeforeCall(PasskeyLoginStartReq passkeyLoginStartReq, final ApiCallback _callback) throws ApiException { + return passkeyLoginStartCall(passkeyLoginStartReq, _callback); + + } + + /** + * + * Starts a challenge for an existing passkey + * @param passkeyLoginStartReq (optional) + * @return PasskeyLoginStartRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+ */ + public PasskeyLoginStartRsp passkeyLoginStart(PasskeyLoginStartReq passkeyLoginStartReq) throws ApiException { + ApiResponse localVarResp = passkeyLoginStartWithHttpInfo(passkeyLoginStartReq); + return localVarResp.getData(); + } + + /** + * + * Starts a challenge for an existing passkey + * @param passkeyLoginStartReq (optional) + * @return ApiResponse<PasskeyLoginStartRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+ */ + public ApiResponse passkeyLoginStartWithHttpInfo(PasskeyLoginStartReq passkeyLoginStartReq) throws ApiException { + okhttp3.Call localVarCall = passkeyLoginStartValidateBeforeCall(passkeyLoginStartReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Starts a challenge for an existing passkey + * @param passkeyLoginStartReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+ */ + public okhttp3.Call passkeyLoginStartAsync(PasskeyLoginStartReq passkeyLoginStartReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = passkeyLoginStartValidateBeforeCall(passkeyLoginStartReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passkeyMediationFinish + * @param passkeyMediationFinishReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey mediation has been success, thus we can return a userID -
0 Error -
+ */ + public okhttp3.Call passkeyMediationFinishCall(PasskeyMediationFinishReq passkeyMediationFinishReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = passkeyMediationFinishReq; + + // create path and map variables + String localVarPath = "/passkey/mediation/finish"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passkeyMediationFinishValidateBeforeCall(PasskeyMediationFinishReq passkeyMediationFinishReq, final ApiCallback _callback) throws ApiException { + return passkeyMediationFinishCall(passkeyMediationFinishReq, _callback); + + } + + /** + * + * Completes a challenge for an existing passkey (Conditional UI) + * @param passkeyMediationFinishReq (optional) + * @return PasskeyMediationFinishRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey mediation has been success, thus we can return a userID -
0 Error -
+ */ + public PasskeyMediationFinishRsp passkeyMediationFinish(PasskeyMediationFinishReq passkeyMediationFinishReq) throws ApiException { + ApiResponse localVarResp = passkeyMediationFinishWithHttpInfo(passkeyMediationFinishReq); + return localVarResp.getData(); + } + + /** + * + * Completes a challenge for an existing passkey (Conditional UI) + * @param passkeyMediationFinishReq (optional) + * @return ApiResponse<PasskeyMediationFinishRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey mediation has been success, thus we can return a userID -
0 Error -
+ */ + public ApiResponse passkeyMediationFinishWithHttpInfo(PasskeyMediationFinishReq passkeyMediationFinishReq) throws ApiException { + okhttp3.Call localVarCall = passkeyMediationFinishValidateBeforeCall(passkeyMediationFinishReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Completes a challenge for an existing passkey (Conditional UI) + * @param passkeyMediationFinishReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey mediation has been success, thus we can return a userID -
0 Error -
+ */ + public okhttp3.Call passkeyMediationFinishAsync(PasskeyMediationFinishReq passkeyMediationFinishReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = passkeyMediationFinishValidateBeforeCall(passkeyMediationFinishReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passkeyMediationStart + * @param passkeyMediationStartReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+ */ + public okhttp3.Call passkeyMediationStartCall(PasskeyMediationStartReq passkeyMediationStartReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = passkeyMediationStartReq; + + // create path and map variables + String localVarPath = "/passkey/mediation/start"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passkeyMediationStartValidateBeforeCall(PasskeyMediationStartReq passkeyMediationStartReq, final ApiCallback _callback) throws ApiException { + return passkeyMediationStartCall(passkeyMediationStartReq, _callback); + + } + + /** + * + * Starts a challenge for an existing passkey (Conditional UI) + * @param passkeyMediationStartReq (optional) + * @return PasskeyMediationStartRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+ */ + public PasskeyMediationStartRsp passkeyMediationStart(PasskeyMediationStartReq passkeyMediationStartReq) throws ApiException { + ApiResponse localVarResp = passkeyMediationStartWithHttpInfo(passkeyMediationStartReq); + return localVarResp.getData(); + } + + /** + * + * Starts a challenge for an existing passkey (Conditional UI) + * @param passkeyMediationStartReq (optional) + * @return ApiResponse<PasskeyMediationStartRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+ */ + public ApiResponse passkeyMediationStartWithHttpInfo(PasskeyMediationStartReq passkeyMediationStartReq) throws ApiException { + okhttp3.Call localVarCall = passkeyMediationStartValidateBeforeCall(passkeyMediationStartReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Starts a challenge for an existing passkey (Conditional UI) + * @param passkeyMediationStartReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey login challenge has been created -
0 Error -
+ */ + public okhttp3.Call passkeyMediationStartAsync(PasskeyMediationStartReq passkeyMediationStartReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = passkeyMediationStartValidateBeforeCall(passkeyMediationStartReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/PasskeysBiometricsApi.java b/src/main/java/com/corbado/generated/api/PasskeysBiometricsApi.java deleted file mode 100644 index 9f3fbf2..0000000 --- a/src/main/java/com/corbado/generated/api/PasskeysBiometricsApi.java +++ /dev/null @@ -1,2607 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.EmptyReq; -import com.corbado.generated.model.ErrorRsp; -import com.corbado.generated.model.GenericRsp; -import com.corbado.generated.model.WebAuthnAssociateStartReq; -import com.corbado.generated.model.WebAuthnAssociateStartRsp; -import com.corbado.generated.model.WebAuthnAuthenticateFinishRsp; -import com.corbado.generated.model.WebAuthnAuthenticateStartReq; -import com.corbado.generated.model.WebAuthnAuthenticateStartRsp; -import com.corbado.generated.model.WebAuthnAuthenticatorUpdateReq; -import com.corbado.generated.model.WebAuthnCredentialExistsReq; -import com.corbado.generated.model.WebAuthnCredentialExistsRsp; -import com.corbado.generated.model.WebAuthnCredentialListRsp; -import com.corbado.generated.model.WebAuthnCredentialReq; -import com.corbado.generated.model.WebAuthnCredentialRsp; -import com.corbado.generated.model.WebAuthnFinishReq; -import com.corbado.generated.model.WebAuthnMediationStartReq; -import com.corbado.generated.model.WebAuthnMediationStartRsp; -import com.corbado.generated.model.WebAuthnRegisterFinishRsp; -import com.corbado.generated.model.WebAuthnRegisterStartReq; -import com.corbado.generated.model.WebAuthnRegisterStartRsp; -import com.corbado.generated.model.WebauthnSettingCreateReq; -import com.corbado.generated.model.WebauthnSettingCreateRsp; -import com.corbado.generated.model.WebauthnSettingDeleteReq; -import com.corbado.generated.model.WebauthnSettingGetRsp; -import com.corbado.generated.model.WebauthnSettingListRsp; -import com.corbado.generated.model.WebauthnSettingUpdateReq; -import com.corbado.generated.model.WebauthnSettingUpdateRsp; -import com.corbado.generated.model.WebauthnStatsAuthenticatorRsp; -import com.corbado.generated.model.WebauthnStatsTypeRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class PasskeysBiometricsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public PasskeysBiometricsApi() { - this(Configuration.getDefaultApiClient()); - } - - public PasskeysBiometricsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for webAuthnAssociateStart - * @param webAuthnAssociateStartReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) association started successfully -
0 Error -
- */ - public okhttp3.Call webAuthnAssociateStartCall(WebAuthnAssociateStartReq webAuthnAssociateStartReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = webAuthnAssociateStartReq; - - // create path and map variables - String localVarPath = "/v1/webauthn/associate/start"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnAssociateStartValidateBeforeCall(WebAuthnAssociateStartReq webAuthnAssociateStartReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'webAuthnAssociateStartReq' is set - if (webAuthnAssociateStartReq == null) { - throw new ApiException("Missing the required parameter 'webAuthnAssociateStartReq' when calling webAuthnAssociateStart(Async)"); - } - - return webAuthnAssociateStartCall(webAuthnAssociateStartReq, _callback); - - } - - /** - * - * Starts association token flow for Passkeys (Biometrics) - * @param webAuthnAssociateStartReq (required) - * @return WebAuthnAssociateStartRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) association started successfully -
0 Error -
- */ - public WebAuthnAssociateStartRsp webAuthnAssociateStart(WebAuthnAssociateStartReq webAuthnAssociateStartReq) throws ApiException { - ApiResponse localVarResp = webAuthnAssociateStartWithHttpInfo(webAuthnAssociateStartReq); - return localVarResp.getData(); - } - - /** - * - * Starts association token flow for Passkeys (Biometrics) - * @param webAuthnAssociateStartReq (required) - * @return ApiResponse<WebAuthnAssociateStartRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) association started successfully -
0 Error -
- */ - public ApiResponse webAuthnAssociateStartWithHttpInfo(WebAuthnAssociateStartReq webAuthnAssociateStartReq) throws ApiException { - okhttp3.Call localVarCall = webAuthnAssociateStartValidateBeforeCall(webAuthnAssociateStartReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Starts association token flow for Passkeys (Biometrics) - * @param webAuthnAssociateStartReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) association started successfully -
0 Error -
- */ - public okhttp3.Call webAuthnAssociateStartAsync(WebAuthnAssociateStartReq webAuthnAssociateStartReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnAssociateStartValidateBeforeCall(webAuthnAssociateStartReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnAuthenticateFinish - * @param webAuthnFinishReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
- */ - public okhttp3.Call webAuthnAuthenticateFinishCall(WebAuthnFinishReq webAuthnFinishReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = webAuthnFinishReq; - - // create path and map variables - String localVarPath = "/v1/webauthn/authenticate/finish"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnAuthenticateFinishValidateBeforeCall(WebAuthnFinishReq webAuthnFinishReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'webAuthnFinishReq' is set - if (webAuthnFinishReq == null) { - throw new ApiException("Missing the required parameter 'webAuthnFinishReq' when calling webAuthnAuthenticateFinish(Async)"); - } - - return webAuthnAuthenticateFinishCall(webAuthnFinishReq, _callback); - - } - - /** - * - * Completes authentication of a user for Passkeys (Biometrics) - * @param webAuthnFinishReq (required) - * @return WebAuthnAuthenticateFinishRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
- */ - public WebAuthnAuthenticateFinishRsp webAuthnAuthenticateFinish(WebAuthnFinishReq webAuthnFinishReq) throws ApiException { - ApiResponse localVarResp = webAuthnAuthenticateFinishWithHttpInfo(webAuthnFinishReq); - return localVarResp.getData(); - } - - /** - * - * Completes authentication of a user for Passkeys (Biometrics) - * @param webAuthnFinishReq (required) - * @return ApiResponse<WebAuthnAuthenticateFinishRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
- */ - public ApiResponse webAuthnAuthenticateFinishWithHttpInfo(WebAuthnFinishReq webAuthnFinishReq) throws ApiException { - okhttp3.Call localVarCall = webAuthnAuthenticateFinishValidateBeforeCall(webAuthnFinishReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Completes authentication of a user for Passkeys (Biometrics) - * @param webAuthnFinishReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
- */ - public okhttp3.Call webAuthnAuthenticateFinishAsync(WebAuthnFinishReq webAuthnFinishReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnAuthenticateFinishValidateBeforeCall(webAuthnFinishReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnAuthenticateStart - * @param webAuthnAuthenticateStartReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
- */ - public okhttp3.Call webAuthnAuthenticateStartCall(WebAuthnAuthenticateStartReq webAuthnAuthenticateStartReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = webAuthnAuthenticateStartReq; - - // create path and map variables - String localVarPath = "/v1/webauthn/authenticate/start"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnAuthenticateStartValidateBeforeCall(WebAuthnAuthenticateStartReq webAuthnAuthenticateStartReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'webAuthnAuthenticateStartReq' is set - if (webAuthnAuthenticateStartReq == null) { - throw new ApiException("Missing the required parameter 'webAuthnAuthenticateStartReq' when calling webAuthnAuthenticateStart(Async)"); - } - - return webAuthnAuthenticateStartCall(webAuthnAuthenticateStartReq, _callback); - - } - - /** - * - * Starts authentication of a user for Passkeys (Biometrics) - * @param webAuthnAuthenticateStartReq (required) - * @return WebAuthnAuthenticateStartRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
- */ - public WebAuthnAuthenticateStartRsp webAuthnAuthenticateStart(WebAuthnAuthenticateStartReq webAuthnAuthenticateStartReq) throws ApiException { - ApiResponse localVarResp = webAuthnAuthenticateStartWithHttpInfo(webAuthnAuthenticateStartReq); - return localVarResp.getData(); - } - - /** - * - * Starts authentication of a user for Passkeys (Biometrics) - * @param webAuthnAuthenticateStartReq (required) - * @return ApiResponse<WebAuthnAuthenticateStartRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
- */ - public ApiResponse webAuthnAuthenticateStartWithHttpInfo(WebAuthnAuthenticateStartReq webAuthnAuthenticateStartReq) throws ApiException { - okhttp3.Call localVarCall = webAuthnAuthenticateStartValidateBeforeCall(webAuthnAuthenticateStartReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Starts authentication of a user for Passkeys (Biometrics) - * @param webAuthnAuthenticateStartReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
- */ - public okhttp3.Call webAuthnAuthenticateStartAsync(WebAuthnAuthenticateStartReq webAuthnAuthenticateStartReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnAuthenticateStartValidateBeforeCall(webAuthnAuthenticateStartReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnAuthenticatorUpdate - * @param authenticatorID ID of authenticator (required) - * @param webAuthnAuthenticatorUpdateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call webAuthnAuthenticatorUpdateCall(String authenticatorID, WebAuthnAuthenticatorUpdateReq webAuthnAuthenticatorUpdateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = webAuthnAuthenticatorUpdateReq; - - // create path and map variables - String localVarPath = "/v1/webauthn/authenticator/{authenticatorID}" - .replace("{" + "authenticatorID" + "}", localVarApiClient.escapeString(authenticatorID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnAuthenticatorUpdateValidateBeforeCall(String authenticatorID, WebAuthnAuthenticatorUpdateReq webAuthnAuthenticatorUpdateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'authenticatorID' is set - if (authenticatorID == null) { - throw new ApiException("Missing the required parameter 'authenticatorID' when calling webAuthnAuthenticatorUpdate(Async)"); - } - - // verify the required parameter 'webAuthnAuthenticatorUpdateReq' is set - if (webAuthnAuthenticatorUpdateReq == null) { - throw new ApiException("Missing the required parameter 'webAuthnAuthenticatorUpdateReq' when calling webAuthnAuthenticatorUpdate(Async)"); - } - - return webAuthnAuthenticatorUpdateCall(authenticatorID, webAuthnAuthenticatorUpdateReq, _callback); - - } - - /** - * - * Update authenticator - * @param authenticatorID ID of authenticator (required) - * @param webAuthnAuthenticatorUpdateReq (required) - * @return GenericRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public GenericRsp webAuthnAuthenticatorUpdate(String authenticatorID, WebAuthnAuthenticatorUpdateReq webAuthnAuthenticatorUpdateReq) throws ApiException { - ApiResponse localVarResp = webAuthnAuthenticatorUpdateWithHttpInfo(authenticatorID, webAuthnAuthenticatorUpdateReq); - return localVarResp.getData(); - } - - /** - * - * Update authenticator - * @param authenticatorID ID of authenticator (required) - * @param webAuthnAuthenticatorUpdateReq (required) - * @return ApiResponse<GenericRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public ApiResponse webAuthnAuthenticatorUpdateWithHttpInfo(String authenticatorID, WebAuthnAuthenticatorUpdateReq webAuthnAuthenticatorUpdateReq) throws ApiException { - okhttp3.Call localVarCall = webAuthnAuthenticatorUpdateValidateBeforeCall(authenticatorID, webAuthnAuthenticatorUpdateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Update authenticator - * @param authenticatorID ID of authenticator (required) - * @param webAuthnAuthenticatorUpdateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call webAuthnAuthenticatorUpdateAsync(String authenticatorID, WebAuthnAuthenticatorUpdateReq webAuthnAuthenticatorUpdateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnAuthenticatorUpdateValidateBeforeCall(authenticatorID, webAuthnAuthenticatorUpdateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnCredentialDelete - * @param userID ID of user (required) - * @param credentialID ID of credential (required) - * @param emptyReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call webAuthnCredentialDeleteCall(String userID, String credentialID, EmptyReq emptyReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = emptyReq; - - // create path and map variables - String localVarPath = "/v1/users/{userID}/credentials/{credentialID}" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) - .replace("{" + "credentialID" + "}", localVarApiClient.escapeString(credentialID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnCredentialDeleteValidateBeforeCall(String userID, String credentialID, EmptyReq emptyReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling webAuthnCredentialDelete(Async)"); - } - - // verify the required parameter 'credentialID' is set - if (credentialID == null) { - throw new ApiException("Missing the required parameter 'credentialID' when calling webAuthnCredentialDelete(Async)"); - } - - // verify the required parameter 'emptyReq' is set - if (emptyReq == null) { - throw new ApiException("Missing the required parameter 'emptyReq' when calling webAuthnCredentialDelete(Async)"); - } - - return webAuthnCredentialDeleteCall(userID, credentialID, emptyReq, _callback); - - } - - /** - * - * Delete credential - * @param userID ID of user (required) - * @param credentialID ID of credential (required) - * @param emptyReq (required) - * @return GenericRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public GenericRsp webAuthnCredentialDelete(String userID, String credentialID, EmptyReq emptyReq) throws ApiException { - ApiResponse localVarResp = webAuthnCredentialDeleteWithHttpInfo(userID, credentialID, emptyReq); - return localVarResp.getData(); - } - - /** - * - * Delete credential - * @param userID ID of user (required) - * @param credentialID ID of credential (required) - * @param emptyReq (required) - * @return ApiResponse<GenericRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public ApiResponse webAuthnCredentialDeleteWithHttpInfo(String userID, String credentialID, EmptyReq emptyReq) throws ApiException { - okhttp3.Call localVarCall = webAuthnCredentialDeleteValidateBeforeCall(userID, credentialID, emptyReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Delete credential - * @param userID ID of user (required) - * @param credentialID ID of credential (required) - * @param emptyReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call webAuthnCredentialDeleteAsync(String userID, String credentialID, EmptyReq emptyReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnCredentialDeleteValidateBeforeCall(userID, credentialID, emptyReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnCredentialExists - * @param webAuthnCredentialExistsReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) credentials check completed -
0 Error -
- */ - public okhttp3.Call webAuthnCredentialExistsCall(WebAuthnCredentialExistsReq webAuthnCredentialExistsReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = webAuthnCredentialExistsReq; - - // create path and map variables - String localVarPath = "/v1/webauthn/credential/exists"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnCredentialExistsValidateBeforeCall(WebAuthnCredentialExistsReq webAuthnCredentialExistsReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'webAuthnCredentialExistsReq' is set - if (webAuthnCredentialExistsReq == null) { - throw new ApiException("Missing the required parameter 'webAuthnCredentialExistsReq' when calling webAuthnCredentialExists(Async)"); - } - - return webAuthnCredentialExistsCall(webAuthnCredentialExistsReq, _callback); - - } - - /** - * - * Checks if active webauthn credential exists for provided user and device - * @param webAuthnCredentialExistsReq (required) - * @return WebAuthnCredentialExistsRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) credentials check completed -
0 Error -
- */ - public WebAuthnCredentialExistsRsp webAuthnCredentialExists(WebAuthnCredentialExistsReq webAuthnCredentialExistsReq) throws ApiException { - ApiResponse localVarResp = webAuthnCredentialExistsWithHttpInfo(webAuthnCredentialExistsReq); - return localVarResp.getData(); - } - - /** - * - * Checks if active webauthn credential exists for provided user and device - * @param webAuthnCredentialExistsReq (required) - * @return ApiResponse<WebAuthnCredentialExistsRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) credentials check completed -
0 Error -
- */ - public ApiResponse webAuthnCredentialExistsWithHttpInfo(WebAuthnCredentialExistsReq webAuthnCredentialExistsReq) throws ApiException { - okhttp3.Call localVarCall = webAuthnCredentialExistsValidateBeforeCall(webAuthnCredentialExistsReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Checks if active webauthn credential exists for provided user and device - * @param webAuthnCredentialExistsReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) credentials check completed -
0 Error -
- */ - public okhttp3.Call webAuthnCredentialExistsAsync(WebAuthnCredentialExistsReq webAuthnCredentialExistsReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnCredentialExistsValidateBeforeCall(webAuthnCredentialExistsReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnCredentialList - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Webauthn credential list successfully retrieved -
0 Error -
- */ - public okhttp3.Call webAuthnCredentialListCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/webauthn/credential"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnCredentialListValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - return webAuthnCredentialListCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Lists webauthn credentials users - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return WebAuthnCredentialListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Webauthn credential list successfully retrieved -
0 Error -
- */ - public WebAuthnCredentialListRsp webAuthnCredentialList(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = webAuthnCredentialListWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Lists webauthn credentials users - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<WebAuthnCredentialListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Webauthn credential list successfully retrieved -
0 Error -
- */ - public ApiResponse webAuthnCredentialListWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = webAuthnCredentialListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Lists webauthn credentials users - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Webauthn credential list successfully retrieved -
0 Error -
- */ - public okhttp3.Call webAuthnCredentialListAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnCredentialListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnCredentialUpdate - * @param credentialID ID of credential (required) - * @param webAuthnCredentialReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
- */ - public okhttp3.Call webAuthnCredentialUpdateCall(String credentialID, WebAuthnCredentialReq webAuthnCredentialReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = webAuthnCredentialReq; - - // create path and map variables - String localVarPath = "/v1/webauthn/credential/{credentialID}" - .replace("{" + "credentialID" + "}", localVarApiClient.escapeString(credentialID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnCredentialUpdateValidateBeforeCall(String credentialID, WebAuthnCredentialReq webAuthnCredentialReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'credentialID' is set - if (credentialID == null) { - throw new ApiException("Missing the required parameter 'credentialID' when calling webAuthnCredentialUpdate(Async)"); - } - - // verify the required parameter 'webAuthnCredentialReq' is set - if (webAuthnCredentialReq == null) { - throw new ApiException("Missing the required parameter 'webAuthnCredentialReq' when calling webAuthnCredentialUpdate(Async)"); - } - - return webAuthnCredentialUpdateCall(credentialID, webAuthnCredentialReq, _callback); - - } - - /** - * - * Update credential - * @param credentialID ID of credential (required) - * @param webAuthnCredentialReq (required) - * @return WebAuthnCredentialRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
- */ - public WebAuthnCredentialRsp webAuthnCredentialUpdate(String credentialID, WebAuthnCredentialReq webAuthnCredentialReq) throws ApiException { - ApiResponse localVarResp = webAuthnCredentialUpdateWithHttpInfo(credentialID, webAuthnCredentialReq); - return localVarResp.getData(); - } - - /** - * - * Update credential - * @param credentialID ID of credential (required) - * @param webAuthnCredentialReq (required) - * @return ApiResponse<WebAuthnCredentialRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
- */ - public ApiResponse webAuthnCredentialUpdateWithHttpInfo(String credentialID, WebAuthnCredentialReq webAuthnCredentialReq) throws ApiException { - okhttp3.Call localVarCall = webAuthnCredentialUpdateValidateBeforeCall(credentialID, webAuthnCredentialReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Update credential - * @param credentialID ID of credential (required) - * @param webAuthnCredentialReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication started successfully -
0 Error -
- */ - public okhttp3.Call webAuthnCredentialUpdateAsync(String credentialID, WebAuthnCredentialReq webAuthnCredentialReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnCredentialUpdateValidateBeforeCall(credentialID, webAuthnCredentialReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnMediationStart - * @param webAuthnMediationStartReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) mediation started successfully -
0 Error -
- */ - public okhttp3.Call webAuthnMediationStartCall(WebAuthnMediationStartReq webAuthnMediationStartReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = webAuthnMediationStartReq; - - // create path and map variables - String localVarPath = "/v1/webauthn/mediation/start"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnMediationStartValidateBeforeCall(WebAuthnMediationStartReq webAuthnMediationStartReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'webAuthnMediationStartReq' is set - if (webAuthnMediationStartReq == null) { - throw new ApiException("Missing the required parameter 'webAuthnMediationStartReq' when calling webAuthnMediationStart(Async)"); - } - - return webAuthnMediationStartCall(webAuthnMediationStartReq, _callback); - - } - - /** - * - * Starts mediation for Passkeys (Biometrics) - * @param webAuthnMediationStartReq (required) - * @return WebAuthnMediationStartRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) mediation started successfully -
0 Error -
- */ - public WebAuthnMediationStartRsp webAuthnMediationStart(WebAuthnMediationStartReq webAuthnMediationStartReq) throws ApiException { - ApiResponse localVarResp = webAuthnMediationStartWithHttpInfo(webAuthnMediationStartReq); - return localVarResp.getData(); - } - - /** - * - * Starts mediation for Passkeys (Biometrics) - * @param webAuthnMediationStartReq (required) - * @return ApiResponse<WebAuthnMediationStartRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) mediation started successfully -
0 Error -
- */ - public ApiResponse webAuthnMediationStartWithHttpInfo(WebAuthnMediationStartReq webAuthnMediationStartReq) throws ApiException { - okhttp3.Call localVarCall = webAuthnMediationStartValidateBeforeCall(webAuthnMediationStartReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Starts mediation for Passkeys (Biometrics) - * @param webAuthnMediationStartReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) mediation started successfully -
0 Error -
- */ - public okhttp3.Call webAuthnMediationStartAsync(WebAuthnMediationStartReq webAuthnMediationStartReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnMediationStartValidateBeforeCall(webAuthnMediationStartReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnRegisterFinish - * @param webAuthnFinishReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
- */ - public okhttp3.Call webAuthnRegisterFinishCall(WebAuthnFinishReq webAuthnFinishReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = webAuthnFinishReq; - - // create path and map variables - String localVarPath = "/v1/webauthn/register/finish"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnRegisterFinishValidateBeforeCall(WebAuthnFinishReq webAuthnFinishReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'webAuthnFinishReq' is set - if (webAuthnFinishReq == null) { - throw new ApiException("Missing the required parameter 'webAuthnFinishReq' when calling webAuthnRegisterFinish(Async)"); - } - - return webAuthnRegisterFinishCall(webAuthnFinishReq, _callback); - - } - - /** - * - * Completes registration of a user for Passkeys (Biometrics) - * @param webAuthnFinishReq (required) - * @return WebAuthnRegisterFinishRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
- */ - public WebAuthnRegisterFinishRsp webAuthnRegisterFinish(WebAuthnFinishReq webAuthnFinishReq) throws ApiException { - ApiResponse localVarResp = webAuthnRegisterFinishWithHttpInfo(webAuthnFinishReq); - return localVarResp.getData(); - } - - /** - * - * Completes registration of a user for Passkeys (Biometrics) - * @param webAuthnFinishReq (required) - * @return ApiResponse<WebAuthnRegisterFinishRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
- */ - public ApiResponse webAuthnRegisterFinishWithHttpInfo(WebAuthnFinishReq webAuthnFinishReq) throws ApiException { - okhttp3.Call localVarCall = webAuthnRegisterFinishValidateBeforeCall(webAuthnFinishReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Completes registration of a user for Passkeys (Biometrics) - * @param webAuthnFinishReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) authentication finished successfully -
0 Error -
- */ - public okhttp3.Call webAuthnRegisterFinishAsync(WebAuthnFinishReq webAuthnFinishReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnRegisterFinishValidateBeforeCall(webAuthnFinishReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnRegisterStart - * @param webAuthnRegisterStartReq (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) registration initiated successfully -
0 Error -
- */ - public okhttp3.Call webAuthnRegisterStartCall(WebAuthnRegisterStartReq webAuthnRegisterStartReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = webAuthnRegisterStartReq; - - // create path and map variables - String localVarPath = "/v1/webauthn/register/start"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnRegisterStartValidateBeforeCall(WebAuthnRegisterStartReq webAuthnRegisterStartReq, final ApiCallback _callback) throws ApiException { - return webAuthnRegisterStartCall(webAuthnRegisterStartReq, _callback); - - } - - /** - * - * Starts registration of a user for Passkeys (Biometrics) - * @param webAuthnRegisterStartReq (optional) - * @return WebAuthnRegisterStartRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) registration initiated successfully -
0 Error -
- */ - public WebAuthnRegisterStartRsp webAuthnRegisterStart(WebAuthnRegisterStartReq webAuthnRegisterStartReq) throws ApiException { - ApiResponse localVarResp = webAuthnRegisterStartWithHttpInfo(webAuthnRegisterStartReq); - return localVarResp.getData(); - } - - /** - * - * Starts registration of a user for Passkeys (Biometrics) - * @param webAuthnRegisterStartReq (optional) - * @return ApiResponse<WebAuthnRegisterStartRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) registration initiated successfully -
0 Error -
- */ - public ApiResponse webAuthnRegisterStartWithHttpInfo(WebAuthnRegisterStartReq webAuthnRegisterStartReq) throws ApiException { - okhttp3.Call localVarCall = webAuthnRegisterStartValidateBeforeCall(webAuthnRegisterStartReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Starts registration of a user for Passkeys (Biometrics) - * @param webAuthnRegisterStartReq (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) registration initiated successfully -
0 Error -
- */ - public okhttp3.Call webAuthnRegisterStartAsync(WebAuthnRegisterStartReq webAuthnRegisterStartReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnRegisterStartValidateBeforeCall(webAuthnRegisterStartReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnSettingCreate - * @param webauthnSettingCreateReq (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) setting successfully created -
0 Error -
- */ - public okhttp3.Call webAuthnSettingCreateCall(WebauthnSettingCreateReq webauthnSettingCreateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = webauthnSettingCreateReq; - - // create path and map variables - String localVarPath = "/v1/webauthn/settings"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnSettingCreateValidateBeforeCall(WebauthnSettingCreateReq webauthnSettingCreateReq, final ApiCallback _callback) throws ApiException { - return webAuthnSettingCreateCall(webauthnSettingCreateReq, _callback); - - } - - /** - * - * Creates a new setting for Passkeys (Biometrics) - * @param webauthnSettingCreateReq (optional) - * @return WebauthnSettingCreateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) setting successfully created -
0 Error -
- */ - public WebauthnSettingCreateRsp webAuthnSettingCreate(WebauthnSettingCreateReq webauthnSettingCreateReq) throws ApiException { - ApiResponse localVarResp = webAuthnSettingCreateWithHttpInfo(webauthnSettingCreateReq); - return localVarResp.getData(); - } - - /** - * - * Creates a new setting for Passkeys (Biometrics) - * @param webauthnSettingCreateReq (optional) - * @return ApiResponse<WebauthnSettingCreateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) setting successfully created -
0 Error -
- */ - public ApiResponse webAuthnSettingCreateWithHttpInfo(WebauthnSettingCreateReq webauthnSettingCreateReq) throws ApiException { - okhttp3.Call localVarCall = webAuthnSettingCreateValidateBeforeCall(webauthnSettingCreateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Creates a new setting for Passkeys (Biometrics) - * @param webauthnSettingCreateReq (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Passkeys (Biometrics) setting successfully created -
0 Error -
- */ - public okhttp3.Call webAuthnSettingCreateAsync(WebauthnSettingCreateReq webauthnSettingCreateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnSettingCreateValidateBeforeCall(webauthnSettingCreateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnSettingDelete - * @param settingID ID from create (required) - * @param webauthnSettingDeleteReq (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call webAuthnSettingDeleteCall(String settingID, WebauthnSettingDeleteReq webauthnSettingDeleteReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = webauthnSettingDeleteReq; - - // create path and map variables - String localVarPath = "/v1/webauthn/settings/{settingID}" - .replace("{" + "settingID" + "}", localVarApiClient.escapeString(settingID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnSettingDeleteValidateBeforeCall(String settingID, WebauthnSettingDeleteReq webauthnSettingDeleteReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'settingID' is set - if (settingID == null) { - throw new ApiException("Missing the required parameter 'settingID' when calling webAuthnSettingDelete(Async)"); - } - - return webAuthnSettingDeleteCall(settingID, webauthnSettingDeleteReq, _callback); - - } - - /** - * - * Deletes a setting by id for Passkeys (Biometrics) - * @param settingID ID from create (required) - * @param webauthnSettingDeleteReq (optional) - * @return GenericRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public GenericRsp webAuthnSettingDelete(String settingID, WebauthnSettingDeleteReq webauthnSettingDeleteReq) throws ApiException { - ApiResponse localVarResp = webAuthnSettingDeleteWithHttpInfo(settingID, webauthnSettingDeleteReq); - return localVarResp.getData(); - } - - /** - * - * Deletes a setting by id for Passkeys (Biometrics) - * @param settingID ID from create (required) - * @param webauthnSettingDeleteReq (optional) - * @return ApiResponse<GenericRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public ApiResponse webAuthnSettingDeleteWithHttpInfo(String settingID, WebauthnSettingDeleteReq webauthnSettingDeleteReq) throws ApiException { - okhttp3.Call localVarCall = webAuthnSettingDeleteValidateBeforeCall(settingID, webauthnSettingDeleteReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Deletes a setting by id for Passkeys (Biometrics) - * @param settingID ID from create (required) - * @param webauthnSettingDeleteReq (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call webAuthnSettingDeleteAsync(String settingID, WebauthnSettingDeleteReq webauthnSettingDeleteReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnSettingDeleteValidateBeforeCall(settingID, webauthnSettingDeleteReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnSettingGet - * @param settingID ID from create (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
- */ - public okhttp3.Call webAuthnSettingGetCall(String settingID, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/webauthn/settings/{settingID}" - .replace("{" + "settingID" + "}", localVarApiClient.escapeString(settingID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnSettingGetValidateBeforeCall(String settingID, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'settingID' is set - if (settingID == null) { - throw new ApiException("Missing the required parameter 'settingID' when calling webAuthnSettingGet(Async)"); - } - - return webAuthnSettingGetCall(settingID, _callback); - - } - - /** - * - * Gets a setting by id for Passkeys (Biometrics) - * @param settingID ID from create (required) - * @return WebauthnSettingGetRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
- */ - public WebauthnSettingGetRsp webAuthnSettingGet(String settingID) throws ApiException { - ApiResponse localVarResp = webAuthnSettingGetWithHttpInfo(settingID); - return localVarResp.getData(); - } - - /** - * - * Gets a setting by id for Passkeys (Biometrics) - * @param settingID ID from create (required) - * @return ApiResponse<WebauthnSettingGetRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
- */ - public ApiResponse webAuthnSettingGetWithHttpInfo(String settingID) throws ApiException { - okhttp3.Call localVarCall = webAuthnSettingGetValidateBeforeCall(settingID, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Gets a setting by id for Passkeys (Biometrics) - * @param settingID ID from create (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
- */ - public okhttp3.Call webAuthnSettingGetAsync(String settingID, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnSettingGetValidateBeforeCall(settingID, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnSettingList - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains a list of all Passkeys (Biometrics) settings -
0 Error -
- */ - public okhttp3.Call webAuthnSettingListCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/webauthn/settings"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnSettingListValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - return webAuthnSettingListCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Lists all settings for Passkeys (Biometrics) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return WebauthnSettingListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains a list of all Passkeys (Biometrics) settings -
0 Error -
- */ - public WebauthnSettingListRsp webAuthnSettingList(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = webAuthnSettingListWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Lists all settings for Passkeys (Biometrics) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<WebauthnSettingListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains a list of all Passkeys (Biometrics) settings -
0 Error -
- */ - public ApiResponse webAuthnSettingListWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = webAuthnSettingListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Lists all settings for Passkeys (Biometrics) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains a list of all Passkeys (Biometrics) settings -
0 Error -
- */ - public okhttp3.Call webAuthnSettingListAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnSettingListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnSettingPut - * @param settingID ID from create (required) - * @param webauthnSettingUpdateReq (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
- */ - public okhttp3.Call webAuthnSettingPutCall(String settingID, WebauthnSettingUpdateReq webauthnSettingUpdateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = webauthnSettingUpdateReq; - - // create path and map variables - String localVarPath = "/v1/webauthn/settings/{settingID}" - .replace("{" + "settingID" + "}", localVarApiClient.escapeString(settingID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnSettingPutValidateBeforeCall(String settingID, WebauthnSettingUpdateReq webauthnSettingUpdateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'settingID' is set - if (settingID == null) { - throw new ApiException("Missing the required parameter 'settingID' when calling webAuthnSettingPut(Async)"); - } - - return webAuthnSettingPutCall(settingID, webauthnSettingUpdateReq, _callback); - - } - - /** - * - * Updates a setting by id for Passkeys (Biometrics) - * @param settingID ID from create (required) - * @param webauthnSettingUpdateReq (optional) - * @return WebauthnSettingUpdateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
- */ - public WebauthnSettingUpdateRsp webAuthnSettingPut(String settingID, WebauthnSettingUpdateReq webauthnSettingUpdateReq) throws ApiException { - ApiResponse localVarResp = webAuthnSettingPutWithHttpInfo(settingID, webauthnSettingUpdateReq); - return localVarResp.getData(); - } - - /** - * - * Updates a setting by id for Passkeys (Biometrics) - * @param settingID ID from create (required) - * @param webauthnSettingUpdateReq (optional) - * @return ApiResponse<WebauthnSettingUpdateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
- */ - public ApiResponse webAuthnSettingPutWithHttpInfo(String settingID, WebauthnSettingUpdateReq webauthnSettingUpdateReq) throws ApiException { - okhttp3.Call localVarCall = webAuthnSettingPutValidateBeforeCall(settingID, webauthnSettingUpdateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Updates a setting by id for Passkeys (Biometrics) - * @param settingID ID from create (required) - * @param webauthnSettingUpdateReq (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains a Passkeys (Biometrics) setting -
0 Error -
- */ - public okhttp3.Call webAuthnSettingPutAsync(String settingID, WebauthnSettingUpdateReq webauthnSettingUpdateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnSettingPutValidateBeforeCall(settingID, webauthnSettingUpdateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnStatsAuthenticator - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) authenticator statistics -
0 Error -
- */ - public okhttp3.Call webAuthnStatsAuthenticatorCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/webauthn/stats/authenticator"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - if (granularity != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnStatsAuthenticatorValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'granularity' is set - if (granularity == null) { - throw new ApiException("Missing the required parameter 'granularity' when calling webAuthnStatsAuthenticator(Async)"); - } - - return webAuthnStatsAuthenticatorCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Provides Passkeys (Biometrics) authenticator statistics - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return WebauthnStatsAuthenticatorRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) authenticator statistics -
0 Error -
- */ - public WebauthnStatsAuthenticatorRsp webAuthnStatsAuthenticator(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = webAuthnStatsAuthenticatorWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Provides Passkeys (Biometrics) authenticator statistics - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<WebauthnStatsAuthenticatorRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) authenticator statistics -
0 Error -
- */ - public ApiResponse webAuthnStatsAuthenticatorWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = webAuthnStatsAuthenticatorValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Provides Passkeys (Biometrics) authenticator statistics - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) authenticator statistics -
0 Error -
- */ - public okhttp3.Call webAuthnStatsAuthenticatorAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnStatsAuthenticatorValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for webAuthnStatsType - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) statistics -
0 Error -
- */ - public okhttp3.Call webAuthnStatsTypeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/webauthn/stats/type"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - if (granularity != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webAuthnStatsTypeValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'granularity' is set - if (granularity == null) { - throw new ApiException("Missing the required parameter 'granularity' when calling webAuthnStatsType(Async)"); - } - - return webAuthnStatsTypeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Provides Passkeys (Biometrics) type statistics - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return WebauthnStatsTypeRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) statistics -
0 Error -
- */ - public WebauthnStatsTypeRsp webAuthnStatsType(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = webAuthnStatsTypeWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Provides Passkeys (Biometrics) type statistics - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<WebauthnStatsTypeRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) statistics -
0 Error -
- */ - public ApiResponse webAuthnStatsTypeWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = webAuthnStatsTypeValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Provides Passkeys (Biometrics) type statistics - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Contains Passkeys (Biometrics) statistics -
0 Error -
- */ - public okhttp3.Call webAuthnStatsTypeAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webAuthnStatsTypeValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/ProjectConfigApi.java b/src/main/java/com/corbado/generated/api/ProjectConfigApi.java index 35c1d59..4e191a1 100644 --- a/src/main/java/com/corbado/generated/api/ProjectConfigApi.java +++ b/src/main/java/com/corbado/generated/api/ProjectConfigApi.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,13 +27,9 @@ import java.io.IOException; -import com.corbado.generated.model.EmptyReq; import com.corbado.generated.model.ErrorRsp; import com.corbado.generated.model.GenericRsp; -import com.corbado.generated.model.ProjectConfigGetRsp; -import com.corbado.generated.model.ProjectConfigSaveReq; -import com.corbado.generated.model.ProjectConfigWebhookTestReq; -import com.corbado.generated.model.ProjectConfigWebhookTestRsp; +import com.corbado.generated.model.ProjectConfigUpdateCnameReq; import java.lang.reflect.Type; import java.util.ArrayList; @@ -79,8 +75,8 @@ public void setCustomBaseUrl(String customBaseUrl) { } /** - * Build call for projectActivate - * @param emptyReq (required) + * Build call for projectConfigUpdateCNAME + * @param projectConfigUpdateCnameReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -91,7 +87,7 @@ public void setCustomBaseUrl(String customBaseUrl) { 0 Error - */ - public okhttp3.Call projectActivateCall(EmptyReq emptyReq, final ApiCallback _callback) throws ApiException { + public okhttp3.Call projectConfigUpdateCNAMECall(ProjectConfigUpdateCnameReq projectConfigUpdateCnameReq, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -105,10 +101,10 @@ public okhttp3.Call projectActivateCall(EmptyReq emptyReq, final ApiCallback _ca basePath = null; } - Object localVarPostBody = emptyReq; + Object localVarPostBody = projectConfigUpdateCnameReq; // create path and map variables - String localVarPath = "/v1/projects/activate"; + String localVarPath = "/projectConfig/cname"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -132,25 +128,25 @@ public okhttp3.Call projectActivateCall(EmptyReq emptyReq, final ApiCallback _ca localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; + String[] localVarAuthNames = new String[] { "basicAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call projectActivateValidateBeforeCall(EmptyReq emptyReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'emptyReq' is set - if (emptyReq == null) { - throw new ApiException("Missing the required parameter 'emptyReq' when calling projectActivate(Async)"); + private okhttp3.Call projectConfigUpdateCNAMEValidateBeforeCall(ProjectConfigUpdateCnameReq projectConfigUpdateCnameReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'projectConfigUpdateCnameReq' is set + if (projectConfigUpdateCnameReq == null) { + throw new ApiException("Missing the required parameter 'projectConfigUpdateCnameReq' when calling projectConfigUpdateCNAME(Async)"); } - return projectActivateCall(emptyReq, _callback); + return projectConfigUpdateCNAMECall(projectConfigUpdateCnameReq, _callback); } /** * - * Activates the project - * @param emptyReq (required) + * Update project config CNAME and generates new SSL certificate + * @param projectConfigUpdateCnameReq (required) * @return GenericRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -160,15 +156,15 @@ private okhttp3.Call projectActivateValidateBeforeCall(EmptyReq emptyReq, final 0 Error - */ - public GenericRsp projectActivate(EmptyReq emptyReq) throws ApiException { - ApiResponse localVarResp = projectActivateWithHttpInfo(emptyReq); + public GenericRsp projectConfigUpdateCNAME(ProjectConfigUpdateCnameReq projectConfigUpdateCnameReq) throws ApiException { + ApiResponse localVarResp = projectConfigUpdateCNAMEWithHttpInfo(projectConfigUpdateCnameReq); return localVarResp.getData(); } /** * - * Activates the project - * @param emptyReq (required) + * Update project config CNAME and generates new SSL certificate + * @param projectConfigUpdateCnameReq (required) * @return ApiResponse<GenericRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -178,16 +174,16 @@ public GenericRsp projectActivate(EmptyReq emptyReq) throws ApiException { 0 Error - */ - public ApiResponse projectActivateWithHttpInfo(EmptyReq emptyReq) throws ApiException { - okhttp3.Call localVarCall = projectActivateValidateBeforeCall(emptyReq, null); + public ApiResponse projectConfigUpdateCNAMEWithHttpInfo(ProjectConfigUpdateCnameReq projectConfigUpdateCnameReq) throws ApiException { + okhttp3.Call localVarCall = projectConfigUpdateCNAMEValidateBeforeCall(projectConfigUpdateCnameReq, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * (asynchronously) - * Activates the project - * @param emptyReq (required) + * Update project config CNAME and generates new SSL certificate + * @param projectConfigUpdateCnameReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -198,382 +194,11 @@ public ApiResponse projectActivateWithHttpInfo(EmptyReq emptyReq) th 0 Error - */ - public okhttp3.Call projectActivateAsync(EmptyReq emptyReq, final ApiCallback _callback) throws ApiException { + public okhttp3.Call projectConfigUpdateCNAMEAsync(ProjectConfigUpdateCnameReq projectConfigUpdateCnameReq, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = projectActivateValidateBeforeCall(emptyReq, _callback); + okhttp3.Call localVarCall = projectConfigUpdateCNAMEValidateBeforeCall(projectConfigUpdateCnameReq, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for projectConfigGet - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Project config successfully retrieved -
0 Error -
- */ - public okhttp3.Call projectConfigGetCall(final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/projectConfig"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call projectConfigGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { - return projectConfigGetCall(_callback); - - } - - /** - * - * Retrieves project config by projectID inferred from authentication - * @return ProjectConfigGetRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Project config successfully retrieved -
0 Error -
- */ - public ProjectConfigGetRsp projectConfigGet() throws ApiException { - ApiResponse localVarResp = projectConfigGetWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * - * Retrieves project config by projectID inferred from authentication - * @return ApiResponse<ProjectConfigGetRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Project config successfully retrieved -
0 Error -
- */ - public ApiResponse projectConfigGetWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = projectConfigGetValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Retrieves project config by projectID inferred from authentication - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Project config successfully retrieved -
0 Error -
- */ - public okhttp3.Call projectConfigGetAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = projectConfigGetValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for projectConfigSave - * @param projectConfigSaveReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Project config successfully saved -
0 Error -
- */ - public okhttp3.Call projectConfigSaveCall(ProjectConfigSaveReq projectConfigSaveReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = projectConfigSaveReq; - - // create path and map variables - String localVarPath = "/v1/projectConfig"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call projectConfigSaveValidateBeforeCall(ProjectConfigSaveReq projectConfigSaveReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectConfigSaveReq' is set - if (projectConfigSaveReq == null) { - throw new ApiException("Missing the required parameter 'projectConfigSaveReq' when calling projectConfigSave(Async)"); - } - - return projectConfigSaveCall(projectConfigSaveReq, _callback); - - } - - /** - * - * Saves project config - * @param projectConfigSaveReq (required) - * @return GenericRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Project config successfully saved -
0 Error -
- */ - public GenericRsp projectConfigSave(ProjectConfigSaveReq projectConfigSaveReq) throws ApiException { - ApiResponse localVarResp = projectConfigSaveWithHttpInfo(projectConfigSaveReq); - return localVarResp.getData(); - } - - /** - * - * Saves project config - * @param projectConfigSaveReq (required) - * @return ApiResponse<GenericRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Project config successfully saved -
0 Error -
- */ - public ApiResponse projectConfigSaveWithHttpInfo(ProjectConfigSaveReq projectConfigSaveReq) throws ApiException { - okhttp3.Call localVarCall = projectConfigSaveValidateBeforeCall(projectConfigSaveReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Saves project config - * @param projectConfigSaveReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Project config successfully saved -
0 Error -
- */ - public okhttp3.Call projectConfigSaveAsync(ProjectConfigSaveReq projectConfigSaveReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = projectConfigSaveValidateBeforeCall(projectConfigSaveReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for projectConfigWebhookTest - * @param projectConfigWebhookTestReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation result -
0 Error -
- */ - public okhttp3.Call projectConfigWebhookTestCall(ProjectConfigWebhookTestReq projectConfigWebhookTestReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = projectConfigWebhookTestReq; - - // create path and map variables - String localVarPath = "/v1/projectConfig/testWebhook"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call projectConfigWebhookTestValidateBeforeCall(ProjectConfigWebhookTestReq projectConfigWebhookTestReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'projectConfigWebhookTestReq' is set - if (projectConfigWebhookTestReq == null) { - throw new ApiException("Missing the required parameter 'projectConfigWebhookTestReq' when calling projectConfigWebhookTest(Async)"); - } - - return projectConfigWebhookTestCall(projectConfigWebhookTestReq, _callback); - - } - - /** - * - * Tests webhook backend - * @param projectConfigWebhookTestReq (required) - * @return ProjectConfigWebhookTestRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation result -
0 Error -
- */ - public ProjectConfigWebhookTestRsp projectConfigWebhookTest(ProjectConfigWebhookTestReq projectConfigWebhookTestReq) throws ApiException { - ApiResponse localVarResp = projectConfigWebhookTestWithHttpInfo(projectConfigWebhookTestReq); - return localVarResp.getData(); - } - - /** - * - * Tests webhook backend - * @param projectConfigWebhookTestReq (required) - * @return ApiResponse<ProjectConfigWebhookTestRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation result -
0 Error -
- */ - public ApiResponse projectConfigWebhookTestWithHttpInfo(ProjectConfigWebhookTestReq projectConfigWebhookTestReq) throws ApiException { - okhttp3.Call localVarCall = projectConfigWebhookTestValidateBeforeCall(projectConfigWebhookTestReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Tests webhook backend - * @param projectConfigWebhookTestReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation result -
0 Error -
- */ - public okhttp3.Call projectConfigWebhookTestAsync(ProjectConfigWebhookTestReq projectConfigWebhookTestReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = projectConfigWebhookTestValidateBeforeCall(projectConfigWebhookTestReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } } diff --git a/src/main/java/com/corbado/generated/api/RequestLogsApi.java b/src/main/java/com/corbado/generated/api/RequestLogsApi.java deleted file mode 100644 index 2c4cf11..0000000 --- a/src/main/java/com/corbado/generated/api/RequestLogsApi.java +++ /dev/null @@ -1,385 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.ErrorRsp; -import com.corbado.generated.model.RequestLogGetRsp; -import com.corbado.generated.model.RequestLogsListRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class RequestLogsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public RequestLogsApi() { - this(Configuration.getDefaultApiClient()); - } - - public RequestLogsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for requestLogGet - * @param requestID ID of request (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Request log successfully retrieved -
0 Error -
- */ - public okhttp3.Call requestLogGetCall(String requestID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/requestLogs/{requestID}" - .replace("{" + "requestID" + "}", localVarApiClient.escapeString(requestID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call requestLogGetValidateBeforeCall(String requestID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'requestID' is set - if (requestID == null) { - throw new ApiException("Missing the required parameter 'requestID' when calling requestLogGet(Async)"); - } - - return requestLogGetCall(requestID, remoteAddress, userAgent, _callback); - - } - - /** - * - * Retrieves request log entry by ID. If multiple requests with the same ID are found, the most recent one is returned - * @param requestID ID of request (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @return RequestLogGetRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Request log successfully retrieved -
0 Error -
- */ - public RequestLogGetRsp requestLogGet(String requestID, String remoteAddress, String userAgent) throws ApiException { - ApiResponse localVarResp = requestLogGetWithHttpInfo(requestID, remoteAddress, userAgent); - return localVarResp.getData(); - } - - /** - * - * Retrieves request log entry by ID. If multiple requests with the same ID are found, the most recent one is returned - * @param requestID ID of request (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @return ApiResponse<RequestLogGetRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Request log successfully retrieved -
0 Error -
- */ - public ApiResponse requestLogGetWithHttpInfo(String requestID, String remoteAddress, String userAgent) throws ApiException { - okhttp3.Call localVarCall = requestLogGetValidateBeforeCall(requestID, remoteAddress, userAgent, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Retrieves request log entry by ID. If multiple requests with the same ID are found, the most recent one is returned - * @param requestID ID of request (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Request log successfully retrieved -
0 Error -
- */ - public okhttp3.Call requestLogGetAsync(String requestID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = requestLogGetValidateBeforeCall(requestID, remoteAddress, userAgent, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for requestLogsList - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Request logs successfully retrieved -
0 Error -
- */ - public okhttp3.Call requestLogsListCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/requestLogs"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call requestLogsListValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - return requestLogsListCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Lists request logs for given filters - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return RequestLogsListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Request logs successfully retrieved -
0 Error -
- */ - public RequestLogsListRsp requestLogsList(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = requestLogsListWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Lists request logs for given filters - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<RequestLogsListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Request logs successfully retrieved -
0 Error -
- */ - public ApiResponse requestLogsListWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = requestLogsListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Lists request logs for given filters - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Request logs successfully retrieved -
0 Error -
- */ - public okhttp3.Call requestLogsListAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = requestLogsListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/SessionConfigApi.java b/src/main/java/com/corbado/generated/api/SessionConfigApi.java deleted file mode 100644 index 2f6e756..0000000 --- a/src/main/java/com/corbado/generated/api/SessionConfigApi.java +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.AppType; -import com.corbado.generated.model.ErrorRsp; -import com.corbado.generated.model.GenericRsp; -import com.corbado.generated.model.SessionConfigGetRsp; -import com.corbado.generated.model.SessionConfigUpdateReq; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class SessionConfigApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public SessionConfigApi() { - this(Configuration.getDefaultApiClient()); - } - - public SessionConfigApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for sessionConfigGet - * @param appType Application type (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Session config successfully retrieved -
0 Error -
- */ - public okhttp3.Call sessionConfigGetCall(AppType appType, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/sessionConfig"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (appType != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("appType", appType)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call sessionConfigGetValidateBeforeCall(AppType appType, final ApiCallback _callback) throws ApiException { - return sessionConfigGetCall(appType, _callback); - - } - - /** - * - * Retrieves session config by projectID inferred from authentication - * @param appType Application type (optional) - * @return SessionConfigGetRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Session config successfully retrieved -
0 Error -
- */ - public SessionConfigGetRsp sessionConfigGet(AppType appType) throws ApiException { - ApiResponse localVarResp = sessionConfigGetWithHttpInfo(appType); - return localVarResp.getData(); - } - - /** - * - * Retrieves session config by projectID inferred from authentication - * @param appType Application type (optional) - * @return ApiResponse<SessionConfigGetRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Session config successfully retrieved -
0 Error -
- */ - public ApiResponse sessionConfigGetWithHttpInfo(AppType appType) throws ApiException { - okhttp3.Call localVarCall = sessionConfigGetValidateBeforeCall(appType, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Retrieves session config by projectID inferred from authentication - * @param appType Application type (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Session config successfully retrieved -
0 Error -
- */ - public okhttp3.Call sessionConfigGetAsync(AppType appType, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = sessionConfigGetValidateBeforeCall(appType, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for sessionConfigUpdate - * @param sessionConfigUpdateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Session config successfully saved -
0 Error -
- */ - public okhttp3.Call sessionConfigUpdateCall(SessionConfigUpdateReq sessionConfigUpdateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = sessionConfigUpdateReq; - - // create path and map variables - String localVarPath = "/v1/sessionConfig"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call sessionConfigUpdateValidateBeforeCall(SessionConfigUpdateReq sessionConfigUpdateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'sessionConfigUpdateReq' is set - if (sessionConfigUpdateReq == null) { - throw new ApiException("Missing the required parameter 'sessionConfigUpdateReq' when calling sessionConfigUpdate(Async)"); - } - - return sessionConfigUpdateCall(sessionConfigUpdateReq, _callback); - - } - - /** - * - * Updates session config - * @param sessionConfigUpdateReq (required) - * @return GenericRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Session config successfully saved -
0 Error -
- */ - public GenericRsp sessionConfigUpdate(SessionConfigUpdateReq sessionConfigUpdateReq) throws ApiException { - ApiResponse localVarResp = sessionConfigUpdateWithHttpInfo(sessionConfigUpdateReq); - return localVarResp.getData(); - } - - /** - * - * Updates session config - * @param sessionConfigUpdateReq (required) - * @return ApiResponse<GenericRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Session config successfully saved -
0 Error -
- */ - public ApiResponse sessionConfigUpdateWithHttpInfo(SessionConfigUpdateReq sessionConfigUpdateReq) throws ApiException { - okhttp3.Call localVarCall = sessionConfigUpdateValidateBeforeCall(sessionConfigUpdateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Updates session config - * @param sessionConfigUpdateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Session config successfully saved -
0 Error -
- */ - public okhttp3.Call sessionConfigUpdateAsync(SessionConfigUpdateReq sessionConfigUpdateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = sessionConfigUpdateValidateBeforeCall(sessionConfigUpdateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/SessionsApi.java b/src/main/java/com/corbado/generated/api/SessionsApi.java new file mode 100644 index 0000000..c0211df --- /dev/null +++ b/src/main/java/com/corbado/generated/api/SessionsApi.java @@ -0,0 +1,760 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.LongSession; +import com.corbado.generated.model.LongSessionCreateReq; +import com.corbado.generated.model.LongSessionUpdateReq; +import com.corbado.generated.model.ShortSession; +import com.corbado.generated.model.ShortSessionCreateReq; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SessionsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SessionsApi() { + this(Configuration.getDefaultApiClient()); + } + + public SessionsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for longSessionCreate + * @param userID ID of user (required) + * @param longSessionCreateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been created -
0 Error -
+ */ + public okhttp3.Call longSessionCreateCall(String userID, LongSessionCreateReq longSessionCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = longSessionCreateReq; + + // create path and map variables + String localVarPath = "/users/{userID}/longSessions" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call longSessionCreateValidateBeforeCall(String userID, LongSessionCreateReq longSessionCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling longSessionCreate(Async)"); + } + + return longSessionCreateCall(userID, longSessionCreateReq, _callback); + + } + + /** + * + * Create a new long session + * @param userID ID of user (required) + * @param longSessionCreateReq (optional) + * @return LongSession + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been created -
0 Error -
+ */ + public LongSession longSessionCreate(String userID, LongSessionCreateReq longSessionCreateReq) throws ApiException { + ApiResponse localVarResp = longSessionCreateWithHttpInfo(userID, longSessionCreateReq); + return localVarResp.getData(); + } + + /** + * + * Create a new long session + * @param userID ID of user (required) + * @param longSessionCreateReq (optional) + * @return ApiResponse<LongSession> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been created -
0 Error -
+ */ + public ApiResponse longSessionCreateWithHttpInfo(String userID, LongSessionCreateReq longSessionCreateReq) throws ApiException { + okhttp3.Call localVarCall = longSessionCreateValidateBeforeCall(userID, longSessionCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Create a new long session + * @param userID ID of user (required) + * @param longSessionCreateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been created -
0 Error -
+ */ + public okhttp3.Call longSessionCreateAsync(String userID, LongSessionCreateReq longSessionCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = longSessionCreateValidateBeforeCall(userID, longSessionCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for longSessionGet + * @param longSessionID ID of long session (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been returned -
0 Error -
+ */ + public okhttp3.Call longSessionGetCall(String longSessionID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/longSessions/{longSessionID}" + .replace("{" + "longSessionID" + "}", localVarApiClient.escapeString(longSessionID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call longSessionGetValidateBeforeCall(String longSessionID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'longSessionID' is set + if (longSessionID == null) { + throw new ApiException("Missing the required parameter 'longSessionID' when calling longSessionGet(Async)"); + } + + return longSessionGetCall(longSessionID, _callback); + + } + + /** + * + * Retrieves a long session by ID + * @param longSessionID ID of long session (required) + * @return LongSession + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been returned -
0 Error -
+ */ + public LongSession longSessionGet(String longSessionID) throws ApiException { + ApiResponse localVarResp = longSessionGetWithHttpInfo(longSessionID); + return localVarResp.getData(); + } + + /** + * + * Retrieves a long session by ID + * @param longSessionID ID of long session (required) + * @return ApiResponse<LongSession> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been returned -
0 Error -
+ */ + public ApiResponse longSessionGetWithHttpInfo(String longSessionID) throws ApiException { + okhttp3.Call localVarCall = longSessionGetValidateBeforeCall(longSessionID, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Retrieves a long session by ID + * @param longSessionID ID of long session (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been returned -
0 Error -
+ */ + public okhttp3.Call longSessionGetAsync(String longSessionID, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = longSessionGetValidateBeforeCall(longSessionID, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for longSessionUpdate + * @param userID ID of user (required) + * @param longSessionID ID of long session (required) + * @param longSessionUpdateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been updated -
0 Error -
+ */ + public okhttp3.Call longSessionUpdateCall(String userID, String longSessionID, LongSessionUpdateReq longSessionUpdateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = longSessionUpdateReq; + + // create path and map variables + String localVarPath = "/users/{userID}/longSessions/{longSessionID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "longSessionID" + "}", localVarApiClient.escapeString(longSessionID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call longSessionUpdateValidateBeforeCall(String userID, String longSessionID, LongSessionUpdateReq longSessionUpdateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling longSessionUpdate(Async)"); + } + + // verify the required parameter 'longSessionID' is set + if (longSessionID == null) { + throw new ApiException("Missing the required parameter 'longSessionID' when calling longSessionUpdate(Async)"); + } + + return longSessionUpdateCall(userID, longSessionID, longSessionUpdateReq, _callback); + + } + + /** + * + * Updates long session status + * @param userID ID of user (required) + * @param longSessionID ID of long session (required) + * @param longSessionUpdateReq (optional) + * @return LongSession + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been updated -
0 Error -
+ */ + public LongSession longSessionUpdate(String userID, String longSessionID, LongSessionUpdateReq longSessionUpdateReq) throws ApiException { + ApiResponse localVarResp = longSessionUpdateWithHttpInfo(userID, longSessionID, longSessionUpdateReq); + return localVarResp.getData(); + } + + /** + * + * Updates long session status + * @param userID ID of user (required) + * @param longSessionID ID of long session (required) + * @param longSessionUpdateReq (optional) + * @return ApiResponse<LongSession> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been updated -
0 Error -
+ */ + public ApiResponse longSessionUpdateWithHttpInfo(String userID, String longSessionID, LongSessionUpdateReq longSessionUpdateReq) throws ApiException { + okhttp3.Call localVarCall = longSessionUpdateValidateBeforeCall(userID, longSessionID, longSessionUpdateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Updates long session status + * @param userID ID of user (required) + * @param longSessionID ID of long session (required) + * @param longSessionUpdateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been updated -
0 Error -
+ */ + public okhttp3.Call longSessionUpdateAsync(String userID, String longSessionID, LongSessionUpdateReq longSessionUpdateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = longSessionUpdateValidateBeforeCall(userID, longSessionID, longSessionUpdateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for shortSessionCreate + * @param userID ID of user (required) + * @param longSessionID ID of long session (required) + * @param shortSessionCreateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Short session has been created -
0 Error -
+ */ + public okhttp3.Call shortSessionCreateCall(String userID, String longSessionID, ShortSessionCreateReq shortSessionCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = shortSessionCreateReq; + + // create path and map variables + String localVarPath = "/users/{userID}/longSessions/{longSessionID}/shortSessions" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "longSessionID" + "}", localVarApiClient.escapeString(longSessionID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call shortSessionCreateValidateBeforeCall(String userID, String longSessionID, ShortSessionCreateReq shortSessionCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling shortSessionCreate(Async)"); + } + + // verify the required parameter 'longSessionID' is set + if (longSessionID == null) { + throw new ApiException("Missing the required parameter 'longSessionID' when calling shortSessionCreate(Async)"); + } + + return shortSessionCreateCall(userID, longSessionID, shortSessionCreateReq, _callback); + + } + + /** + * + * Create a new short session + * @param userID ID of user (required) + * @param longSessionID ID of long session (required) + * @param shortSessionCreateReq (optional) + * @return ShortSession + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Short session has been created -
0 Error -
+ */ + public ShortSession shortSessionCreate(String userID, String longSessionID, ShortSessionCreateReq shortSessionCreateReq) throws ApiException { + ApiResponse localVarResp = shortSessionCreateWithHttpInfo(userID, longSessionID, shortSessionCreateReq); + return localVarResp.getData(); + } + + /** + * + * Create a new short session + * @param userID ID of user (required) + * @param longSessionID ID of long session (required) + * @param shortSessionCreateReq (optional) + * @return ApiResponse<ShortSession> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Short session has been created -
0 Error -
+ */ + public ApiResponse shortSessionCreateWithHttpInfo(String userID, String longSessionID, ShortSessionCreateReq shortSessionCreateReq) throws ApiException { + okhttp3.Call localVarCall = shortSessionCreateValidateBeforeCall(userID, longSessionID, shortSessionCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Create a new short session + * @param userID ID of user (required) + * @param longSessionID ID of long session (required) + * @param shortSessionCreateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Short session has been created -
0 Error -
+ */ + public okhttp3.Call shortSessionCreateAsync(String userID, String longSessionID, ShortSessionCreateReq shortSessionCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = shortSessionCreateValidateBeforeCall(userID, longSessionID, shortSessionCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userLongSessionGet + * @param userID ID of user (required) + * @param longSessionID ID of long session (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been returned -
0 Error -
+ */ + public okhttp3.Call userLongSessionGetCall(String userID, String longSessionID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/users/{userID}/longSessions/{longSessionID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "longSessionID" + "}", localVarApiClient.escapeString(longSessionID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userLongSessionGetValidateBeforeCall(String userID, String longSessionID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userLongSessionGet(Async)"); + } + + // verify the required parameter 'longSessionID' is set + if (longSessionID == null) { + throw new ApiException("Missing the required parameter 'longSessionID' when calling userLongSessionGet(Async)"); + } + + return userLongSessionGetCall(userID, longSessionID, _callback); + + } + + /** + * + * Retrieves a long session by ID and user ID + * @param userID ID of user (required) + * @param longSessionID ID of long session (required) + * @return LongSession + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been returned -
0 Error -
+ */ + public LongSession userLongSessionGet(String userID, String longSessionID) throws ApiException { + ApiResponse localVarResp = userLongSessionGetWithHttpInfo(userID, longSessionID); + return localVarResp.getData(); + } + + /** + * + * Retrieves a long session by ID and user ID + * @param userID ID of user (required) + * @param longSessionID ID of long session (required) + * @return ApiResponse<LongSession> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been returned -
0 Error -
+ */ + public ApiResponse userLongSessionGetWithHttpInfo(String userID, String longSessionID) throws ApiException { + okhttp3.Call localVarCall = userLongSessionGetValidateBeforeCall(userID, longSessionID, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Retrieves a long session by ID and user ID + * @param userID ID of user (required) + * @param longSessionID ID of long session (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Long session has been returned -
0 Error -
+ */ + public okhttp3.Call userLongSessionGetAsync(String userID, String longSessionID, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userLongSessionGetValidateBeforeCall(userID, longSessionID, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/SmsOtpApi.java b/src/main/java/com/corbado/generated/api/SmsOtpApi.java deleted file mode 100644 index d26fd57..0000000 --- a/src/main/java/com/corbado/generated/api/SmsOtpApi.java +++ /dev/null @@ -1,343 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.ErrorRsp; -import com.corbado.generated.model.SmsCodeSendReq; -import com.corbado.generated.model.SmsCodeSendRsp; -import com.corbado.generated.model.SmsCodeValidateReq; -import com.corbado.generated.model.SmsCodeValidateRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class SmsOtpApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public SmsOtpApi() { - this(Configuration.getDefaultApiClient()); - } - - public SmsOtpApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for smsCodeSend - * @param smsCodeSendReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 SMS successfully sent -
0 Error -
- */ - public okhttp3.Call smsCodeSendCall(SmsCodeSendReq smsCodeSendReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = smsCodeSendReq; - - // create path and map variables - String localVarPath = "/v1/smsCodes"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call smsCodeSendValidateBeforeCall(SmsCodeSendReq smsCodeSendReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'smsCodeSendReq' is set - if (smsCodeSendReq == null) { - throw new ApiException("Missing the required parameter 'smsCodeSendReq' when calling smsCodeSend(Async)"); - } - - return smsCodeSendCall(smsCodeSendReq, _callback); - - } - - /** - * - * Creates SMS OTP and sends it to given phone number - * @param smsCodeSendReq (required) - * @return SmsCodeSendRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 SMS successfully sent -
0 Error -
- */ - public SmsCodeSendRsp smsCodeSend(SmsCodeSendReq smsCodeSendReq) throws ApiException { - ApiResponse localVarResp = smsCodeSendWithHttpInfo(smsCodeSendReq); - return localVarResp.getData(); - } - - /** - * - * Creates SMS OTP and sends it to given phone number - * @param smsCodeSendReq (required) - * @return ApiResponse<SmsCodeSendRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 SMS successfully sent -
0 Error -
- */ - public ApiResponse smsCodeSendWithHttpInfo(SmsCodeSendReq smsCodeSendReq) throws ApiException { - okhttp3.Call localVarCall = smsCodeSendValidateBeforeCall(smsCodeSendReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Creates SMS OTP and sends it to given phone number - * @param smsCodeSendReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 SMS successfully sent -
0 Error -
- */ - public okhttp3.Call smsCodeSendAsync(SmsCodeSendReq smsCodeSendReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = smsCodeSendValidateBeforeCall(smsCodeSendReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for smsCodeValidate - * @param smsCodeID ID of SMS OTP (required) - * @param smsCodeValidateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public okhttp3.Call smsCodeValidateCall(String smsCodeID, SmsCodeValidateReq smsCodeValidateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = smsCodeValidateReq; - - // create path and map variables - String localVarPath = "/v1/smsCodes/{smsCodeID}/validate" - .replace("{" + "smsCodeID" + "}", localVarApiClient.escapeString(smsCodeID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call smsCodeValidateValidateBeforeCall(String smsCodeID, SmsCodeValidateReq smsCodeValidateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'smsCodeID' is set - if (smsCodeID == null) { - throw new ApiException("Missing the required parameter 'smsCodeID' when calling smsCodeValidate(Async)"); - } - - // verify the required parameter 'smsCodeValidateReq' is set - if (smsCodeValidateReq == null) { - throw new ApiException("Missing the required parameter 'smsCodeValidateReq' when calling smsCodeValidate(Async)"); - } - - return smsCodeValidateCall(smsCodeID, smsCodeValidateReq, _callback); - - } - - /** - * - * Validates SMS OTP - * @param smsCodeID ID of SMS OTP (required) - * @param smsCodeValidateReq (required) - * @return SmsCodeValidateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public SmsCodeValidateRsp smsCodeValidate(String smsCodeID, SmsCodeValidateReq smsCodeValidateReq) throws ApiException { - ApiResponse localVarResp = smsCodeValidateWithHttpInfo(smsCodeID, smsCodeValidateReq); - return localVarResp.getData(); - } - - /** - * - * Validates SMS OTP - * @param smsCodeID ID of SMS OTP (required) - * @param smsCodeValidateReq (required) - * @return ApiResponse<SmsCodeValidateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public ApiResponse smsCodeValidateWithHttpInfo(String smsCodeID, SmsCodeValidateReq smsCodeValidateReq) throws ApiException { - okhttp3.Call localVarCall = smsCodeValidateValidateBeforeCall(smsCodeID, smsCodeValidateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Validates SMS OTP - * @param smsCodeID ID of SMS OTP (required) - * @param smsCodeValidateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Validation was successful -
0 Error -
- */ - public okhttp3.Call smsCodeValidateAsync(String smsCodeID, SmsCodeValidateReq smsCodeValidateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = smsCodeValidateValidateBeforeCall(smsCodeID, smsCodeValidateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/SmsTemplatesApi.java b/src/main/java/com/corbado/generated/api/SmsTemplatesApi.java deleted file mode 100644 index cc78d2d..0000000 --- a/src/main/java/com/corbado/generated/api/SmsTemplatesApi.java +++ /dev/null @@ -1,343 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.ErrorRsp; -import com.corbado.generated.model.GenericRsp; -import com.corbado.generated.model.SmsTemplateCreateReq; -import com.corbado.generated.model.SmsTemplateCreateRsp; -import com.corbado.generated.model.SmsTemplateDeleteReq; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class SmsTemplatesApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public SmsTemplatesApi() { - this(Configuration.getDefaultApiClient()); - } - - public SmsTemplatesApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for smsTemplateCreate - * @param smsTemplateCreateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 SMS template successfully created -
0 Error -
- */ - public okhttp3.Call smsTemplateCreateCall(SmsTemplateCreateReq smsTemplateCreateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = smsTemplateCreateReq; - - // create path and map variables - String localVarPath = "/v1/smsTemplates"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call smsTemplateCreateValidateBeforeCall(SmsTemplateCreateReq smsTemplateCreateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'smsTemplateCreateReq' is set - if (smsTemplateCreateReq == null) { - throw new ApiException("Missing the required parameter 'smsTemplateCreateReq' when calling smsTemplateCreate(Async)"); - } - - return smsTemplateCreateCall(smsTemplateCreateReq, _callback); - - } - - /** - * - * Creates a new SMS template - * @param smsTemplateCreateReq (required) - * @return SmsTemplateCreateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 SMS template successfully created -
0 Error -
- */ - public SmsTemplateCreateRsp smsTemplateCreate(SmsTemplateCreateReq smsTemplateCreateReq) throws ApiException { - ApiResponse localVarResp = smsTemplateCreateWithHttpInfo(smsTemplateCreateReq); - return localVarResp.getData(); - } - - /** - * - * Creates a new SMS template - * @param smsTemplateCreateReq (required) - * @return ApiResponse<SmsTemplateCreateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 SMS template successfully created -
0 Error -
- */ - public ApiResponse smsTemplateCreateWithHttpInfo(SmsTemplateCreateReq smsTemplateCreateReq) throws ApiException { - okhttp3.Call localVarCall = smsTemplateCreateValidateBeforeCall(smsTemplateCreateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Creates a new SMS template - * @param smsTemplateCreateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 SMS template successfully created -
0 Error -
- */ - public okhttp3.Call smsTemplateCreateAsync(SmsTemplateCreateReq smsTemplateCreateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = smsTemplateCreateValidateBeforeCall(smsTemplateCreateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for smsTemplateDelete - * @param smsTemplateID ID of SMS template (required) - * @param smsTemplateDeleteReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call smsTemplateDeleteCall(String smsTemplateID, SmsTemplateDeleteReq smsTemplateDeleteReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = smsTemplateDeleteReq; - - // create path and map variables - String localVarPath = "/v1/smsTemplates/{smsTemplateID}" - .replace("{" + "smsTemplateID" + "}", localVarApiClient.escapeString(smsTemplateID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call smsTemplateDeleteValidateBeforeCall(String smsTemplateID, SmsTemplateDeleteReq smsTemplateDeleteReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'smsTemplateID' is set - if (smsTemplateID == null) { - throw new ApiException("Missing the required parameter 'smsTemplateID' when calling smsTemplateDelete(Async)"); - } - - // verify the required parameter 'smsTemplateDeleteReq' is set - if (smsTemplateDeleteReq == null) { - throw new ApiException("Missing the required parameter 'smsTemplateDeleteReq' when calling smsTemplateDelete(Async)"); - } - - return smsTemplateDeleteCall(smsTemplateID, smsTemplateDeleteReq, _callback); - - } - - /** - * - * Deletes an SMS template - * @param smsTemplateID ID of SMS template (required) - * @param smsTemplateDeleteReq (required) - * @return GenericRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public GenericRsp smsTemplateDelete(String smsTemplateID, SmsTemplateDeleteReq smsTemplateDeleteReq) throws ApiException { - ApiResponse localVarResp = smsTemplateDeleteWithHttpInfo(smsTemplateID, smsTemplateDeleteReq); - return localVarResp.getData(); - } - - /** - * - * Deletes an SMS template - * @param smsTemplateID ID of SMS template (required) - * @param smsTemplateDeleteReq (required) - * @return ApiResponse<GenericRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public ApiResponse smsTemplateDeleteWithHttpInfo(String smsTemplateID, SmsTemplateDeleteReq smsTemplateDeleteReq) throws ApiException { - okhttp3.Call localVarCall = smsTemplateDeleteValidateBeforeCall(smsTemplateID, smsTemplateDeleteReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Deletes an SMS template - * @param smsTemplateID ID of SMS template (required) - * @param smsTemplateDeleteReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call smsTemplateDeleteAsync(String smsTemplateID, SmsTemplateDeleteReq smsTemplateDeleteReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = smsTemplateDeleteValidateBeforeCall(smsTemplateID, smsTemplateDeleteReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/UserApi.java b/src/main/java/com/corbado/generated/api/UserApi.java deleted file mode 100644 index 8f56627..0000000 --- a/src/main/java/com/corbado/generated/api/UserApi.java +++ /dev/null @@ -1,2757 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.ErrorRsp; -import com.corbado.generated.model.GenericRsp; -import com.corbado.generated.model.UserAuthLogListRsp; -import com.corbado.generated.model.UserCreateReq; -import com.corbado.generated.model.UserCreateRsp; -import com.corbado.generated.model.UserCustomLoginIdentifierCreateReq; -import com.corbado.generated.model.UserCustomLoginIdentifierCreateRsp; -import com.corbado.generated.model.UserCustomLoginIdentifierDeleteReq; -import com.corbado.generated.model.UserCustomLoginIdentifierGetRsp; -import com.corbado.generated.model.UserDeleteReq; -import com.corbado.generated.model.UserDeviceListRsp; -import com.corbado.generated.model.UserEmailCreateReq; -import com.corbado.generated.model.UserEmailCreateRsp; -import com.corbado.generated.model.UserEmailDeleteReq; -import com.corbado.generated.model.UserEmailGetRsp; -import com.corbado.generated.model.UserExistsReq; -import com.corbado.generated.model.UserExistsRsp; -import com.corbado.generated.model.UserGetRsp; -import com.corbado.generated.model.UserListRsp; -import com.corbado.generated.model.UserPhoneNumberCreateReq; -import com.corbado.generated.model.UserPhoneNumberCreateRsp; -import com.corbado.generated.model.UserPhoneNumberDeleteReq; -import com.corbado.generated.model.UserPhoneNumberGetRsp; -import com.corbado.generated.model.UserStatsListRsp; -import com.corbado.generated.model.UserUpdateReq; -import com.corbado.generated.model.UserUpdateRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class UserApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public UserApi() { - this(Configuration.getDefaultApiClient()); - } - - public UserApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for userAuthLogList - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
- */ - public okhttp3.Call userAuthLogListCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/userauthlogs"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userAuthLogListValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - return userAuthLogListCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Lists user auth log - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return UserAuthLogListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
- */ - public UserAuthLogListRsp userAuthLogList(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = userAuthLogListWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Lists user auth log - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<UserAuthLogListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
- */ - public ApiResponse userAuthLogListWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = userAuthLogListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Lists user auth log - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Auth methods successfully retrieved -
0 Error -
- */ - public okhttp3.Call userAuthLogListAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userAuthLogListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userCreate - * @param userCreateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User successfully created -
0 Error -
- */ - public okhttp3.Call userCreateCall(UserCreateReq userCreateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = userCreateReq; - - // create path and map variables - String localVarPath = "/v1/users"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userCreateValidateBeforeCall(UserCreateReq userCreateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userCreateReq' is set - if (userCreateReq == null) { - throw new ApiException("Missing the required parameter 'userCreateReq' when calling userCreate(Async)"); - } - - return userCreateCall(userCreateReq, _callback); - - } - - /** - * - * Creates a new user - * @param userCreateReq (required) - * @return UserCreateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User successfully created -
0 Error -
- */ - public UserCreateRsp userCreate(UserCreateReq userCreateReq) throws ApiException { - ApiResponse localVarResp = userCreateWithHttpInfo(userCreateReq); - return localVarResp.getData(); - } - - /** - * - * Creates a new user - * @param userCreateReq (required) - * @return ApiResponse<UserCreateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User successfully created -
0 Error -
- */ - public ApiResponse userCreateWithHttpInfo(UserCreateReq userCreateReq) throws ApiException { - okhttp3.Call localVarCall = userCreateValidateBeforeCall(userCreateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Creates a new user - * @param userCreateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User successfully created -
0 Error -
- */ - public okhttp3.Call userCreateAsync(UserCreateReq userCreateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userCreateValidateBeforeCall(userCreateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userCustomLoginIdentifierCreate - * @param userID ID of user (required) - * @param userCustomLoginIdentifierCreateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User custom login identifier created -
0 Error -
- */ - public okhttp3.Call userCustomLoginIdentifierCreateCall(String userID, UserCustomLoginIdentifierCreateReq userCustomLoginIdentifierCreateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = userCustomLoginIdentifierCreateReq; - - // create path and map variables - String localVarPath = "/v1/users/{userID}/customLoginIdentifiers" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userCustomLoginIdentifierCreateValidateBeforeCall(String userID, UserCustomLoginIdentifierCreateReq userCustomLoginIdentifierCreateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling userCustomLoginIdentifierCreate(Async)"); - } - - // verify the required parameter 'userCustomLoginIdentifierCreateReq' is set - if (userCustomLoginIdentifierCreateReq == null) { - throw new ApiException("Missing the required parameter 'userCustomLoginIdentifierCreateReq' when calling userCustomLoginIdentifierCreate(Async)"); - } - - return userCustomLoginIdentifierCreateCall(userID, userCustomLoginIdentifierCreateReq, _callback); - - } - - /** - * - * Add a custom login identifier to an existing user - * @param userID ID of user (required) - * @param userCustomLoginIdentifierCreateReq (required) - * @return UserCustomLoginIdentifierCreateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User custom login identifier created -
0 Error -
- */ - public UserCustomLoginIdentifierCreateRsp userCustomLoginIdentifierCreate(String userID, UserCustomLoginIdentifierCreateReq userCustomLoginIdentifierCreateReq) throws ApiException { - ApiResponse localVarResp = userCustomLoginIdentifierCreateWithHttpInfo(userID, userCustomLoginIdentifierCreateReq); - return localVarResp.getData(); - } - - /** - * - * Add a custom login identifier to an existing user - * @param userID ID of user (required) - * @param userCustomLoginIdentifierCreateReq (required) - * @return ApiResponse<UserCustomLoginIdentifierCreateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User custom login identifier created -
0 Error -
- */ - public ApiResponse userCustomLoginIdentifierCreateWithHttpInfo(String userID, UserCustomLoginIdentifierCreateReq userCustomLoginIdentifierCreateReq) throws ApiException { - okhttp3.Call localVarCall = userCustomLoginIdentifierCreateValidateBeforeCall(userID, userCustomLoginIdentifierCreateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Add a custom login identifier to an existing user - * @param userID ID of user (required) - * @param userCustomLoginIdentifierCreateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User custom login identifier created -
0 Error -
- */ - public okhttp3.Call userCustomLoginIdentifierCreateAsync(String userID, UserCustomLoginIdentifierCreateReq userCustomLoginIdentifierCreateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userCustomLoginIdentifierCreateValidateBeforeCall(userID, userCustomLoginIdentifierCreateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userCustomLoginIdentifierDelete - * @param userID ID of user (required) - * @param customLoginIdentifierID ID of custom login identifier (required) - * @param userCustomLoginIdentifierDeleteReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call userCustomLoginIdentifierDeleteCall(String userID, String customLoginIdentifierID, UserCustomLoginIdentifierDeleteReq userCustomLoginIdentifierDeleteReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = userCustomLoginIdentifierDeleteReq; - - // create path and map variables - String localVarPath = "/v1/users/{userID}/customLoginIdentifiers/{customLoginIdentifierID}" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) - .replace("{" + "customLoginIdentifierID" + "}", localVarApiClient.escapeString(customLoginIdentifierID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userCustomLoginIdentifierDeleteValidateBeforeCall(String userID, String customLoginIdentifierID, UserCustomLoginIdentifierDeleteReq userCustomLoginIdentifierDeleteReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling userCustomLoginIdentifierDelete(Async)"); - } - - // verify the required parameter 'customLoginIdentifierID' is set - if (customLoginIdentifierID == null) { - throw new ApiException("Missing the required parameter 'customLoginIdentifierID' when calling userCustomLoginIdentifierDelete(Async)"); - } - - // verify the required parameter 'userCustomLoginIdentifierDeleteReq' is set - if (userCustomLoginIdentifierDeleteReq == null) { - throw new ApiException("Missing the required parameter 'userCustomLoginIdentifierDeleteReq' when calling userCustomLoginIdentifierDelete(Async)"); - } - - return userCustomLoginIdentifierDeleteCall(userID, customLoginIdentifierID, userCustomLoginIdentifierDeleteReq, _callback); - - } - - /** - * - * Delete a user's custom login identifier - * @param userID ID of user (required) - * @param customLoginIdentifierID ID of custom login identifier (required) - * @param userCustomLoginIdentifierDeleteReq (required) - * @return GenericRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public GenericRsp userCustomLoginIdentifierDelete(String userID, String customLoginIdentifierID, UserCustomLoginIdentifierDeleteReq userCustomLoginIdentifierDeleteReq) throws ApiException { - ApiResponse localVarResp = userCustomLoginIdentifierDeleteWithHttpInfo(userID, customLoginIdentifierID, userCustomLoginIdentifierDeleteReq); - return localVarResp.getData(); - } - - /** - * - * Delete a user's custom login identifier - * @param userID ID of user (required) - * @param customLoginIdentifierID ID of custom login identifier (required) - * @param userCustomLoginIdentifierDeleteReq (required) - * @return ApiResponse<GenericRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public ApiResponse userCustomLoginIdentifierDeleteWithHttpInfo(String userID, String customLoginIdentifierID, UserCustomLoginIdentifierDeleteReq userCustomLoginIdentifierDeleteReq) throws ApiException { - okhttp3.Call localVarCall = userCustomLoginIdentifierDeleteValidateBeforeCall(userID, customLoginIdentifierID, userCustomLoginIdentifierDeleteReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Delete a user's custom login identifier - * @param userID ID of user (required) - * @param customLoginIdentifierID ID of custom login identifier (required) - * @param userCustomLoginIdentifierDeleteReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call userCustomLoginIdentifierDeleteAsync(String userID, String customLoginIdentifierID, UserCustomLoginIdentifierDeleteReq userCustomLoginIdentifierDeleteReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userCustomLoginIdentifierDeleteValidateBeforeCall(userID, customLoginIdentifierID, userCustomLoginIdentifierDeleteReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userCustomLoginIdentifierGet - * @param userID ID of user (required) - * @param customLoginIdentifierID ID of custom login identifier (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User custom login identifier successfully retrieved -
0 Error -
- */ - public okhttp3.Call userCustomLoginIdentifierGetCall(String userID, String customLoginIdentifierID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/users/{userID}/customLoginIdentifiers/{customLoginIdentifierID}" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) - .replace("{" + "customLoginIdentifierID" + "}", localVarApiClient.escapeString(customLoginIdentifierID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userCustomLoginIdentifierGetValidateBeforeCall(String userID, String customLoginIdentifierID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling userCustomLoginIdentifierGet(Async)"); - } - - // verify the required parameter 'customLoginIdentifierID' is set - if (customLoginIdentifierID == null) { - throw new ApiException("Missing the required parameter 'customLoginIdentifierID' when calling userCustomLoginIdentifierGet(Async)"); - } - - return userCustomLoginIdentifierGetCall(userID, customLoginIdentifierID, remoteAddress, userAgent, _callback); - - } - - /** - * - * Get a user's custom login identifier - * @param userID ID of user (required) - * @param customLoginIdentifierID ID of custom login identifier (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @return UserCustomLoginIdentifierGetRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User custom login identifier successfully retrieved -
0 Error -
- */ - public UserCustomLoginIdentifierGetRsp userCustomLoginIdentifierGet(String userID, String customLoginIdentifierID, String remoteAddress, String userAgent) throws ApiException { - ApiResponse localVarResp = userCustomLoginIdentifierGetWithHttpInfo(userID, customLoginIdentifierID, remoteAddress, userAgent); - return localVarResp.getData(); - } - - /** - * - * Get a user's custom login identifier - * @param userID ID of user (required) - * @param customLoginIdentifierID ID of custom login identifier (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @return ApiResponse<UserCustomLoginIdentifierGetRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User custom login identifier successfully retrieved -
0 Error -
- */ - public ApiResponse userCustomLoginIdentifierGetWithHttpInfo(String userID, String customLoginIdentifierID, String remoteAddress, String userAgent) throws ApiException { - okhttp3.Call localVarCall = userCustomLoginIdentifierGetValidateBeforeCall(userID, customLoginIdentifierID, remoteAddress, userAgent, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Get a user's custom login identifier - * @param userID ID of user (required) - * @param customLoginIdentifierID ID of custom login identifier (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User custom login identifier successfully retrieved -
0 Error -
- */ - public okhttp3.Call userCustomLoginIdentifierGetAsync(String userID, String customLoginIdentifierID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userCustomLoginIdentifierGetValidateBeforeCall(userID, customLoginIdentifierID, remoteAddress, userAgent, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userDelete - * @param userID ID of user (required) - * @param userDeleteReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call userDeleteCall(String userID, UserDeleteReq userDeleteReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = userDeleteReq; - - // create path and map variables - String localVarPath = "/v1/users/{userID}" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userDeleteValidateBeforeCall(String userID, UserDeleteReq userDeleteReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling userDelete(Async)"); - } - - // verify the required parameter 'userDeleteReq' is set - if (userDeleteReq == null) { - throw new ApiException("Missing the required parameter 'userDeleteReq' when calling userDelete(Async)"); - } - - return userDeleteCall(userID, userDeleteReq, _callback); - - } - - /** - * - * Deletes a user - * @param userID ID of user (required) - * @param userDeleteReq (required) - * @return GenericRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public GenericRsp userDelete(String userID, UserDeleteReq userDeleteReq) throws ApiException { - ApiResponse localVarResp = userDeleteWithHttpInfo(userID, userDeleteReq); - return localVarResp.getData(); - } - - /** - * - * Deletes a user - * @param userID ID of user (required) - * @param userDeleteReq (required) - * @return ApiResponse<GenericRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public ApiResponse userDeleteWithHttpInfo(String userID, UserDeleteReq userDeleteReq) throws ApiException { - okhttp3.Call localVarCall = userDeleteValidateBeforeCall(userID, userDeleteReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Deletes a user - * @param userID ID of user (required) - * @param userDeleteReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call userDeleteAsync(String userID, UserDeleteReq userDeleteReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userDeleteValidateBeforeCall(userID, userDeleteReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userDeviceList - * @param userID ID of user (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all devices -
- */ - public okhttp3.Call userDeviceListCall(String userID, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/users/{userID}/devices" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userDeviceListValidateBeforeCall(String userID, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling userDeviceList(Async)"); - } - - return userDeviceListCall(userID, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Provides all register devices for given user - * @param userID ID of user (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return UserDeviceListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all devices -
- */ - public UserDeviceListRsp userDeviceList(String userID, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = userDeviceListWithHttpInfo(userID, remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Provides all register devices for given user - * @param userID ID of user (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<UserDeviceListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all devices -
- */ - public ApiResponse userDeviceListWithHttpInfo(String userID, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = userDeviceListValidateBeforeCall(userID, remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Provides all register devices for given user - * @param userID ID of user (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all devices -
- */ - public okhttp3.Call userDeviceListAsync(String userID, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userDeviceListValidateBeforeCall(userID, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userEmailCreate - * @param userID ID of user (required) - * @param userEmailCreateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User email found -
0 Error -
- */ - public okhttp3.Call userEmailCreateCall(String userID, UserEmailCreateReq userEmailCreateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = userEmailCreateReq; - - // create path and map variables - String localVarPath = "/v1/users/{userID}/emails" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userEmailCreateValidateBeforeCall(String userID, UserEmailCreateReq userEmailCreateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling userEmailCreate(Async)"); - } - - // verify the required parameter 'userEmailCreateReq' is set - if (userEmailCreateReq == null) { - throw new ApiException("Missing the required parameter 'userEmailCreateReq' when calling userEmailCreate(Async)"); - } - - return userEmailCreateCall(userID, userEmailCreateReq, _callback); - - } - - /** - * - * Add an email to an existing user - * @param userID ID of user (required) - * @param userEmailCreateReq (required) - * @return UserEmailCreateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User email found -
0 Error -
- */ - public UserEmailCreateRsp userEmailCreate(String userID, UserEmailCreateReq userEmailCreateReq) throws ApiException { - ApiResponse localVarResp = userEmailCreateWithHttpInfo(userID, userEmailCreateReq); - return localVarResp.getData(); - } - - /** - * - * Add an email to an existing user - * @param userID ID of user (required) - * @param userEmailCreateReq (required) - * @return ApiResponse<UserEmailCreateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User email found -
0 Error -
- */ - public ApiResponse userEmailCreateWithHttpInfo(String userID, UserEmailCreateReq userEmailCreateReq) throws ApiException { - okhttp3.Call localVarCall = userEmailCreateValidateBeforeCall(userID, userEmailCreateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Add an email to an existing user - * @param userID ID of user (required) - * @param userEmailCreateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User email found -
0 Error -
- */ - public okhttp3.Call userEmailCreateAsync(String userID, UserEmailCreateReq userEmailCreateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userEmailCreateValidateBeforeCall(userID, userEmailCreateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userEmailDelete - * @param userID ID of user (required) - * @param emailID ID of email (required) - * @param userEmailDeleteReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call userEmailDeleteCall(String userID, String emailID, UserEmailDeleteReq userEmailDeleteReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = userEmailDeleteReq; - - // create path and map variables - String localVarPath = "/v1/users/{userID}/emails/{emailID}" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) - .replace("{" + "emailID" + "}", localVarApiClient.escapeString(emailID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userEmailDeleteValidateBeforeCall(String userID, String emailID, UserEmailDeleteReq userEmailDeleteReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling userEmailDelete(Async)"); - } - - // verify the required parameter 'emailID' is set - if (emailID == null) { - throw new ApiException("Missing the required parameter 'emailID' when calling userEmailDelete(Async)"); - } - - // verify the required parameter 'userEmailDeleteReq' is set - if (userEmailDeleteReq == null) { - throw new ApiException("Missing the required parameter 'userEmailDeleteReq' when calling userEmailDelete(Async)"); - } - - return userEmailDeleteCall(userID, emailID, userEmailDeleteReq, _callback); - - } - - /** - * - * Delete a user's email - * @param userID ID of user (required) - * @param emailID ID of email (required) - * @param userEmailDeleteReq (required) - * @return GenericRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public GenericRsp userEmailDelete(String userID, String emailID, UserEmailDeleteReq userEmailDeleteReq) throws ApiException { - ApiResponse localVarResp = userEmailDeleteWithHttpInfo(userID, emailID, userEmailDeleteReq); - return localVarResp.getData(); - } - - /** - * - * Delete a user's email - * @param userID ID of user (required) - * @param emailID ID of email (required) - * @param userEmailDeleteReq (required) - * @return ApiResponse<GenericRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public ApiResponse userEmailDeleteWithHttpInfo(String userID, String emailID, UserEmailDeleteReq userEmailDeleteReq) throws ApiException { - okhttp3.Call localVarCall = userEmailDeleteValidateBeforeCall(userID, emailID, userEmailDeleteReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Delete a user's email - * @param userID ID of user (required) - * @param emailID ID of email (required) - * @param userEmailDeleteReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call userEmailDeleteAsync(String userID, String emailID, UserEmailDeleteReq userEmailDeleteReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userEmailDeleteValidateBeforeCall(userID, emailID, userEmailDeleteReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userEmailGet - * @param userID ID of user (required) - * @param emailID ID of email (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User email successfully created -
0 Error -
- */ - public okhttp3.Call userEmailGetCall(String userID, String emailID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/users/{userID}/emails/{emailID}" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) - .replace("{" + "emailID" + "}", localVarApiClient.escapeString(emailID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userEmailGetValidateBeforeCall(String userID, String emailID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling userEmailGet(Async)"); - } - - // verify the required parameter 'emailID' is set - if (emailID == null) { - throw new ApiException("Missing the required parameter 'emailID' when calling userEmailGet(Async)"); - } - - return userEmailGetCall(userID, emailID, remoteAddress, userAgent, _callback); - - } - - /** - * - * Get a user's email - * @param userID ID of user (required) - * @param emailID ID of email (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @return UserEmailGetRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User email successfully created -
0 Error -
- */ - public UserEmailGetRsp userEmailGet(String userID, String emailID, String remoteAddress, String userAgent) throws ApiException { - ApiResponse localVarResp = userEmailGetWithHttpInfo(userID, emailID, remoteAddress, userAgent); - return localVarResp.getData(); - } - - /** - * - * Get a user's email - * @param userID ID of user (required) - * @param emailID ID of email (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @return ApiResponse<UserEmailGetRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User email successfully created -
0 Error -
- */ - public ApiResponse userEmailGetWithHttpInfo(String userID, String emailID, String remoteAddress, String userAgent) throws ApiException { - okhttp3.Call localVarCall = userEmailGetValidateBeforeCall(userID, emailID, remoteAddress, userAgent, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Get a user's email - * @param userID ID of user (required) - * @param emailID ID of email (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User email successfully created -
0 Error -
- */ - public okhttp3.Call userEmailGetAsync(String userID, String emailID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userEmailGetValidateBeforeCall(userID, emailID, remoteAddress, userAgent, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userExists - * @param userExistsReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User existence check completed -
0 Error -
- */ - public okhttp3.Call userExistsCall(UserExistsReq userExistsReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = userExistsReq; - - // create path and map variables - String localVarPath = "/v1/users/exists"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userExistsValidateBeforeCall(UserExistsReq userExistsReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userExistsReq' is set - if (userExistsReq == null) { - throw new ApiException("Missing the required parameter 'userExistsReq' when calling userExists(Async)"); - } - - return userExistsCall(userExistsReq, _callback); - - } - - /** - * - * Checks if a confirmed user exists for provided login identifier - * @param userExistsReq (required) - * @return UserExistsRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User existence check completed -
0 Error -
- */ - public UserExistsRsp userExists(UserExistsReq userExistsReq) throws ApiException { - ApiResponse localVarResp = userExistsWithHttpInfo(userExistsReq); - return localVarResp.getData(); - } - - /** - * - * Checks if a confirmed user exists for provided login identifier - * @param userExistsReq (required) - * @return ApiResponse<UserExistsRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User existence check completed -
0 Error -
- */ - public ApiResponse userExistsWithHttpInfo(UserExistsReq userExistsReq) throws ApiException { - okhttp3.Call localVarCall = userExistsValidateBeforeCall(userExistsReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Checks if a confirmed user exists for provided login identifier - * @param userExistsReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User existence check completed -
0 Error -
- */ - public okhttp3.Call userExistsAsync(UserExistsReq userExistsReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userExistsValidateBeforeCall(userExistsReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userGet - * @param userID ID of user (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User successfully retrieved -
0 Error -
- */ - public okhttp3.Call userGetCall(String userID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/users/{userID}" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userGetValidateBeforeCall(String userID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling userGet(Async)"); - } - - return userGetCall(userID, remoteAddress, userAgent, _callback); - - } - - /** - * - * Get a user by ID - * @param userID ID of user (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @return UserGetRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User successfully retrieved -
0 Error -
- */ - public UserGetRsp userGet(String userID, String remoteAddress, String userAgent) throws ApiException { - ApiResponse localVarResp = userGetWithHttpInfo(userID, remoteAddress, userAgent); - return localVarResp.getData(); - } - - /** - * - * Get a user by ID - * @param userID ID of user (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @return ApiResponse<UserGetRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User successfully retrieved -
0 Error -
- */ - public ApiResponse userGetWithHttpInfo(String userID, String remoteAddress, String userAgent) throws ApiException { - okhttp3.Call localVarCall = userGetValidateBeforeCall(userID, remoteAddress, userAgent, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Get a user by ID - * @param userID ID of user (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User successfully retrieved -
0 Error -
- */ - public okhttp3.Call userGetAsync(String userID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userGetValidateBeforeCall(userID, remoteAddress, userAgent, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userList - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Users successfully retrieved -
0 Error -
- */ - public okhttp3.Call userListCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/users"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userListValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - return userListCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Lists project users - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return UserListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Users successfully retrieved -
0 Error -
- */ - public UserListRsp userList(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = userListWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Lists project users - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<UserListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Users successfully retrieved -
0 Error -
- */ - public ApiResponse userListWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = userListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Lists project users - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Users successfully retrieved -
0 Error -
- */ - public okhttp3.Call userListAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userPhoneNumberCreate - * @param userID ID of user (required) - * @param userPhoneNumberCreateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User phone number successfully added -
0 Error -
- */ - public okhttp3.Call userPhoneNumberCreateCall(String userID, UserPhoneNumberCreateReq userPhoneNumberCreateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = userPhoneNumberCreateReq; - - // create path and map variables - String localVarPath = "/v1/users/{userID}/phoneNumbers" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userPhoneNumberCreateValidateBeforeCall(String userID, UserPhoneNumberCreateReq userPhoneNumberCreateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling userPhoneNumberCreate(Async)"); - } - - // verify the required parameter 'userPhoneNumberCreateReq' is set - if (userPhoneNumberCreateReq == null) { - throw new ApiException("Missing the required parameter 'userPhoneNumberCreateReq' when calling userPhoneNumberCreate(Async)"); - } - - return userPhoneNumberCreateCall(userID, userPhoneNumberCreateReq, _callback); - - } - - /** - * - * Add a phone number to an existing user - * @param userID ID of user (required) - * @param userPhoneNumberCreateReq (required) - * @return UserPhoneNumberCreateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User phone number successfully added -
0 Error -
- */ - public UserPhoneNumberCreateRsp userPhoneNumberCreate(String userID, UserPhoneNumberCreateReq userPhoneNumberCreateReq) throws ApiException { - ApiResponse localVarResp = userPhoneNumberCreateWithHttpInfo(userID, userPhoneNumberCreateReq); - return localVarResp.getData(); - } - - /** - * - * Add a phone number to an existing user - * @param userID ID of user (required) - * @param userPhoneNumberCreateReq (required) - * @return ApiResponse<UserPhoneNumberCreateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User phone number successfully added -
0 Error -
- */ - public ApiResponse userPhoneNumberCreateWithHttpInfo(String userID, UserPhoneNumberCreateReq userPhoneNumberCreateReq) throws ApiException { - okhttp3.Call localVarCall = userPhoneNumberCreateValidateBeforeCall(userID, userPhoneNumberCreateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Add a phone number to an existing user - * @param userID ID of user (required) - * @param userPhoneNumberCreateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User phone number successfully added -
0 Error -
- */ - public okhttp3.Call userPhoneNumberCreateAsync(String userID, UserPhoneNumberCreateReq userPhoneNumberCreateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userPhoneNumberCreateValidateBeforeCall(userID, userPhoneNumberCreateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userPhoneNumberDelete - * @param userID ID of user (required) - * @param phoneNumberID ID of phone number (required) - * @param userPhoneNumberDeleteReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call userPhoneNumberDeleteCall(String userID, String phoneNumberID, UserPhoneNumberDeleteReq userPhoneNumberDeleteReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = userPhoneNumberDeleteReq; - - // create path and map variables - String localVarPath = "/v1/users/{userID}/phoneNumbers/{phoneNumberID}" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) - .replace("{" + "phoneNumberID" + "}", localVarApiClient.escapeString(phoneNumberID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userPhoneNumberDeleteValidateBeforeCall(String userID, String phoneNumberID, UserPhoneNumberDeleteReq userPhoneNumberDeleteReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling userPhoneNumberDelete(Async)"); - } - - // verify the required parameter 'phoneNumberID' is set - if (phoneNumberID == null) { - throw new ApiException("Missing the required parameter 'phoneNumberID' when calling userPhoneNumberDelete(Async)"); - } - - // verify the required parameter 'userPhoneNumberDeleteReq' is set - if (userPhoneNumberDeleteReq == null) { - throw new ApiException("Missing the required parameter 'userPhoneNumberDeleteReq' when calling userPhoneNumberDelete(Async)"); - } - - return userPhoneNumberDeleteCall(userID, phoneNumberID, userPhoneNumberDeleteReq, _callback); - - } - - /** - * - * Delete a user's phone number - * @param userID ID of user (required) - * @param phoneNumberID ID of phone number (required) - * @param userPhoneNumberDeleteReq (required) - * @return GenericRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public GenericRsp userPhoneNumberDelete(String userID, String phoneNumberID, UserPhoneNumberDeleteReq userPhoneNumberDeleteReq) throws ApiException { - ApiResponse localVarResp = userPhoneNumberDeleteWithHttpInfo(userID, phoneNumberID, userPhoneNumberDeleteReq); - return localVarResp.getData(); - } - - /** - * - * Delete a user's phone number - * @param userID ID of user (required) - * @param phoneNumberID ID of phone number (required) - * @param userPhoneNumberDeleteReq (required) - * @return ApiResponse<GenericRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public ApiResponse userPhoneNumberDeleteWithHttpInfo(String userID, String phoneNumberID, UserPhoneNumberDeleteReq userPhoneNumberDeleteReq) throws ApiException { - okhttp3.Call localVarCall = userPhoneNumberDeleteValidateBeforeCall(userID, phoneNumberID, userPhoneNumberDeleteReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Delete a user's phone number - * @param userID ID of user (required) - * @param phoneNumberID ID of phone number (required) - * @param userPhoneNumberDeleteReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
- */ - public okhttp3.Call userPhoneNumberDeleteAsync(String userID, String phoneNumberID, UserPhoneNumberDeleteReq userPhoneNumberDeleteReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userPhoneNumberDeleteValidateBeforeCall(userID, phoneNumberID, userPhoneNumberDeleteReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userPhoneNumberGet - * @param userID ID of user (required) - * @param phoneNumberID ID of phone number (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User phone number found -
0 Error -
- */ - public okhttp3.Call userPhoneNumberGetCall(String userID, String phoneNumberID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/users/{userID}/phoneNumbers/{phoneNumberID}" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) - .replace("{" + "phoneNumberID" + "}", localVarApiClient.escapeString(phoneNumberID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userPhoneNumberGetValidateBeforeCall(String userID, String phoneNumberID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling userPhoneNumberGet(Async)"); - } - - // verify the required parameter 'phoneNumberID' is set - if (phoneNumberID == null) { - throw new ApiException("Missing the required parameter 'phoneNumberID' when calling userPhoneNumberGet(Async)"); - } - - return userPhoneNumberGetCall(userID, phoneNumberID, remoteAddress, userAgent, _callback); - - } - - /** - * - * Get a user's phone number - * @param userID ID of user (required) - * @param phoneNumberID ID of phone number (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @return UserPhoneNumberGetRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User phone number found -
0 Error -
- */ - public UserPhoneNumberGetRsp userPhoneNumberGet(String userID, String phoneNumberID, String remoteAddress, String userAgent) throws ApiException { - ApiResponse localVarResp = userPhoneNumberGetWithHttpInfo(userID, phoneNumberID, remoteAddress, userAgent); - return localVarResp.getData(); - } - - /** - * - * Get a user's phone number - * @param userID ID of user (required) - * @param phoneNumberID ID of phone number (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @return ApiResponse<UserPhoneNumberGetRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User phone number found -
0 Error -
- */ - public ApiResponse userPhoneNumberGetWithHttpInfo(String userID, String phoneNumberID, String remoteAddress, String userAgent) throws ApiException { - okhttp3.Call localVarCall = userPhoneNumberGetValidateBeforeCall(userID, phoneNumberID, remoteAddress, userAgent, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Get a user's phone number - * @param userID ID of user (required) - * @param phoneNumberID ID of phone number (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User phone number found -
0 Error -
- */ - public okhttp3.Call userPhoneNumberGetAsync(String userID, String phoneNumberID, String remoteAddress, String userAgent, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userPhoneNumberGetValidateBeforeCall(userID, phoneNumberID, remoteAddress, userAgent, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userStatsList - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for user data -
- */ - public okhttp3.Call userStatsListCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/users/stats"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - if (granularity != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("granularity", granularity)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userStatsListValidateBeforeCall(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'granularity' is set - if (granularity == null) { - throw new ApiException("Missing the required parameter 'granularity' when calling userStatsList(Async)"); - } - - return userStatsListCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Provides aggregated user stats for project - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return UserStatsListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for user data -
- */ - public UserStatsListRsp userStatsList(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = userStatsListWithHttpInfo(granularity, remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Provides aggregated user stats for project - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<UserStatsListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for user data -
- */ - public ApiResponse userStatsListWithHttpInfo(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = userStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Provides aggregated user stats for project - * @param granularity Data granularity (required) - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 Contains a list of all aggregated statistics for user data -
- */ - public okhttp3.Call userStatsListAsync(String granularity, String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userStatsListValidateBeforeCall(granularity, remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for userUpdate - * @param userID ID of user (required) - * @param userUpdateReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User successfully updated -
0 Error -
- */ - public okhttp3.Call userUpdateCall(String userID, UserUpdateReq userUpdateReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = userUpdateReq; - - // create path and map variables - String localVarPath = "/v1/users/{userID}" - .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call userUpdateValidateBeforeCall(String userID, UserUpdateReq userUpdateReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'userID' is set - if (userID == null) { - throw new ApiException("Missing the required parameter 'userID' when calling userUpdate(Async)"); - } - - // verify the required parameter 'userUpdateReq' is set - if (userUpdateReq == null) { - throw new ApiException("Missing the required parameter 'userUpdateReq' when calling userUpdate(Async)"); - } - - return userUpdateCall(userID, userUpdateReq, _callback); - - } - - /** - * - * Updates a user - * @param userID ID of user (required) - * @param userUpdateReq (required) - * @return UserUpdateRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User successfully updated -
0 Error -
- */ - public UserUpdateRsp userUpdate(String userID, UserUpdateReq userUpdateReq) throws ApiException { - ApiResponse localVarResp = userUpdateWithHttpInfo(userID, userUpdateReq); - return localVarResp.getData(); - } - - /** - * - * Updates a user - * @param userID ID of user (required) - * @param userUpdateReq (required) - * @return ApiResponse<UserUpdateRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 User successfully updated -
0 Error -
- */ - public ApiResponse userUpdateWithHttpInfo(String userID, UserUpdateReq userUpdateReq) throws ApiException { - okhttp3.Call localVarCall = userUpdateValidateBeforeCall(userID, userUpdateReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Updates a user - * @param userID ID of user (required) - * @param userUpdateReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 User successfully updated -
0 Error -
- */ - public okhttp3.Call userUpdateAsync(String userID, UserUpdateReq userUpdateReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = userUpdateValidateBeforeCall(userID, userUpdateReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/UsersApi.java b/src/main/java/com/corbado/generated/api/UsersApi.java new file mode 100644 index 0000000..e84eb45 --- /dev/null +++ b/src/main/java/com/corbado/generated/api/UsersApi.java @@ -0,0 +1,1327 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.CredentialList; +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.GenericRsp; +import com.corbado.generated.model.SocialAccount; +import com.corbado.generated.model.SocialAccountCreateReq; +import com.corbado.generated.model.SocialAccountList; +import com.corbado.generated.model.User; +import com.corbado.generated.model.UserCreateReq; +import com.corbado.generated.model.UserUpdateReq; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class UsersApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public UsersApi() { + this(Configuration.getDefaultApiClient()); + } + + public UsersApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for credentialDelete + * @param userID ID of user (required) + * @param credentialID ID of credential (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call credentialDeleteCall(String userID, String credentialID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/users/{userID}/credentials/{credentialID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "credentialID" + "}", localVarApiClient.escapeString(credentialID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call credentialDeleteValidateBeforeCall(String userID, String credentialID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling credentialDelete(Async)"); + } + + // verify the required parameter 'credentialID' is set + if (credentialID == null) { + throw new ApiException("Missing the required parameter 'credentialID' when calling credentialDelete(Async)"); + } + + return credentialDeleteCall(userID, credentialID, _callback); + + } + + /** + * + * Deletes an existing credential (passkey) + * @param userID ID of user (required) + * @param credentialID ID of credential (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp credentialDelete(String userID, String credentialID) throws ApiException { + ApiResponse localVarResp = credentialDeleteWithHttpInfo(userID, credentialID); + return localVarResp.getData(); + } + + /** + * + * Deletes an existing credential (passkey) + * @param userID ID of user (required) + * @param credentialID ID of credential (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse credentialDeleteWithHttpInfo(String userID, String credentialID) throws ApiException { + okhttp3.Call localVarCall = credentialDeleteValidateBeforeCall(userID, credentialID, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Deletes an existing credential (passkey) + * @param userID ID of user (required) + * @param credentialID ID of credential (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call credentialDeleteAsync(String userID, String credentialID, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = credentialDeleteValidateBeforeCall(userID, credentialID, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for credentialList + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of credentials (passkeys) -
0 Error -
+ */ + public okhttp3.Call credentialListCall(String userID, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/users/{userID}/credentials" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call credentialListValidateBeforeCall(String userID, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling credentialList(Async)"); + } + + return credentialListCall(userID, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Returns a list of credentials (passkeys) + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return CredentialList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of credentials (passkeys) -
0 Error -
+ */ + public CredentialList credentialList(String userID, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = credentialListWithHttpInfo(userID, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Returns a list of credentials (passkeys) + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<CredentialList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of credentials (passkeys) -
0 Error -
+ */ + public ApiResponse credentialListWithHttpInfo(String userID, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = credentialListValidateBeforeCall(userID, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Returns a list of credentials (passkeys) + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of credentials (passkeys) -
0 Error -
+ */ + public okhttp3.Call credentialListAsync(String userID, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = credentialListValidateBeforeCall(userID, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for socialAccountCreate + * @param userID ID of user (required) + * @param socialAccountCreateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Social account has been created -
0 Error -
+ */ + public okhttp3.Call socialAccountCreateCall(String userID, SocialAccountCreateReq socialAccountCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = socialAccountCreateReq; + + // create path and map variables + String localVarPath = "/users/{userID}/socialAccounts" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call socialAccountCreateValidateBeforeCall(String userID, SocialAccountCreateReq socialAccountCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling socialAccountCreate(Async)"); + } + + return socialAccountCreateCall(userID, socialAccountCreateReq, _callback); + + } + + /** + * + * Creates a new social account + * @param userID ID of user (required) + * @param socialAccountCreateReq (optional) + * @return SocialAccount + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Social account has been created -
0 Error -
+ */ + public SocialAccount socialAccountCreate(String userID, SocialAccountCreateReq socialAccountCreateReq) throws ApiException { + ApiResponse localVarResp = socialAccountCreateWithHttpInfo(userID, socialAccountCreateReq); + return localVarResp.getData(); + } + + /** + * + * Creates a new social account + * @param userID ID of user (required) + * @param socialAccountCreateReq (optional) + * @return ApiResponse<SocialAccount> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Social account has been created -
0 Error -
+ */ + public ApiResponse socialAccountCreateWithHttpInfo(String userID, SocialAccountCreateReq socialAccountCreateReq) throws ApiException { + okhttp3.Call localVarCall = socialAccountCreateValidateBeforeCall(userID, socialAccountCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Creates a new social account + * @param userID ID of user (required) + * @param socialAccountCreateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Social account has been created -
0 Error -
+ */ + public okhttp3.Call socialAccountCreateAsync(String userID, SocialAccountCreateReq socialAccountCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = socialAccountCreateValidateBeforeCall(userID, socialAccountCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for socialAccountList + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+ */ + public okhttp3.Call socialAccountListCall(String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/socialAccounts"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call socialAccountListValidateBeforeCall(String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + return socialAccountListCall(sort, filter, page, pageSize, _callback); + + } + + /** + * + * Returns a list of social accounts + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return SocialAccountList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+ */ + public SocialAccountList socialAccountList(String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = socialAccountListWithHttpInfo(sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Returns a list of social accounts + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<SocialAccountList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+ */ + public ApiResponse socialAccountListWithHttpInfo(String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = socialAccountListValidateBeforeCall(sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Returns a list of social accounts + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+ */ + public okhttp3.Call socialAccountListAsync(String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = socialAccountListValidateBeforeCall(sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userCreate + * @param userCreateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been created -
0 Error -
+ */ + public okhttp3.Call userCreateCall(UserCreateReq userCreateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userCreateReq; + + // create path and map variables + String localVarPath = "/users"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userCreateValidateBeforeCall(UserCreateReq userCreateReq, final ApiCallback _callback) throws ApiException { + return userCreateCall(userCreateReq, _callback); + + } + + /** + * + * Creates a new user + * @param userCreateReq (optional) + * @return User + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been created -
0 Error -
+ */ + public User userCreate(UserCreateReq userCreateReq) throws ApiException { + ApiResponse localVarResp = userCreateWithHttpInfo(userCreateReq); + return localVarResp.getData(); + } + + /** + * + * Creates a new user + * @param userCreateReq (optional) + * @return ApiResponse<User> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been created -
0 Error -
+ */ + public ApiResponse userCreateWithHttpInfo(UserCreateReq userCreateReq) throws ApiException { + okhttp3.Call localVarCall = userCreateValidateBeforeCall(userCreateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Creates a new user + * @param userCreateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been created -
0 Error -
+ */ + public okhttp3.Call userCreateAsync(UserCreateReq userCreateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userCreateValidateBeforeCall(userCreateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userDelete + * @param userID ID of user (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been deleted -
0 Error -
+ */ + public okhttp3.Call userDeleteCall(String userID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/users/{userID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userDeleteValidateBeforeCall(String userID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userDelete(Async)"); + } + + return userDeleteCall(userID, _callback); + + } + + /** + * + * Deletes a user + * @param userID ID of user (required) + * @return User + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been deleted -
0 Error -
+ */ + public User userDelete(String userID) throws ApiException { + ApiResponse localVarResp = userDeleteWithHttpInfo(userID); + return localVarResp.getData(); + } + + /** + * + * Deletes a user + * @param userID ID of user (required) + * @return ApiResponse<User> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been deleted -
0 Error -
+ */ + public ApiResponse userDeleteWithHttpInfo(String userID) throws ApiException { + okhttp3.Call localVarCall = userDeleteValidateBeforeCall(userID, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Deletes a user + * @param userID ID of user (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been deleted -
0 Error -
+ */ + public okhttp3.Call userDeleteAsync(String userID, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userDeleteValidateBeforeCall(userID, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userGet + * @param userID ID of user (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been returned -
0 Error -
+ */ + public okhttp3.Call userGetCall(String userID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/users/{userID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userGetValidateBeforeCall(String userID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userGet(Async)"); + } + + return userGetCall(userID, _callback); + + } + + /** + * + * Returns a user + * @param userID ID of user (required) + * @return User + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been returned -
0 Error -
+ */ + public User userGet(String userID) throws ApiException { + ApiResponse localVarResp = userGetWithHttpInfo(userID); + return localVarResp.getData(); + } + + /** + * + * Returns a user + * @param userID ID of user (required) + * @return ApiResponse<User> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been returned -
0 Error -
+ */ + public ApiResponse userGetWithHttpInfo(String userID) throws ApiException { + okhttp3.Call localVarCall = userGetValidateBeforeCall(userID, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Returns a user + * @param userID ID of user (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been returned -
0 Error -
+ */ + public okhttp3.Call userGetAsync(String userID, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userGetValidateBeforeCall(userID, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userSocialAccountList + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+ */ + public okhttp3.Call userSocialAccountListCall(String userID, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/users/{userID}/socialAccounts" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userSocialAccountListValidateBeforeCall(String userID, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userSocialAccountList(Async)"); + } + + return userSocialAccountListCall(userID, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Returns a list of social accounts + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return List<SocialAccount> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+ */ + public List userSocialAccountList(String userID, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse> localVarResp = userSocialAccountListWithHttpInfo(userID, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Returns a list of social accounts + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<List<SocialAccount>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+ */ + public ApiResponse> userSocialAccountListWithHttpInfo(String userID, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = userSocialAccountListValidateBeforeCall(userID, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Returns a list of social accounts + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of social accounts -
0 Error -
+ */ + public okhttp3.Call userSocialAccountListAsync(String userID, String sort, List filter, Integer page, Integer pageSize, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = userSocialAccountListValidateBeforeCall(userID, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userUpdate + * @param userID ID of user (required) + * @param userUpdateReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been updated -
0 Error -
+ */ + public okhttp3.Call userUpdateCall(String userID, UserUpdateReq userUpdateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userUpdateReq; + + // create path and map variables + String localVarPath = "/users/{userID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userUpdateValidateBeforeCall(String userID, UserUpdateReq userUpdateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling userUpdate(Async)"); + } + + return userUpdateCall(userID, userUpdateReq, _callback); + + } + + /** + * + * Updates a user + * @param userID ID of user (required) + * @param userUpdateReq (optional) + * @return User + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been updated -
0 Error -
+ */ + public User userUpdate(String userID, UserUpdateReq userUpdateReq) throws ApiException { + ApiResponse localVarResp = userUpdateWithHttpInfo(userID, userUpdateReq); + return localVarResp.getData(); + } + + /** + * + * Updates a user + * @param userID ID of user (required) + * @param userUpdateReq (optional) + * @return ApiResponse<User> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been updated -
0 Error -
+ */ + public ApiResponse userUpdateWithHttpInfo(String userID, UserUpdateReq userUpdateReq) throws ApiException { + okhttp3.Call localVarCall = userUpdateValidateBeforeCall(userID, userUpdateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Updates a user + * @param userID ID of user (required) + * @param userUpdateReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 User has been updated -
0 Error -
+ */ + public okhttp3.Call userUpdateAsync(String userID, UserUpdateReq userUpdateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = userUpdateValidateBeforeCall(userID, userUpdateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/ValidationApi.java b/src/main/java/com/corbado/generated/api/ValidationApi.java deleted file mode 100644 index 39a0577..0000000 --- a/src/main/java/com/corbado/generated/api/ValidationApi.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.ErrorRsp; -import com.corbado.generated.model.ValidateEmailReq; -import com.corbado.generated.model.ValidateEmailRsp; -import com.corbado.generated.model.ValidatePhoneNumberReq; -import com.corbado.generated.model.ValidatePhoneNumberRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class ValidationApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public ValidationApi() { - this(Configuration.getDefaultApiClient()); - } - - public ValidationApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for validateEmail - * @param validateEmailReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email validated -
0 Error -
- */ - public okhttp3.Call validateEmailCall(ValidateEmailReq validateEmailReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = validateEmailReq; - - // create path and map variables - String localVarPath = "/v1/validate/email"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call validateEmailValidateBeforeCall(ValidateEmailReq validateEmailReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'validateEmailReq' is set - if (validateEmailReq == null) { - throw new ApiException("Missing the required parameter 'validateEmailReq' when calling validateEmail(Async)"); - } - - return validateEmailCall(validateEmailReq, _callback); - - } - - /** - * - * Validates email - * @param validateEmailReq (required) - * @return ValidateEmailRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email validated -
0 Error -
- */ - public ValidateEmailRsp validateEmail(ValidateEmailReq validateEmailReq) throws ApiException { - ApiResponse localVarResp = validateEmailWithHttpInfo(validateEmailReq); - return localVarResp.getData(); - } - - /** - * - * Validates email - * @param validateEmailReq (required) - * @return ApiResponse<ValidateEmailRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email validated -
0 Error -
- */ - public ApiResponse validateEmailWithHttpInfo(ValidateEmailReq validateEmailReq) throws ApiException { - okhttp3.Call localVarCall = validateEmailValidateBeforeCall(validateEmailReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Validates email - * @param validateEmailReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Email validated -
0 Error -
- */ - public okhttp3.Call validateEmailAsync(ValidateEmailReq validateEmailReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = validateEmailValidateBeforeCall(validateEmailReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for validatePhoneNumber - * @param validatePhoneNumberReq (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Phone number validated -
0 Error -
- */ - public okhttp3.Call validatePhoneNumberCall(ValidatePhoneNumberReq validatePhoneNumberReq, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = validatePhoneNumberReq; - - // create path and map variables - String localVarPath = "/v1/validate/phoneNumber"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call validatePhoneNumberValidateBeforeCall(ValidatePhoneNumberReq validatePhoneNumberReq, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'validatePhoneNumberReq' is set - if (validatePhoneNumberReq == null) { - throw new ApiException("Missing the required parameter 'validatePhoneNumberReq' when calling validatePhoneNumber(Async)"); - } - - return validatePhoneNumberCall(validatePhoneNumberReq, _callback); - - } - - /** - * - * Validates phone number - * @param validatePhoneNumberReq (required) - * @return ValidatePhoneNumberRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Phone number validated -
0 Error -
- */ - public ValidatePhoneNumberRsp validatePhoneNumber(ValidatePhoneNumberReq validatePhoneNumberReq) throws ApiException { - ApiResponse localVarResp = validatePhoneNumberWithHttpInfo(validatePhoneNumberReq); - return localVarResp.getData(); - } - - /** - * - * Validates phone number - * @param validatePhoneNumberReq (required) - * @return ApiResponse<ValidatePhoneNumberRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Phone number validated -
0 Error -
- */ - public ApiResponse validatePhoneNumberWithHttpInfo(ValidatePhoneNumberReq validatePhoneNumberReq) throws ApiException { - okhttp3.Call localVarCall = validatePhoneNumberValidateBeforeCall(validatePhoneNumberReq, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Validates phone number - * @param validatePhoneNumberReq (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Phone number validated -
0 Error -
- */ - public okhttp3.Call validatePhoneNumberAsync(ValidatePhoneNumberReq validatePhoneNumberReq, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = validatePhoneNumberValidateBeforeCall(validatePhoneNumberReq, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/api/WebhookLogsApi.java b/src/main/java/com/corbado/generated/api/WebhookLogsApi.java deleted file mode 100644 index cd038a1..0000000 --- a/src/main/java/com/corbado/generated/api/WebhookLogsApi.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.api; - -import com.corbado.generated.invoker.ApiCallback; -import com.corbado.generated.invoker.ApiClient; -import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.invoker.ApiResponse; -import com.corbado.generated.invoker.Configuration; -import com.corbado.generated.invoker.Pair; -import com.corbado.generated.invoker.ProgressRequestBody; -import com.corbado.generated.invoker.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import com.corbado.generated.model.ErrorRsp; -import com.corbado.generated.model.WebhookLogsListRsp; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class WebhookLogsApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - public WebhookLogsApi() { - this(Configuration.getDefaultApiClient()); - } - - public WebhookLogsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for webhookLogsList - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Webhook logs successfully retrieved -
0 Error -
- */ - public okhttp3.Call webhookLogsListCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/v1/webhookLogs"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (remoteAddress != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("remoteAddress", remoteAddress)); - } - - if (userAgent != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userAgent", userAgent)); - } - - if (sort != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); - } - - if (filter != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); - } - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (pageSize != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "basicAuth", "projectID", "bearerAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call webhookLogsListValidateBeforeCall(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - return webhookLogsListCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - - } - - /** - * - * Lists webhook logs for given filters - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return WebhookLogsListRsp - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Webhook logs successfully retrieved -
0 Error -
- */ - public WebhookLogsListRsp webhookLogsList(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - ApiResponse localVarResp = webhookLogsListWithHttpInfo(remoteAddress, userAgent, sort, filter, page, pageSize); - return localVarResp.getData(); - } - - /** - * - * Lists webhook logs for given filters - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @return ApiResponse<WebhookLogsListRsp> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 Webhook logs successfully retrieved -
0 Error -
- */ - public ApiResponse webhookLogsListWithHttpInfo(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize) throws ApiException { - okhttp3.Call localVarCall = webhookLogsListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * Lists webhook logs for given filters - * @param remoteAddress Client's remote address (optional) - * @param userAgent Client's user agent (optional) - * @param sort Field sorting (optional) - * @param filter Field filtering (optional) - * @param page Page number (optional, default to 1) - * @param pageSize Number of items per page (optional, default to 10) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 Webhook logs successfully retrieved -
0 Error -
- */ - public okhttp3.Call webhookLogsListAsync(String remoteAddress, String userAgent, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = webhookLogsListValidateBeforeCall(remoteAddress, userAgent, sort, filter, page, pageSize, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/src/main/java/com/corbado/generated/invoker/ApiCallback.java b/src/main/java/com/corbado/generated/invoker/ApiCallback.java index d94711a..bc98235 100644 --- a/src/main/java/com/corbado/generated/invoker/ApiCallback.java +++ b/src/main/java/com/corbado/generated/invoker/ApiCallback.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/corbado/generated/invoker/ApiClient.java b/src/main/java/com/corbado/generated/invoker/ApiClient.java index 602aa61..0f34ac9 100644 --- a/src/main/java/com/corbado/generated/invoker/ApiClient.java +++ b/src/main/java/com/corbado/generated/invoker/ApiClient.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,8 +10,19 @@ * Do not edit the class manually. */ + package com.corbado.generated.invoker; +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -28,1656 +39,1528 @@ import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; import java.text.DateFormat; import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.Map.Entry; -import java.util.Objects; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.KeyManager; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.TrustManagerFactory; -import javax.net.ssl.X509TrustManager; - -import com.corbado.generated.invoker.auth.ApiKeyAuth; import com.corbado.generated.invoker.auth.Authentication; import com.corbado.generated.invoker.auth.HttpBasicAuth; import com.corbado.generated.invoker.auth.HttpBearerAuth; +import com.corbado.generated.invoker.auth.ApiKeyAuth; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Headers; -import okhttp3.Interceptor; -import okhttp3.MediaType; -import okhttp3.MultipartBody; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.internal.http.HttpMethod; -import okhttp3.internal.tls.OkHostnameVerifier; -import okhttp3.logging.HttpLoggingInterceptor; -import okhttp3.logging.HttpLoggingInterceptor.Level; -import okio.Buffer; -import okio.BufferedSink; -import okio.Okio; - -/** ApiClient class. */ +/** + *

ApiClient class.

+ */ public class ApiClient { - private String basePath = "https://backendapi.corbado.io"; - protected List servers = - new ArrayList<>( - Arrays.asList( - new ServerConfiguration( - "https://backendapi.corbado.io", "No description provided", new HashMap<>()))); - protected Integer serverIndex = 0; - protected Map serverVariables = null; - private boolean debugging = false; - private final Map defaultHeaderMap = new HashMap<>(); - private final Map defaultCookieMap = new HashMap<>(); - private String tempFolderPath = null; - - private Map authentications; - - private DateFormat dateFormat; - private DateFormat datetimeFormat; - private boolean lenientDatetimeFormat; - private int dateLength; - - private InputStream sslCaCert; - private boolean verifyingSsl; - private KeyManager[] keyManagers; - - private OkHttpClient httpClient; - private JSON json; - - private HttpLoggingInterceptor loggingInterceptor; - - /** Basic constructor for ApiClient */ - public ApiClient() { - init(); - initHttpClient(); - - // Setup authentications (key: authentication name, value: authentication). - authentications.put("basicAuth", new HttpBasicAuth()); - authentications.put("bearerAuth", new HttpBearerAuth("bearer")); - authentications.put("projectID", new ApiKeyAuth("header", "X-Corbado-ProjectID")); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - /** - * Basic constructor with custom OkHttpClient - * - * @param client a {@link okhttp3.OkHttpClient} object - */ - public ApiClient(final OkHttpClient client) { - init(); - - httpClient = client; - - // Setup authentications (key: authentication name, value: authentication). - authentications.put("basicAuth", new HttpBasicAuth()); - authentications.put("bearerAuth", new HttpBearerAuth("bearer")); - authentications.put("projectID", new ApiKeyAuth("header", "X-Corbado-ProjectID")); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - /** - * Add a default cookie. - * - * @param key The cookie's key - * @param value The cookie's value - * @return ApiClient - */ - public ApiClient addDefaultCookie(final String key, final String value) { - defaultCookieMap.put(key, value); - return this; - } - - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return ApiClient - */ - public ApiClient addDefaultHeader(final String key, final String value) { - defaultHeaderMap.put(key, value); - return this; - } - - /** - * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. - * - * @param mpBuilder MultipartBody.Builder - * @param key The key of the Header element - * @param file The file to add to the Header - */ - private void addPartToMultiPartBuilder( - final MultipartBody.Builder mpBuilder, final String key, final File file) { - final Headers partHeaders = - Headers.of( - "Content-Disposition", - "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); - final MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); - mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); - } - - /** - * Add a Content-Disposition Header for the given key and complex object to the MultipartBody - * Builder. - * - * @param mpBuilder MultipartBody.Builder - * @param key The key of the Header element - * @param obj The complex object to add to the Header - */ - private void addPartToMultiPartBuilder( - final MultipartBody.Builder mpBuilder, final String key, final Object obj) { - RequestBody requestBody; - if (obj instanceof String) { - requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); - } else { - String content; - if (obj != null) { - content = JSON.serialize(obj); - } else { - content = null; - } - requestBody = RequestBody.create(content, MediaType.parse("application/json")); - } - - final Headers partHeaders = - Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); - mpBuilder.addPart(partHeaders, requestBody); - } - - /** - * Apply SSL related settings to httpClient according to the current values of verifyingSsl and - * sslCaCert. - */ - private void applySslSettings() { - try { - TrustManager[] trustManagers; - HostnameVerifier hostnameVerifier; - if (!verifyingSsl) { - trustManagers = - new TrustManager[] { - new X509TrustManager() { - @Override - public void checkClientTrusted( - final java.security.cert.X509Certificate[] chain, final String authType) - throws CertificateException {} - - @Override - public void checkServerTrusted( - final java.security.cert.X509Certificate[] chain, final String authType) - throws CertificateException {} - - @Override - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[] {}; + private String basePath = "https://backendapi.corbado.io/v2"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "https://backendapi.corbado.io/v2", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("basicAuth", new HttpBasicAuth()); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("basicAuth", new HttpBasicAuth()); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1.0.0/java"); + + authentications = new HashMap(); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g https://backendapi.corbado.io/v2 + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

Getter for the field keyManagers.

+ * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + *

Getter for the field dateFormat.

+ * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + *

Setter for the field dateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link com.corbado.generated.invoker.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + JSON.setDateFormat(dateFormat); + return this; + } + + /** + *

Set SqlDateFormat.

+ * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link com.corbado.generated.invoker.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + JSON.setSqlDateFormat(dateFormat); + return this; + } + + /** + *

Set OffsetDateTimeFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link com.corbado.generated.invoker.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

Set LocalDateFormat.

+ * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link com.corbado.generated.invoker.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateFormat(dateFormat); + return this; + } + + /** + *

Set LenientOnJson.

+ * + * @param lenientOnJson a boolean + * @return a {@link com.corbado.generated.invoker.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + JSON.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = JSON.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); } - } - }; - hostnameVerifier = (hostname, session) -> true; - } else { - final TrustManagerFactory trustManagerFactory = - TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - - if (sslCaCert == null) { - trustManagerFactory.init((KeyStore) null); + b.append(o); + } + return b.toString(); } else { - final char[] password = null; // Any password will work. - final CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); - final Collection certificates = - certificateFactory.generateCertificates(sslCaCert); - if (certificates.isEmpty()) { - throw new IllegalArgumentException("expected non-empty set of trusted certificates"); - } - final KeyStore caKeyStore = newEmptyKeyStore(password); - int index = 0; - for (final Certificate certificate : certificates) { - final String certificateAlias = "ca" + (index++); - caKeyStore.setCertificateEntry(certificateAlias, certificate); - } - trustManagerFactory.init(caKeyStore); + return String.valueOf(param); } - trustManagers = trustManagerFactory.getTrustManagers(); - hostnameVerifier = OkHostnameVerifier.INSTANCE; - } - - final SSLContext sslContext = SSLContext.getInstance("TLS"); - sslContext.init(keyManagers, trustManagers, new SecureRandom()); - httpClient = - httpClient - .newBuilder() - .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) - .hostnameVerifier(hostnameVerifier) - .build(); - } catch (final GeneralSecurityException e) { - throw new RuntimeException(e); - } - } - - /** - * Build HTTP call with the given options. - * - * @param baseUrl The base URL - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and - * "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP call - * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object - */ - public Call buildCall( - final String baseUrl, - final String path, - final String method, - final List queryParams, - final List collectionQueryParams, - final Object body, - final Map headerParams, - final Map cookieParams, - final Map formParams, - final String[] authNames, - final ApiCallback callback) - throws ApiException { - final Request request = - buildRequest( - baseUrl, - path, - method, - queryParams, - collectionQueryParams, - body, - headerParams, - cookieParams, - formParams, - authNames, - callback); - - return httpClient.newCall(request); - } - - /** - * Build an HTTP request with the given options. - * - * @param baseUrl The base URL - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and - * "DELETE" - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param authNames The authentications to apply - * @param callback Callback for upload/download progress - * @return The HTTP request - * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object - */ - public Request buildRequest( - final String baseUrl, - final String path, - final String method, - final List queryParams, - final List collectionQueryParams, - final Object body, - final Map headerParams, - final Map cookieParams, - final Map formParams, - final String[] authNames, - final ApiCallback callback) - throws ApiException { - // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams - final List allQueryParams = new ArrayList<>(queryParams); - allQueryParams.addAll(collectionQueryParams); - - final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); - - // prepare HTTP request body - RequestBody reqBody; - final String contentType = headerParams.get("Content-Type"); - String contentTypePure = contentType; - if (contentTypePure != null && contentTypePure.contains(";")) { - contentTypePure = contentType.substring(0, contentType.indexOf(";")); - } - if (!HttpMethod.permitsRequestBody(method)) { - reqBody = null; - } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { - reqBody = buildRequestBodyFormEncoding(formParams); - } else if ("multipart/form-data".equals(contentTypePure)) { - reqBody = buildRequestBodyMultipart(formParams); - } else if (body == null) { - if ("DELETE".equals(method)) { - // allow calling DELETE without sending a request body - reqBody = null; - } else { - // use an empty request body (for POST, PUT and PATCH) - reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); - } - } else { - reqBody = serialize(body, contentType); - } - - // update parameters with authentication settings - updateParamsForAuth( - authNames, - allQueryParams, - headerParams, - cookieParams, - requestBodyToString(reqBody), - method, - URI.create(url)); - - final Request.Builder reqBuilder = new Request.Builder().url(url); - processHeaderParams(headerParams, reqBuilder); - processCookieParams(cookieParams, reqBuilder); - - // Associate callback with request (if not null) so interceptor can - // access it when creating ProgressResponseBody - reqBuilder.tag(callback); - - Request request = null; - - if (callback != null && reqBody != null) { - final ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); - request = reqBuilder.method(method, progressRequestBody).build(); - } else { - request = reqBuilder.method(method, reqBody).build(); - } - - return request; - } - - /** - * Build a form-encoding request body with the given form parameters. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyFormEncoding(final Map formParams) { - final okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); - for (final Entry param : formParams.entrySet()) { - formBuilder.add(param.getKey(), parameterToString(param.getValue())); - } - return formBuilder.build(); - } - - /** - * Build a multipart (file uploading) request body with the given form parameters, which could - * contain text fields and file fields. - * - * @param formParams Form parameters in the form of Map - * @return RequestBody - */ - public RequestBody buildRequestBodyMultipart(final Map formParams) { - final MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); - for (final Entry param : formParams.entrySet()) { - if (param.getValue() instanceof File) { - final File file = (File) param.getValue(); - addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); - } else if (param.getValue() instanceof List) { - final List list = (List) param.getValue(); - for (final Object item : list) { - if (item instanceof File) { - addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); - } else { - addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); - } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); } - } else { - addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); - } - } - return mpBuilder.build(); - } - - /** - * Build full URL by concatenating base path, the given sub path and query parameters. - * - * @param baseUrl The base URL - * @param path The sub path - * @param queryParams The query parameters - * @param collectionQueryParams The collection query parameters - * @return The full URL - */ - public String buildUrl( - final String baseUrl, - final String path, - final List queryParams, - final List collectionQueryParams) { - final StringBuilder url = new StringBuilder(); - if (baseUrl != null) { - url.append(baseUrl).append(path); - } else { - String baseURL; - if (serverIndex != null) { - if (serverIndex < 0 || serverIndex >= servers.size()) { - throw new ArrayIndexOutOfBoundsException( - String.format( - "Invalid index %d when selecting the host settings. Must be less than %d", - serverIndex, servers.size())); + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); } - baseURL = servers.get(serverIndex).URL(serverVariables); - } else { - baseURL = basePath; - } - url.append(baseURL).append(path); - } - - if (queryParams != null && !queryParams.isEmpty()) { - // support (constant) query string in `path`, e.g. "/posts?draft=1" - String prefix = path.contains("?") ? "&" : "?"; - for (final Pair param : queryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - final String value = parameterToString(param.getValue()); - url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; } - } - } - - if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { - String prefix = url.toString().contains("?") ? "&" : "?"; - for (final Pair param : collectionQueryParams) { - if (param.getValue() != null) { - if (prefix != null) { - url.append(prefix); - prefix = null; - } else { - url.append("&"); - } - final String value = parameterToString(param.getValue()); - // collection query parameter value already escaped as part of parameterToPairs - url.append(escapeString(param.getName())).append("=").append(value); + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); } - } - } - - return url.toString(); - } - - /** - * Formats the specified collection path parameter to a string value. - * - * @param collectionFormat The collection format of the parameter. - * @param value The value of the parameter. - * @return String representation of the parameter - */ - public String collectionPathParameterToString( - final String collectionFormat, final Collection value) { - // create the value based on the collection format - if ("multi".equals(collectionFormat)) { - // not valid for path params - return parameterToString(value); - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - if ("ssv".equals(collectionFormat)) { - delimiter = " "; - } else if ("tsv".equals(collectionFormat)) { - delimiter = "\t"; - } else if ("pipes".equals(collectionFormat)) { - delimiter = "|"; - } - - final StringBuilder sb = new StringBuilder(); - for (final Object item : value) { - sb.append(delimiter); - sb.append(parameterToString(item)); - } - - return sb.substring(delimiter.length()); - } - - /** - * Deserialize response body to Java object, according to the return type and the Content-Type - * response header. - * - * @param Type - * @param response HTTP response - * @param returnType The type of the Java object - * @return The deserialized Java object - * @throws com.corbado.generated.invoker.ApiException If fail to deserialize response body, i.e. - * cannot read response body or the Content-Type of the response is not supported. - */ - @SuppressWarnings("unchecked") - public T deserialize(final Response response, final Type returnType) throws ApiException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - try { - return (T) response.body().bytes(); - } catch (final IOException e) { - throw new ApiException(e); - } - } else if (returnType.equals(File.class)) { - // Handle file downloading. - return (T) downloadFileFromResponse(response); - } - - String respBody; - try { - if (response.body() != null) { - respBody = response.body().string(); - } else { - respBody = null; - } - } catch (final IOException e) { - throw new ApiException(e); - } - - if (respBody == null || "".equals(respBody)) { - return null; - } - - String contentType = response.headers().get("Content-Type"); - if (contentType == null) { - // ensuring a default content type - contentType = "application/json"; - } - if (isJsonMime(contentType)) { - return JSON.deserialize(respBody, returnType); - } else if (returnType.equals(String.class)) { - // Expecting string, return the raw response body. - return (T) respBody; - } else { - throw new ApiException( - "Content type \"" + contentType + "\" is not supported for type: " + returnType, - response.code(), - response.headers().toMultimap(), - respBody); - } - } - - /** - * Download file from the given response. - * - * @param response An instance of the Response object - * @throws com.corbado.generated.invoker.ApiException If fail to read file content from response - * and write to disk - * @return Downloaded file - */ - public File downloadFileFromResponse(final Response response) throws ApiException { - try { - final File file = prepareDownloadFile(response); - final BufferedSink sink = Okio.buffer(Okio.sink(file)); - sink.writeAll(response.body().source()); - sink.close(); - return file; - } catch (final IOException e) { - throw new ApiException(e); - } - } - - /** - * Escape the given string to be used as URL query value. - * - * @param str String to be escaped - * @return Escaped string - */ - public String escapeString(final String str) { - try { - return URLEncoder.encode(str, "utf8").replace("+", "%20"); - } catch (final UnsupportedEncodingException e) { - return str; - } - } - - /** - * {@link #execute(Call, Type)} - * - * @param Type - * @param call An instance of the Call object - * @return ApiResponse<T> - * @throws com.corbado.generated.invoker.ApiException If fail to execute the call - */ - public ApiResponse execute(final Call call) throws ApiException { - return execute(call, null); - } - - /** - * Execute HTTP call and deserialize the HTTP response body into the given return type. - * - * @param returnType The return type used to deserialize HTTP response body - * @param The return type corresponding to (same with) returnType - * @param call Call - * @return ApiResponse object containing response status, headers and data, which is a Java object - * deserialized from response body and would be null when returnType is null. - * @throws com.corbado.generated.invoker.ApiException If fail to execute the call - */ - public ApiResponse execute(final Call call, final Type returnType) throws ApiException { - try { - final Response response = call.execute(); - final T data = handleResponse(response, returnType); - return new ApiResponse<>(response.code(), response.headers().toMultimap(), data); - } catch (final IOException e) { - throw new ApiException(e); - } - } - - /** - * {@link #executeAsync(Call, Type, ApiCallback)} - * - * @param Type - * @param call An instance of the Call object - * @param callback ApiCallback<T> - */ - public void executeAsync(final Call call, final ApiCallback callback) { - executeAsync(call, null, callback); - } - - /** - * Execute HTTP call asynchronously. - * - * @param Type - * @param call The callback to be executed when the API call finishes - * @param returnType Return type - * @param callback ApiCallback - * @see #execute(Call, Type) - */ - @SuppressWarnings("unchecked") - public void executeAsync( - final Call call, final Type returnType, final ApiCallback callback) { - call.enqueue( - new Callback() { - @Override - public void onFailure(final Call call, final IOException e) { - callback.onFailure(new ApiException(e), 0, null); - } - - @Override - public void onResponse(final Call call, final Response response) throws IOException { - T result; + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws com.corbado.generated.invoker.ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). try { - result = (T) handleResponse(response, returnType); - } catch (final ApiException e) { - callback.onFailure(e, response.code(), response.headers().toMultimap()); - return; - } catch (final Exception e) { - callback.onFailure( - new ApiException(e), response.code(), response.headers().toMultimap()); - return; + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); } - callback.onSuccess(result, response.code(), response.headers().toMultimap()); - } - }); - } - - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(final String authName) { - return authentications.get(authName); - } - - /** - * Get authentications (key: authentication name, value: authentication). - * - * @return Map of authentication objects - */ - public Map getAuthentications() { - return authentications; - } - - /** - * Get base path - * - * @return Base path - */ - public String getBasePath() { - return basePath; - } - - /** - * Get connection timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getConnectTimeout() { - return httpClient.connectTimeoutMillis(); - } - - /** - * Getter for the field dateFormat. - * - * @return a {@link java.text.DateFormat} object - */ - public DateFormat getDateFormat() { - return dateFormat; - } - - /** - * Get HTTP client - * - * @return An instance of OkHttpClient - */ - public OkHttpClient getHttpClient() { - return httpClient; - } - - /** - * Get JSON - * - * @return JSON object - */ - public JSON getJSON() { - return json; - } - - /** - * Getter for the field keyManagers. - * - * @return an array of {@link javax.net.ssl.KeyManager} objects - */ - public KeyManager[] getKeyManagers() { - return keyManagers; - } - - /** - * Get network interceptor to add it to the httpClient to track download progress for async - * requests. - */ - private Interceptor getProgressInterceptor() { - return chain -> { - final Request request = chain.request(); - final Response originalResponse = chain.proceed(request); - if (request.tag() instanceof ApiCallback) { - final ApiCallback callback = (ApiCallback) request.tag(); - return originalResponse - .newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), callback)) - .build(); - } - return originalResponse; - }; - } - - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout() { - return httpClient.readTimeoutMillis(); - } - - public Integer getServerIndex() { - return serverIndex; - } - - public List getServers() { - return servers; - } - - public Map getServerVariables() { - return serverVariables; - } - - /** - * Get SSL CA cert. - * - * @return Input stream to the SSL CA cert - */ - public InputStream getSslCaCert() { - return sslCaCert; - } - - /** - * The path of temporary folder used to store downloaded files from endpoints with file response. - * The default value is null, i.e. using the system's default temporary folder. - * - * @see createTempFile - * @return Temporary folder path - */ - public String getTempFolderPath() { - return tempFolderPath; - } - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout() { - return httpClient.writeTimeoutMillis(); - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - public String guessContentTypeFromFile(final File file) { - final String contentType = URLConnection.guessContentTypeFromName(file.getName()); - if (contentType == null) { - return "application/octet-stream"; - } else { - return contentType; - } - } - - /** - * Handle the given response, return the deserialized object when the response is successful. - * - * @param Type - * @param response Response - * @param returnType Return type - * @return Type - * @throws com.corbado.generated.invoker.ApiException If the response has an unsuccessful status - * code or fail to deserialize the response body - */ - public T handleResponse(final Response response, final Type returnType) throws ApiException { - if (response.isSuccessful()) { - if (returnType == null || response.code() == 204) { - // returning null if the returnType is not defined, - // or the status code is 204 (No Content) - if (response.body() != null) { - try { - response.body().close(); - } catch (final Exception e) { + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { throw new ApiException( - response.message(), e, response.code(), response.headers().toMultimap()); - } + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws com.corbado.generated.invoker.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); } - return null; - } else { - return deserialize(response, returnType); - } - } else { - String respBody = null; - if (response.body() != null) { + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws com.corbado.generated.invoker.ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { try { - respBody = response.body().string(); - } catch (final IOException e) { - throw new ApiException( - response.message(), e, response.code(), response.headers().toMultimap()); + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); } - } - throw new ApiException( - response.message(), response.code(), response.headers().toMultimap(), respBody); - } - } - - private void init() { - verifyingSsl = true; - - json = new JSON(); - - // Set default User-Agent. - setUserAgent("OpenAPI-Generator/1.0.0/java"); - - authentications = new HashMap<>(); - } - - private void initHttpClient() { - initHttpClient(Collections.emptyList()); - } - - private void initHttpClient(final List interceptors) { - final OkHttpClient.Builder builder = new OkHttpClient.Builder(); - builder.addNetworkInterceptor(getProgressInterceptor()); - for (final Interceptor interceptor : interceptors) { - builder.addInterceptor(interceptor); - } - - httpClient = builder.build(); - } - - /** - * Check that whether debugging is enabled for this API client. - * - * @return True if debugging is enabled, false otherwise. - */ - public boolean isDebugging() { - return debugging; - } - - /** - * Check if the given MIME is a JSON MIME. JSON MIME examples: application/json application/json; - * charset=UTF8 APPLICATION/JSON application/vnd.company+json "* / *" is also default to JSON - * - * @param mime MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public boolean isJsonMime(final String mime) { - final String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || "*/*".equals(mime)); - } - - /** - * True if isVerifyingSsl flag is on - * - * @return True if isVerifySsl flag is on - */ - public boolean isVerifyingSsl() { - return verifyingSsl; - } - - private KeyStore newEmptyKeyStore(final char[] password) throws GeneralSecurityException { - try { - final KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - keyStore.load(null, password); - return keyStore; - } catch (final IOException e) { - throw new AssertionError(e); - } - } - - /** - * Formats the specified query parameter to a list containing a single {@code Pair} object. - * - *

Note that {@code value} must not be a collection. - * - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list containing a single {@code Pair} object. - */ - public List parameterToPair(final String name, final Object value) { - final List params = new ArrayList<>(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value instanceof Collection) { - return params; - } - - params.add(new Pair(name, parameterToString(value))); - return params; - } - - /** - * Formats the specified collection query parameters to a list of {@code Pair} objects. - * - *

Note that the values of each of the returned Pair objects are percent-encoded. - * - * @param collectionFormat The collection format of the parameter. - * @param name The name of the parameter. - * @param value The value of the parameter. - * @return A list of {@code Pair} objects. - */ - public List parameterToPairs( - final String collectionFormat, final String name, final Collection value) { - final List params = new ArrayList<>(); - - // preconditions - if (name == null || name.isEmpty() || value == null || value.isEmpty()) { - return params; - } - - // create the params based on the collection format - if ("multi".equals(collectionFormat)) { - for (final Object item : value) { - params.add(new Pair(name, escapeString(parameterToString(item)))); - } - return params; - } - - // collectionFormat is assumed to be "csv" by default - String delimiter = ","; - - // escape all delimiters except commas, which are URI reserved - // characters - if ("ssv".equals(collectionFormat)) { - delimiter = escapeString(" "); - } else if ("tsv".equals(collectionFormat)) { - delimiter = escapeString("\t"); - } else if ("pipes".equals(collectionFormat)) { - delimiter = escapeString("|"); - } - - final StringBuilder sb = new StringBuilder(); - for (final Object item : value) { - sb.append(delimiter); - sb.append(escapeString(parameterToString(item))); - } - - params.add(new Pair(name, sb.substring(delimiter.length()))); - - return params; - } - - /** - * Format the given parameter object into string. - * - * @param param Parameter - * @return String representation of the parameter - */ - public String parameterToString(final Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date - || param instanceof OffsetDateTime - || param instanceof LocalDate) { - // Serialize to json string and remove the " enclosing characters - final String jsonStr = JSON.serialize(param); - return jsonStr.substring(1, jsonStr.length() - 1); - } else if (param instanceof Collection) { - final StringBuilder b = new StringBuilder(); - for (final Object o : (Collection) param) { - if (b.length() > 0) { - b.append(","); + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } } - b.append(o); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /** - * Prepare file for download - * - * @param response An instance of the Response object - * @return Prepared file for the download - * @throws java.io.IOException If fail to prepare file for download - */ - public File prepareDownloadFile(final Response response) throws IOException { - String filename = null; - final String contentDisposition = response.header("Content-Disposition"); - if (contentDisposition != null && !"".equals(contentDisposition)) { - // Get filename from the Content-Disposition header. - final Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - final Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) { - filename = sanitizeFilename(matcher.group(1)); - } - } - - String prefix = null; - String suffix = null; - if (filename == null) { - prefix = "download-"; - suffix = ""; - } else { - final int pos = filename.lastIndexOf("."); - if (pos == -1) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) { - prefix = "download-"; - } - } - - if (tempFolderPath == null) { - return Files.createTempFile(prefix, suffix).toFile(); - } else { - return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); - } - } - - /** - * Set cookie parameters to the request builder, including default cookies. - * - * @param cookieParams Cookie parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processCookieParams( - final Map cookieParams, final Request.Builder reqBuilder) { - for (final Entry param : cookieParams.entrySet()) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - for (final Entry param : defaultCookieMap.entrySet()) { - if (!cookieParams.containsKey(param.getKey())) { - reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); - } - } - } - - /** - * Set header parameters to the request builder, including default headers. - * - * @param headerParams Header parameters in the form of Map - * @param reqBuilder Request.Builder - */ - public void processHeaderParams( - final Map headerParams, final Request.Builder reqBuilder) { - for (final Entry param : headerParams.entrySet()) { - reqBuilder.header(param.getKey(), parameterToString(param.getValue())); - } - for (final Entry header : defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(header.getKey())) { - reqBuilder.header(header.getKey(), parameterToString(header.getValue())); - } - } - } - - /** - * Convert the HTTP request body to a string. - * - * @param requestBody The HTTP request object - * @return The string representation of the HTTP request body - * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object - * into a string - */ - private String requestBodyToString(final RequestBody requestBody) throws ApiException { - if (requestBody != null) { - try { - final Buffer buffer = new Buffer(); - requestBody.writeTo(buffer); - return buffer.readUtf8(); - } catch (final IOException e) { - throw new ApiException(e); - } - } - - // empty http request body - return ""; - } - - /** - * Sanitize filename by removing path. e.g. ../../sun.gif becomes sun.gif - * - * @param filename The filename to be sanitized - * @return The sanitized filename - */ - public String sanitizeFilename(final String filename) { - return filename.replaceAll(".*[/\\\\]", ""); - } - - /** - * Select the Accept header's value from the given accepts array: if JSON exists in the given - * array, use it; otherwise use all of them (joining into a string) - * - * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, null will be returned (not to - * set the Accept header explicitly). - */ - public String selectHeaderAccept(final String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (final String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } - } - return StringUtil.join(accepts, ","); - } - - /** - * Select the Content-Type header's value from the given array: if JSON exists in the given array, - * use it; otherwise use the first one of the array. - * - * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, returns null. If it - * matches "any", JSON will be used. - */ - public String selectHeaderContentType(final String[] contentTypes) { - if (contentTypes.length == 0) { - return null; - } - - if ("*/*".equals(contentTypes[0])) { - return "application/json"; - } - - for (final String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } - } - - return contentTypes[0]; - } - - /** - * Serialize the given Java object into request body according to the object's class and the - * request Content-Type. - * - * @param obj The Java object - * @param contentType The request Content-Type - * @return The serialized request body - * @throws com.corbado.generated.invoker.ApiException If fail to serialize the given object - */ - public RequestBody serialize(final Object obj, final String contentType) throws ApiException { - if (obj instanceof byte[]) { - // Binary (byte array) body parameter support. - return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); - } else if (obj instanceof File) { - // File body parameter support. - return RequestBody.create((File) obj, MediaType.parse(contentType)); - } else if ("text/plain".equals(contentType) && obj instanceof String) { - return RequestBody.create((String) obj, MediaType.parse(contentType)); - } else if (isJsonMime(contentType)) { - String content; - if (obj != null) { - content = JSON.serialize(obj); - } else { - content = null; - } - return RequestBody.create(content, MediaType.parse(contentType)); - } else if (obj instanceof String) { - return RequestBody.create((String) obj, MediaType.parse(contentType)); - } else { - throw new ApiException("Content type \"" + contentType + "\" is not supported"); - } - } - - /** - * Helper method to set access token for the first OAuth2 authentication. - * - * @param accessToken Access token - */ - public void setAccessToken(final String accessToken) { - throw new RuntimeException("No OAuth2 authentication configured!"); - } - - /** - * Helper method to set API key value for the first API key authentication. - * - * @param apiKey API key - */ - public void setApiKey(final String apiKey) { - for (final Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set API key prefix for the first API key authentication. - * - * @param apiKeyPrefix API key prefix - */ - public void setApiKeyPrefix(final String apiKeyPrefix) { - for (final Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set credentials for AWSV4 Signature - * - * @param accessKey Access Key - * @param secretKey Secret Key - * @param region Region - * @param service Service to access to - */ - public void setAWS4Configuration( - final String accessKey, final String secretKey, final String region, final String service) { - throw new RuntimeException("No AWS4 authentication configured!"); - } - - /** - * Helper method to set credentials for AWSV4 Signature - * - * @param accessKey Access Key - * @param secretKey Secret Key - * @param sessionToken Session Token - * @param region Region - * @param service Service to access to - */ - public void setAWS4Configuration( - final String accessKey, - final String secretKey, - final String sessionToken, - final String region, - final String service) { - throw new RuntimeException("No AWS4 authentication configured!"); - } - - /** - * Set base path - * - * @param basePath Base path of the URL (e.g https://backendapi.corbado.io - * @return An instance of OkHttpClient - */ - public ApiClient setBasePath(final String basePath) { - this.basePath = basePath; - this.serverIndex = null; - return this; - } - - /** - * Helper method to set access token for the first Bearer authentication. - * - * @param bearerToken Bearer token - */ - public void setBearerToken(final String bearerToken) { - setBearerToken(() -> bearerToken); - } - - /** - * Helper method to set the supplier of access tokens for Bearer authentication. - * - * @param tokenSupplier The supplier of bearer tokens - */ - public void setBearerToken(final Supplier tokenSupplier) { - for (final Authentication auth : authentications.values()) { - if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(tokenSupplier); - return; - } - } - throw new RuntimeException("No Bearer authentication configured!"); - } - - /** - * Sets the connect timeout (in milliseconds). A value of 0 means no timeout, otherwise values - * must be between 1 and {@link java.lang.Integer#MAX_VALUE}. - * - * @param connectionTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setConnectTimeout(final int connectionTimeout) { - httpClient = - httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Setter for the field dateFormat. - * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link com.corbado.generated.invoker.ApiClient} object - */ - public ApiClient setDateFormat(final DateFormat dateFormat) { - JSON.setDateFormat(dateFormat); - return this; - } - - /** - * Enable/disable debugging for this API client. - * - * @param debugging To enable (true) or disable (false) debugging - * @return ApiClient - */ - public ApiClient setDebugging(final boolean debugging) { - if (debugging != this.debugging) { - if (debugging) { - loggingInterceptor = new HttpLoggingInterceptor(); - loggingInterceptor.setLevel(Level.BODY); - httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); - } else { - final OkHttpClient.Builder builder = httpClient.newBuilder(); - builder.interceptors().remove(loggingInterceptor); - httpClient = builder.build(); - loggingInterceptor = null; - } - } - this.debugging = debugging; - return this; - } - - /** - * Set HTTP client, which must never be null. - * - * @param newHttpClient An instance of OkHttpClient - * @return Api Client - * @throws java.lang.NullPointerException when newHttpClient is null - */ - public ApiClient setHttpClient(final OkHttpClient newHttpClient) { - this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); - return this; - } - - /** - * Set JSON - * - * @param json JSON object - * @return Api client - */ - public ApiClient setJSON(final JSON json) { - this.json = json; - return this; - } - - /** - * Configure client keys to use for authorization in an SSL session. Use null to reset to default. - * - * @param managers The KeyManagers to use - * @return ApiClient - */ - public ApiClient setKeyManagers(final KeyManager[] managers) { - this.keyManagers = managers; - applySslSettings(); - return this; - } - - /** - * Set LenientOnJson. - * - * @param lenientOnJson a boolean - * @return a {@link com.corbado.generated.invoker.ApiClient} object - */ - public ApiClient setLenientOnJson(final boolean lenientOnJson) { - JSON.setLenientOnJson(lenientOnJson); - return this; - } - - /** - * Set LocalDateFormat. - * - * @param dateFormat a {@link java.time.format.DateTimeFormatter} object - * @return a {@link com.corbado.generated.invoker.ApiClient} object - */ - public ApiClient setLocalDateFormat(final DateTimeFormatter dateFormat) { - JSON.setLocalDateFormat(dateFormat); - return this; - } - - /** - * Set OffsetDateTimeFormat. - * - * @param dateFormat a {@link java.time.format.DateTimeFormatter} object - * @return a {@link com.corbado.generated.invoker.ApiClient} object - */ - public ApiClient setOffsetDateTimeFormat(final DateTimeFormatter dateFormat) { - JSON.setOffsetDateTimeFormat(dateFormat); - return this; - } - - /** - * Helper method to set password for the first HTTP basic authentication. - * - * @param password Password - */ - public void setPassword(final String password) { - for (final Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Sets the read timeout (in milliseconds). A value of 0 means no timeout, otherwise values must - * be between 1 and {@link java.lang.Integer#MAX_VALUE}. - * - * @param readTimeout read timeout in milliseconds - * @return Api client - */ - public ApiClient setReadTimeout(final int readTimeout) { - httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - public ApiClient setServerIndex(final Integer serverIndex) { - this.serverIndex = serverIndex; - return this; - } - - public ApiClient setServers(final List servers) { - this.servers = servers; - return this; - } - - public ApiClient setServerVariables(final Map serverVariables) { - this.serverVariables = serverVariables; - return this; - } - - /** - * Set SqlDateFormat. - * - * @param dateFormat a {@link java.text.DateFormat} object - * @return a {@link com.corbado.generated.invoker.ApiClient} object - */ - public ApiClient setSqlDateFormat(final DateFormat dateFormat) { - JSON.setSqlDateFormat(dateFormat); - return this; - } - - /** - * Configure the CA certificate to be trusted when making https requests. Use null to reset to - * default. - * - * @param sslCaCert input stream for SSL CA cert - * @return ApiClient - */ - public ApiClient setSslCaCert(final InputStream sslCaCert) { - this.sslCaCert = sslCaCert; - applySslSettings(); - return this; - } - - /** - * Set the temporary folder path (for downloading files) - * - * @param tempFolderPath Temporary folder path - * @return ApiClient - */ - public ApiClient setTempFolderPath(final String tempFolderPath) { - this.tempFolderPath = tempFolderPath; - return this; - } - - /** - * Set the User-Agent header's value (by adding to the default header map). - * - * @param userAgent HTTP request's user agent - * @return ApiClient - */ - public ApiClient setUserAgent(final String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; - } - - /** - * Helper method to set username for the first HTTP basic authentication. - * - * @param username Username - */ - public void setUsername(final String username) { - for (final Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Configure whether to verify certificate and hostname when making https requests. Default to - * true. NOTE: Do NOT set to false in production code, otherwise you would face multiple types of - * cryptographic attacks. - * - * @param verifyingSsl True to verify TLS/SSL connection - * @return ApiClient - */ - public ApiClient setVerifyingSsl(final boolean verifyingSsl) { - this.verifyingSsl = verifyingSsl; - applySslSettings(); - return this; - } - - /** - * Sets the write timeout (in milliseconds). A value of 0 means no timeout, otherwise values must - * be between 1 and {@link java.lang.Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setWriteTimeout(final int writeTimeout) { - httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); - return this; - } - - /** - * Update query and header parameters based on authentication settings. - * - * @param authNames The authentications to apply - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - * @param payload HTTP request body - * @param method HTTP method - * @param uri URI - * @throws com.corbado.generated.invoker.ApiException If fails to update the parameters - */ - public void updateParamsForAuth( - final String[] authNames, - final List queryParams, - final Map headerParams, - final Map cookieParams, - final String payload, - final String method, - final URI uri) - throws ApiException { - for (final String authName : authNames) { - final Authentication auth = authentications.get(authName); - if (auth == null) { - throw new RuntimeException("Authentication undefined: " + authName); - } - auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); - } - } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws com.corbado.generated.invoker.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws com.corbado.generated.invoker.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws com.corbado.generated.invoker.ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object + */ + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object + */ + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentTypePure)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); + } + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws com.corbado.generated.invoker.ApiException If fails to update the parameters + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws com.corbado.generated.invoker.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } } diff --git a/src/main/java/com/corbado/generated/invoker/ApiException.java b/src/main/java/com/corbado/generated/invoker/ApiException.java index 3131669..dcc9e84 100644 --- a/src/main/java/com/corbado/generated/invoker/ApiException.java +++ b/src/main/java/com/corbado/generated/invoker/ApiException.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,7 +21,7 @@ *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ApiException extends Exception { private static final long serialVersionUID = 1L; diff --git a/src/main/java/com/corbado/generated/invoker/ApiResponse.java b/src/main/java/com/corbado/generated/invoker/ApiResponse.java index fcccace..73c0176 100644 --- a/src/main/java/com/corbado/generated/invoker/ApiResponse.java +++ b/src/main/java/com/corbado/generated/invoker/ApiResponse.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/corbado/generated/invoker/Configuration.java b/src/main/java/com/corbado/generated/invoker/Configuration.java index dda21e3..df640f5 100644 --- a/src/main/java/com/corbado/generated/invoker/Configuration.java +++ b/src/main/java/com/corbado/generated/invoker/Configuration.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,7 @@ package com.corbado.generated.invoker; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class Configuration { public static final String VERSION = "1.0.0"; diff --git a/src/main/java/com/corbado/generated/invoker/GzipRequestInterceptor.java b/src/main/java/com/corbado/generated/invoker/GzipRequestInterceptor.java index 3a57344..9af01e7 100644 --- a/src/main/java/com/corbado/generated/invoker/GzipRequestInterceptor.java +++ b/src/main/java/com/corbado/generated/invoker/GzipRequestInterceptor.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/corbado/generated/invoker/JSON.java b/src/main/java/com/corbado/generated/invoker/JSON.java index a18c915..d8f14a6 100644 --- a/src/main/java/com/corbado/generated/invoker/JSON.java +++ b/src/main/java/com/corbado/generated/invoker/JSON.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -93,212 +93,63 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AndroidAppConfigDeleteReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AndroidAppConfigItem.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AndroidAppConfigListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AndroidAppConfigSaveReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AndroidAppConfigSaveRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AndroidAppConfigUpdateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AndroidAppConfigUpdateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AssociationTokenCreateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AssociationTokenCreateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AssociationTokenCreateRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AuthMethodsListReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AuthMethodsListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AuthMethodsListRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AuthTokenValidateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AuthTokenValidateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ClientInfo.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.CustomLoginIdentifier.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.Email.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCode.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCodeGetRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCodeGetRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCodeSendReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCodeSendRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCodeSendRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCodeValidateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailCodeValidateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLink.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinkGetRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinkGetRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinkSendReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinkSendRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinkSendRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinkValidateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinksDeleteReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailLinksValidateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailTemplateCreateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailTemplateCreateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailTemplateCreateRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailTemplateDeleteReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmailValidationResult.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.EmptyReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AuthEvent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.AuthEventCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.Challenge.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ChallengeCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ChallengeUpdateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ClientInformation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ConnectToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ConnectTokenCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ConnectTokenData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ConnectTokenDataPasskeyAppend.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ConnectTokenDataPasskeyDelete.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ConnectTokenDataPasskeyList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ConnectTokenList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ConnectTokenUpdateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.Credential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.CredentialList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.DetectionTag.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ErrorRsp.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ErrorRspAllOfError.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ErrorRspAllOfErrorValidation.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ExampleGetRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.FullUser.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.GenericRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IOSAppConfigDeleteReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IOSAppConfigItem.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IOSAppConfigListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IOSAppConfigSaveReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IOSAppConfigSaveRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IOSAppConfigUpdateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IOSAppConfigUpdateRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.Identifier.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IdentifierCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IdentifierList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.IdentifierUpdateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.JavaScriptHighEntropy.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSession.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSessionGetRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSessionGetRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSessionListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSessionListRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSessionRevokeReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSessionCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.LongSessionUpdateReq.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.Paging.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PhoneNumber.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PhoneNumberValidationResult.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectConfig.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectConfigGetRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectConfigSaveReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectConfigWebhookTestReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectConfigWebhookTestRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectConfigWebhookTestRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectSecretCreateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectSecretCreateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectSecretDeleteReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectSecretItem.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectSecretListRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyAppendFinishReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyAppendFinishRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyAppendStartReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyAppendStartRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyEvent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyEventCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyEventList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyIntelFlags.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyLoginFinishReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyLoginFinishRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyLoginStartReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyLoginStartRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyMediationFinishReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyMediationFinishRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyMediationStartReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyMediationStartRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ProjectConfigUpdateCnameReq.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.RequestData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.RequestLog.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.RequestLogGetRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.RequestLogsListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.RequestLogsListRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionConfig.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionConfigGetRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionConfigUpdateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionTokenCreateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionTokenCreateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionTokenCreateRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionTokenVerifyReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionTokenVerifyRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SessionTokenVerifyRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsCodeSendReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsCodeSendRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsCodeSendRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsCodeValidateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsCodeValidateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsTemplateCreateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsTemplateCreateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsTemplateCreateRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SmsTemplateDeleteReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBackupState.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBackupStateGetRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBrowserDetailedStats.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBrowserDetailedStatsListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBrowserDetailedStatsListRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBrowserStats.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBrowserStatsListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingBrowserStatsListRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingDetailedStats.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingDetailedStatsListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingDetailedStatsListRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingEnums.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingEnumsGetRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingOSDetailedStats.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingOSDetailedStatsListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingOSDetailedStatsListRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingOSStats.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingOSStatsListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingOSStatsListRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingRawListRow.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingRawListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingStats.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingStatsListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.TrackingStatsListRspAllOfData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ShortSession.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ShortSessionCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SocialAccount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SocialAccountCreateReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.SocialAccountList.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.User.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserAuthLog.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserAuthLogListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserAuthLogListRspAllOfData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCreateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCreateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCreateRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCustomLoginIdentifierCreateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCustomLoginIdentifierCreateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCustomLoginIdentifierCreateRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCustomLoginIdentifierDeleteReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCustomLoginIdentifierGetRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserCustomLoginIdentifierGetRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserDeleteReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserDevice.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserDeviceListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserEmail.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserEmailCreateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserEmailCreateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserEmailCreateRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserEmailDeleteReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserEmailGetRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserEmailGetRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserExistsReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserExistsRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserGetRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserListRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserPhoneNumber.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserPhoneNumberCreateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserPhoneNumberCreateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserPhoneNumberCreateRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserPhoneNumberDeleteReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserPhoneNumberGetRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserPhoneNumberGetRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserSocialAccount.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserStats.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserStatsListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserStatsListRspAllOfData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserUpdateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserUpdateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.UserUsername.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ValidateEmailReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ValidateEmailRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ValidatePhoneNumberReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ValidatePhoneNumberRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ValidationEmail.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.ValidationPhoneNumber.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnAssociateStartReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnAssociateStartRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnAuthenticateFinishRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnAuthenticateStartReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnAuthenticateStartRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnAuthenticateSuccess.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnAuthenticatorUpdateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnCredentialExistsReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnCredentialExistsRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnCredentialItemRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnCredentialListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnCredentialReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnCredentialRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnFinishReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnMediationStartReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnMediationStartRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnRegisterFinishRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnRegisterStartReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebAuthnRegisterStartRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingCreate.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingCreateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingCreateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingDeleteReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingGetRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingItem.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingUpdateReq.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnSettingUpdateRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnStatsAuthenticator.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnStatsAuthenticatorRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnStatsAuthenticatorRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnStatsType.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnStatsTypeRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebauthnStatsTypeRspAllOfData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebhookLog.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebhookLogsListRsp.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.WebhookLogsListRspAllOfData.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } diff --git a/src/main/java/com/corbado/generated/invoker/Pair.java b/src/main/java/com/corbado/generated/invoker/Pair.java index 980d67b..3ebfc38 100644 --- a/src/main/java/com/corbado/generated/invoker/Pair.java +++ b/src/main/java/com/corbado/generated/invoker/Pair.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,7 @@ package com.corbado.generated.invoker; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/com/corbado/generated/invoker/ProgressRequestBody.java b/src/main/java/com/corbado/generated/invoker/ProgressRequestBody.java index 8e2e582..456cf6a 100644 --- a/src/main/java/com/corbado/generated/invoker/ProgressRequestBody.java +++ b/src/main/java/com/corbado/generated/invoker/ProgressRequestBody.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/corbado/generated/invoker/ProgressResponseBody.java b/src/main/java/com/corbado/generated/invoker/ProgressResponseBody.java index ac7e811..0a2a85b 100644 --- a/src/main/java/com/corbado/generated/invoker/ProgressResponseBody.java +++ b/src/main/java/com/corbado/generated/invoker/ProgressResponseBody.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java b/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java index 684b89f..ff86546 100644 --- a/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java +++ b/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java @@ -5,7 +5,7 @@ /** * Representing a Server configuration. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ServerConfiguration { public String URL; public String description; diff --git a/src/main/java/com/corbado/generated/invoker/ServerVariable.java b/src/main/java/com/corbado/generated/invoker/ServerVariable.java index 8e8412a..86b7fd0 100644 --- a/src/main/java/com/corbado/generated/invoker/ServerVariable.java +++ b/src/main/java/com/corbado/generated/invoker/ServerVariable.java @@ -5,7 +5,7 @@ /** * Representing a Server Variable for server URL template substitution. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ServerVariable { public String description; public String defaultValue; diff --git a/src/main/java/com/corbado/generated/invoker/StringUtil.java b/src/main/java/com/corbado/generated/invoker/StringUtil.java index 48de038..ef2213d 100644 --- a/src/main/java/com/corbado/generated/invoker/StringUtil.java +++ b/src/main/java/com/corbado/generated/invoker/StringUtil.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java b/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java index c5e1662..ae546ce 100644 --- a/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java +++ b/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/com/corbado/generated/invoker/auth/Authentication.java b/src/main/java/com/corbado/generated/invoker/auth/Authentication.java index b840d7e..30dbc06 100644 --- a/src/main/java/com/corbado/generated/invoker/auth/Authentication.java +++ b/src/main/java/com/corbado/generated/invoker/auth/Authentication.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/corbado/generated/invoker/auth/HttpBasicAuth.java b/src/main/java/com/corbado/generated/invoker/auth/HttpBasicAuth.java index c04cc0c..6bb40bf 100644 --- a/src/main/java/com/corbado/generated/invoker/auth/HttpBasicAuth.java +++ b/src/main/java/com/corbado/generated/invoker/auth/HttpBasicAuth.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java b/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java index b3333f8..30fe4f1 100644 --- a/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java +++ b/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,7 +22,7 @@ import java.util.Optional; import java.util.function.Supplier; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class HttpBearerAuth implements Authentication { private final String scheme; private Supplier tokenSupplier; diff --git a/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java b/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java index 51c6a83..9ba3266 100644 --- a/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java +++ b/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,7 +21,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/src/main/java/com/corbado/generated/model/AndroidAppConfigDeleteReq.java b/src/main/java/com/corbado/generated/model/AndroidAppConfigDeleteReq.java deleted file mode 100644 index 1eef03e..0000000 --- a/src/main/java/com/corbado/generated/model/AndroidAppConfigDeleteReq.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * AndroidAppConfigDeleteReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class AndroidAppConfigDeleteReq { - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public AndroidAppConfigDeleteReq() { - } - - public AndroidAppConfigDeleteReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public AndroidAppConfigDeleteReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AndroidAppConfigDeleteReq androidAppConfigDeleteReq = (AndroidAppConfigDeleteReq) o; - return Objects.equals(this.requestID, androidAppConfigDeleteReq.requestID) && - Objects.equals(this.clientInfo, androidAppConfigDeleteReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AndroidAppConfigDeleteReq {\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AndroidAppConfigDeleteReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AndroidAppConfigDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AndroidAppConfigDeleteReq is not found in the empty JSON string", AndroidAppConfigDeleteReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AndroidAppConfigDeleteReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidAppConfigDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AndroidAppConfigDeleteReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AndroidAppConfigDeleteReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AndroidAppConfigDeleteReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AndroidAppConfigDeleteReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AndroidAppConfigDeleteReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AndroidAppConfigDeleteReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of AndroidAppConfigDeleteReq - * @throws IOException if the JSON string is invalid with respect to AndroidAppConfigDeleteReq - */ - public static AndroidAppConfigDeleteReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AndroidAppConfigDeleteReq.class); - } - - /** - * Convert an instance of AndroidAppConfigDeleteReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/AndroidAppConfigItem.java b/src/main/java/com/corbado/generated/model/AndroidAppConfigItem.java deleted file mode 100644 index 70b1260..0000000 --- a/src/main/java/com/corbado/generated/model/AndroidAppConfigItem.java +++ /dev/null @@ -1,394 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * AndroidAppConfigItem - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class AndroidAppConfigItem { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; - @SerializedName(SERIALIZED_NAME_PROJECT_I_D) - private String projectID; - - public static final String SERIALIZED_NAME_PACKAGE_NAME = "packageName"; - @SerializedName(SERIALIZED_NAME_PACKAGE_NAME) - private String packageName; - - public static final String SERIALIZED_NAME_FINGERPRINT = "fingerprint"; - @SerializedName(SERIALIZED_NAME_FINGERPRINT) - private String fingerprint; - - public static final String SERIALIZED_NAME_BASE64_U_R_L = "base64URL"; - @SerializedName(SERIALIZED_NAME_BASE64_U_R_L) - private String base64URL; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public AndroidAppConfigItem() { - } - - public AndroidAppConfigItem id(String id) { - this.id = id; - return this; - } - - /** - * ID of Android app configuration - * @return id - **/ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public AndroidAppConfigItem projectID(String projectID) { - this.projectID = projectID; - return this; - } - - /** - * ID of project - * @return projectID - **/ - @javax.annotation.Nonnull - public String getProjectID() { - return projectID; - } - - public void setProjectID(String projectID) { - this.projectID = projectID; - } - - - public AndroidAppConfigItem packageName(String packageName) { - this.packageName = packageName; - return this; - } - - /** - * Get packageName - * @return packageName - **/ - @javax.annotation.Nonnull - public String getPackageName() { - return packageName; - } - - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - - public AndroidAppConfigItem fingerprint(String fingerprint) { - this.fingerprint = fingerprint; - return this; - } - - /** - * Get fingerprint - * @return fingerprint - **/ - @javax.annotation.Nonnull - public String getFingerprint() { - return fingerprint; - } - - public void setFingerprint(String fingerprint) { - this.fingerprint = fingerprint; - } - - - public AndroidAppConfigItem base64URL(String base64URL) { - this.base64URL = base64URL; - return this; - } - - /** - * Get base64URL - * @return base64URL - **/ - @javax.annotation.Nonnull - public String getBase64URL() { - return base64URL; - } - - public void setBase64URL(String base64URL) { - this.base64URL = base64URL; - } - - - public AndroidAppConfigItem created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public AndroidAppConfigItem updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AndroidAppConfigItem androidAppConfigItem = (AndroidAppConfigItem) o; - return Objects.equals(this.id, androidAppConfigItem.id) && - Objects.equals(this.projectID, androidAppConfigItem.projectID) && - Objects.equals(this.packageName, androidAppConfigItem.packageName) && - Objects.equals(this.fingerprint, androidAppConfigItem.fingerprint) && - Objects.equals(this.base64URL, androidAppConfigItem.base64URL) && - Objects.equals(this.created, androidAppConfigItem.created) && - Objects.equals(this.updated, androidAppConfigItem.updated); - } - - @Override - public int hashCode() { - return Objects.hash(id, projectID, packageName, fingerprint, base64URL, created, updated); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AndroidAppConfigItem {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); - sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); - sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n"); - sb.append(" base64URL: ").append(toIndentedString(base64URL)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("projectID"); - openapiFields.add("packageName"); - openapiFields.add("fingerprint"); - openapiFields.add("base64URL"); - openapiFields.add("created"); - openapiFields.add("updated"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("projectID"); - openapiRequiredFields.add("packageName"); - openapiRequiredFields.add("fingerprint"); - openapiRequiredFields.add("base64URL"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AndroidAppConfigItem - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AndroidAppConfigItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AndroidAppConfigItem is not found in the empty JSON string", AndroidAppConfigItem.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AndroidAppConfigItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidAppConfigItem` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AndroidAppConfigItem.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("projectID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); - } - if (!jsonObj.get("packageName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").toString())); - } - if (!jsonObj.get("fingerprint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fingerprint").toString())); - } - if (!jsonObj.get("base64URL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `base64URL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("base64URL").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AndroidAppConfigItem.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AndroidAppConfigItem' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AndroidAppConfigItem.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AndroidAppConfigItem value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AndroidAppConfigItem read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AndroidAppConfigItem given an JSON string - * - * @param jsonString JSON string - * @return An instance of AndroidAppConfigItem - * @throws IOException if the JSON string is invalid with respect to AndroidAppConfigItem - */ - public static AndroidAppConfigItem fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AndroidAppConfigItem.class); - } - - /** - * Convert an instance of AndroidAppConfigItem to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/AndroidAppConfigListRsp.java b/src/main/java/com/corbado/generated/model/AndroidAppConfigListRsp.java deleted file mode 100644 index 77e61f8..0000000 --- a/src/main/java/com/corbado/generated/model/AndroidAppConfigListRsp.java +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.AndroidAppConfigItem; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * AndroidAppConfigListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class AndroidAppConfigListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_ROWS = "rows"; - @SerializedName(SERIALIZED_NAME_ROWS) - private List rows = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public AndroidAppConfigListRsp() { - } - - public AndroidAppConfigListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public AndroidAppConfigListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public AndroidAppConfigListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public AndroidAppConfigListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public AndroidAppConfigListRsp rows(List rows) { - this.rows = rows; - return this; - } - - public AndroidAppConfigListRsp addRowsItem(AndroidAppConfigItem rowsItem) { - if (this.rows == null) { - this.rows = new ArrayList<>(); - } - this.rows.add(rowsItem); - return this; - } - - /** - * Get rows - * @return rows - **/ - @javax.annotation.Nonnull - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - - public AndroidAppConfigListRsp paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AndroidAppConfigListRsp androidAppConfigListRsp = (AndroidAppConfigListRsp) o; - return Objects.equals(this.httpStatusCode, androidAppConfigListRsp.httpStatusCode) && - Objects.equals(this.message, androidAppConfigListRsp.message) && - Objects.equals(this.requestData, androidAppConfigListRsp.requestData) && - Objects.equals(this.runtime, androidAppConfigListRsp.runtime) && - Objects.equals(this.rows, androidAppConfigListRsp.rows) && - Objects.equals(this.paging, androidAppConfigListRsp.paging); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, rows, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AndroidAppConfigListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("rows"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("rows"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AndroidAppConfigListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AndroidAppConfigListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AndroidAppConfigListRsp is not found in the empty JSON string", AndroidAppConfigListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AndroidAppConfigListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidAppConfigListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AndroidAppConfigListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // ensure the json data is an array - if (!jsonObj.get("rows").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rows` to be an array in the JSON string but got `%s`", jsonObj.get("rows").toString())); - } - - JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); - // validate the required field `rows` (array) - for (int i = 0; i < jsonArrayrows.size(); i++) { - AndroidAppConfigItem.validateJsonElement(jsonArrayrows.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AndroidAppConfigListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AndroidAppConfigListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AndroidAppConfigListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AndroidAppConfigListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AndroidAppConfigListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AndroidAppConfigListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of AndroidAppConfigListRsp - * @throws IOException if the JSON string is invalid with respect to AndroidAppConfigListRsp - */ - public static AndroidAppConfigListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AndroidAppConfigListRsp.class); - } - - /** - * Convert an instance of AndroidAppConfigListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/AndroidAppConfigSaveReq.java b/src/main/java/com/corbado/generated/model/AndroidAppConfigSaveReq.java deleted file mode 100644 index 2660fbd..0000000 --- a/src/main/java/com/corbado/generated/model/AndroidAppConfigSaveReq.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * AndroidAppConfigSaveReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class AndroidAppConfigSaveReq { - public static final String SERIALIZED_NAME_PACKAGE_NAME = "packageName"; - @SerializedName(SERIALIZED_NAME_PACKAGE_NAME) - private String packageName; - - public static final String SERIALIZED_NAME_FINGERPRINT = "fingerprint"; - @SerializedName(SERIALIZED_NAME_FINGERPRINT) - private String fingerprint; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public AndroidAppConfigSaveReq() { - } - - public AndroidAppConfigSaveReq packageName(String packageName) { - this.packageName = packageName; - return this; - } - - /** - * Get packageName - * @return packageName - **/ - @javax.annotation.Nonnull - public String getPackageName() { - return packageName; - } - - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - - public AndroidAppConfigSaveReq fingerprint(String fingerprint) { - this.fingerprint = fingerprint; - return this; - } - - /** - * Get fingerprint - * @return fingerprint - **/ - @javax.annotation.Nonnull - public String getFingerprint() { - return fingerprint; - } - - public void setFingerprint(String fingerprint) { - this.fingerprint = fingerprint; - } - - - public AndroidAppConfigSaveReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public AndroidAppConfigSaveReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AndroidAppConfigSaveReq androidAppConfigSaveReq = (AndroidAppConfigSaveReq) o; - return Objects.equals(this.packageName, androidAppConfigSaveReq.packageName) && - Objects.equals(this.fingerprint, androidAppConfigSaveReq.fingerprint) && - Objects.equals(this.requestID, androidAppConfigSaveReq.requestID) && - Objects.equals(this.clientInfo, androidAppConfigSaveReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(packageName, fingerprint, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AndroidAppConfigSaveReq {\n"); - sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); - sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("packageName"); - openapiFields.add("fingerprint"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("packageName"); - openapiRequiredFields.add("fingerprint"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AndroidAppConfigSaveReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AndroidAppConfigSaveReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AndroidAppConfigSaveReq is not found in the empty JSON string", AndroidAppConfigSaveReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AndroidAppConfigSaveReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidAppConfigSaveReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AndroidAppConfigSaveReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("packageName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").toString())); - } - if (!jsonObj.get("fingerprint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fingerprint").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AndroidAppConfigSaveReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AndroidAppConfigSaveReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AndroidAppConfigSaveReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AndroidAppConfigSaveReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AndroidAppConfigSaveReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AndroidAppConfigSaveReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of AndroidAppConfigSaveReq - * @throws IOException if the JSON string is invalid with respect to AndroidAppConfigSaveReq - */ - public static AndroidAppConfigSaveReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AndroidAppConfigSaveReq.class); - } - - /** - * Convert an instance of AndroidAppConfigSaveReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/AndroidAppConfigSaveRsp.java b/src/main/java/com/corbado/generated/model/AndroidAppConfigSaveRsp.java deleted file mode 100644 index d6c9670..0000000 --- a/src/main/java/com/corbado/generated/model/AndroidAppConfigSaveRsp.java +++ /dev/null @@ -1,510 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * AndroidAppConfigSaveRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class AndroidAppConfigSaveRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; - @SerializedName(SERIALIZED_NAME_PROJECT_I_D) - private String projectID; - - public static final String SERIALIZED_NAME_PACKAGE_NAME = "packageName"; - @SerializedName(SERIALIZED_NAME_PACKAGE_NAME) - private String packageName; - - public static final String SERIALIZED_NAME_FINGERPRINT = "fingerprint"; - @SerializedName(SERIALIZED_NAME_FINGERPRINT) - private String fingerprint; - - public static final String SERIALIZED_NAME_BASE64_U_R_L = "base64URL"; - @SerializedName(SERIALIZED_NAME_BASE64_U_R_L) - private String base64URL; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public AndroidAppConfigSaveRsp() { - } - - public AndroidAppConfigSaveRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public AndroidAppConfigSaveRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public AndroidAppConfigSaveRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public AndroidAppConfigSaveRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public AndroidAppConfigSaveRsp id(String id) { - this.id = id; - return this; - } - - /** - * ID of Android app configuration - * @return id - **/ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public AndroidAppConfigSaveRsp projectID(String projectID) { - this.projectID = projectID; - return this; - } - - /** - * ID of project - * @return projectID - **/ - @javax.annotation.Nonnull - public String getProjectID() { - return projectID; - } - - public void setProjectID(String projectID) { - this.projectID = projectID; - } - - - public AndroidAppConfigSaveRsp packageName(String packageName) { - this.packageName = packageName; - return this; - } - - /** - * Get packageName - * @return packageName - **/ - @javax.annotation.Nonnull - public String getPackageName() { - return packageName; - } - - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - - public AndroidAppConfigSaveRsp fingerprint(String fingerprint) { - this.fingerprint = fingerprint; - return this; - } - - /** - * Get fingerprint - * @return fingerprint - **/ - @javax.annotation.Nonnull - public String getFingerprint() { - return fingerprint; - } - - public void setFingerprint(String fingerprint) { - this.fingerprint = fingerprint; - } - - - public AndroidAppConfigSaveRsp base64URL(String base64URL) { - this.base64URL = base64URL; - return this; - } - - /** - * Get base64URL - * @return base64URL - **/ - @javax.annotation.Nonnull - public String getBase64URL() { - return base64URL; - } - - public void setBase64URL(String base64URL) { - this.base64URL = base64URL; - } - - - public AndroidAppConfigSaveRsp created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public AndroidAppConfigSaveRsp updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AndroidAppConfigSaveRsp androidAppConfigSaveRsp = (AndroidAppConfigSaveRsp) o; - return Objects.equals(this.httpStatusCode, androidAppConfigSaveRsp.httpStatusCode) && - Objects.equals(this.message, androidAppConfigSaveRsp.message) && - Objects.equals(this.requestData, androidAppConfigSaveRsp.requestData) && - Objects.equals(this.runtime, androidAppConfigSaveRsp.runtime) && - Objects.equals(this.id, androidAppConfigSaveRsp.id) && - Objects.equals(this.projectID, androidAppConfigSaveRsp.projectID) && - Objects.equals(this.packageName, androidAppConfigSaveRsp.packageName) && - Objects.equals(this.fingerprint, androidAppConfigSaveRsp.fingerprint) && - Objects.equals(this.base64URL, androidAppConfigSaveRsp.base64URL) && - Objects.equals(this.created, androidAppConfigSaveRsp.created) && - Objects.equals(this.updated, androidAppConfigSaveRsp.updated); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, id, projectID, packageName, fingerprint, base64URL, created, updated); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AndroidAppConfigSaveRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); - sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); - sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n"); - sb.append(" base64URL: ").append(toIndentedString(base64URL)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("id"); - openapiFields.add("projectID"); - openapiFields.add("packageName"); - openapiFields.add("fingerprint"); - openapiFields.add("base64URL"); - openapiFields.add("created"); - openapiFields.add("updated"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("projectID"); - openapiRequiredFields.add("packageName"); - openapiRequiredFields.add("fingerprint"); - openapiRequiredFields.add("base64URL"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AndroidAppConfigSaveRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AndroidAppConfigSaveRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AndroidAppConfigSaveRsp is not found in the empty JSON string", AndroidAppConfigSaveRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AndroidAppConfigSaveRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidAppConfigSaveRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AndroidAppConfigSaveRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("projectID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); - } - if (!jsonObj.get("packageName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").toString())); - } - if (!jsonObj.get("fingerprint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fingerprint").toString())); - } - if (!jsonObj.get("base64URL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `base64URL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("base64URL").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AndroidAppConfigSaveRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AndroidAppConfigSaveRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AndroidAppConfigSaveRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AndroidAppConfigSaveRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AndroidAppConfigSaveRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AndroidAppConfigSaveRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of AndroidAppConfigSaveRsp - * @throws IOException if the JSON string is invalid with respect to AndroidAppConfigSaveRsp - */ - public static AndroidAppConfigSaveRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AndroidAppConfigSaveRsp.class); - } - - /** - * Convert an instance of AndroidAppConfigSaveRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateReq.java b/src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateReq.java deleted file mode 100644 index 980f839..0000000 --- a/src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateReq.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * AndroidAppConfigUpdateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class AndroidAppConfigUpdateReq { - public static final String SERIALIZED_NAME_PACKAGE_NAME = "packageName"; - @SerializedName(SERIALIZED_NAME_PACKAGE_NAME) - private String packageName; - - public static final String SERIALIZED_NAME_FINGERPRINT = "fingerprint"; - @SerializedName(SERIALIZED_NAME_FINGERPRINT) - private String fingerprint; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public AndroidAppConfigUpdateReq() { - } - - public AndroidAppConfigUpdateReq packageName(String packageName) { - this.packageName = packageName; - return this; - } - - /** - * Get packageName - * @return packageName - **/ - @javax.annotation.Nonnull - public String getPackageName() { - return packageName; - } - - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - - public AndroidAppConfigUpdateReq fingerprint(String fingerprint) { - this.fingerprint = fingerprint; - return this; - } - - /** - * Get fingerprint - * @return fingerprint - **/ - @javax.annotation.Nonnull - public String getFingerprint() { - return fingerprint; - } - - public void setFingerprint(String fingerprint) { - this.fingerprint = fingerprint; - } - - - public AndroidAppConfigUpdateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public AndroidAppConfigUpdateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AndroidAppConfigUpdateReq androidAppConfigUpdateReq = (AndroidAppConfigUpdateReq) o; - return Objects.equals(this.packageName, androidAppConfigUpdateReq.packageName) && - Objects.equals(this.fingerprint, androidAppConfigUpdateReq.fingerprint) && - Objects.equals(this.requestID, androidAppConfigUpdateReq.requestID) && - Objects.equals(this.clientInfo, androidAppConfigUpdateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(packageName, fingerprint, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AndroidAppConfigUpdateReq {\n"); - sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); - sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("packageName"); - openapiFields.add("fingerprint"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("packageName"); - openapiRequiredFields.add("fingerprint"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AndroidAppConfigUpdateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AndroidAppConfigUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AndroidAppConfigUpdateReq is not found in the empty JSON string", AndroidAppConfigUpdateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AndroidAppConfigUpdateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidAppConfigUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AndroidAppConfigUpdateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("packageName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").toString())); - } - if (!jsonObj.get("fingerprint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fingerprint").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AndroidAppConfigUpdateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AndroidAppConfigUpdateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AndroidAppConfigUpdateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AndroidAppConfigUpdateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AndroidAppConfigUpdateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AndroidAppConfigUpdateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of AndroidAppConfigUpdateReq - * @throws IOException if the JSON string is invalid with respect to AndroidAppConfigUpdateReq - */ - public static AndroidAppConfigUpdateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AndroidAppConfigUpdateReq.class); - } - - /** - * Convert an instance of AndroidAppConfigUpdateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateRsp.java b/src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateRsp.java deleted file mode 100644 index 82b2b1b..0000000 --- a/src/main/java/com/corbado/generated/model/AndroidAppConfigUpdateRsp.java +++ /dev/null @@ -1,510 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * AndroidAppConfigUpdateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class AndroidAppConfigUpdateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; - @SerializedName(SERIALIZED_NAME_PROJECT_I_D) - private String projectID; - - public static final String SERIALIZED_NAME_PACKAGE_NAME = "packageName"; - @SerializedName(SERIALIZED_NAME_PACKAGE_NAME) - private String packageName; - - public static final String SERIALIZED_NAME_FINGERPRINT = "fingerprint"; - @SerializedName(SERIALIZED_NAME_FINGERPRINT) - private String fingerprint; - - public static final String SERIALIZED_NAME_BASE64_U_R_L = "base64URL"; - @SerializedName(SERIALIZED_NAME_BASE64_U_R_L) - private String base64URL; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public AndroidAppConfigUpdateRsp() { - } - - public AndroidAppConfigUpdateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public AndroidAppConfigUpdateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public AndroidAppConfigUpdateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public AndroidAppConfigUpdateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public AndroidAppConfigUpdateRsp id(String id) { - this.id = id; - return this; - } - - /** - * ID of Android app configuration - * @return id - **/ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public AndroidAppConfigUpdateRsp projectID(String projectID) { - this.projectID = projectID; - return this; - } - - /** - * ID of project - * @return projectID - **/ - @javax.annotation.Nonnull - public String getProjectID() { - return projectID; - } - - public void setProjectID(String projectID) { - this.projectID = projectID; - } - - - public AndroidAppConfigUpdateRsp packageName(String packageName) { - this.packageName = packageName; - return this; - } - - /** - * Get packageName - * @return packageName - **/ - @javax.annotation.Nonnull - public String getPackageName() { - return packageName; - } - - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - - public AndroidAppConfigUpdateRsp fingerprint(String fingerprint) { - this.fingerprint = fingerprint; - return this; - } - - /** - * Get fingerprint - * @return fingerprint - **/ - @javax.annotation.Nonnull - public String getFingerprint() { - return fingerprint; - } - - public void setFingerprint(String fingerprint) { - this.fingerprint = fingerprint; - } - - - public AndroidAppConfigUpdateRsp base64URL(String base64URL) { - this.base64URL = base64URL; - return this; - } - - /** - * Get base64URL - * @return base64URL - **/ - @javax.annotation.Nonnull - public String getBase64URL() { - return base64URL; - } - - public void setBase64URL(String base64URL) { - this.base64URL = base64URL; - } - - - public AndroidAppConfigUpdateRsp created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public AndroidAppConfigUpdateRsp updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AndroidAppConfigUpdateRsp androidAppConfigUpdateRsp = (AndroidAppConfigUpdateRsp) o; - return Objects.equals(this.httpStatusCode, androidAppConfigUpdateRsp.httpStatusCode) && - Objects.equals(this.message, androidAppConfigUpdateRsp.message) && - Objects.equals(this.requestData, androidAppConfigUpdateRsp.requestData) && - Objects.equals(this.runtime, androidAppConfigUpdateRsp.runtime) && - Objects.equals(this.id, androidAppConfigUpdateRsp.id) && - Objects.equals(this.projectID, androidAppConfigUpdateRsp.projectID) && - Objects.equals(this.packageName, androidAppConfigUpdateRsp.packageName) && - Objects.equals(this.fingerprint, androidAppConfigUpdateRsp.fingerprint) && - Objects.equals(this.base64URL, androidAppConfigUpdateRsp.base64URL) && - Objects.equals(this.created, androidAppConfigUpdateRsp.created) && - Objects.equals(this.updated, androidAppConfigUpdateRsp.updated); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, id, projectID, packageName, fingerprint, base64URL, created, updated); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AndroidAppConfigUpdateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); - sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); - sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n"); - sb.append(" base64URL: ").append(toIndentedString(base64URL)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("id"); - openapiFields.add("projectID"); - openapiFields.add("packageName"); - openapiFields.add("fingerprint"); - openapiFields.add("base64URL"); - openapiFields.add("created"); - openapiFields.add("updated"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("projectID"); - openapiRequiredFields.add("packageName"); - openapiRequiredFields.add("fingerprint"); - openapiRequiredFields.add("base64URL"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AndroidAppConfigUpdateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AndroidAppConfigUpdateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AndroidAppConfigUpdateRsp is not found in the empty JSON string", AndroidAppConfigUpdateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AndroidAppConfigUpdateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidAppConfigUpdateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AndroidAppConfigUpdateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("projectID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); - } - if (!jsonObj.get("packageName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").toString())); - } - if (!jsonObj.get("fingerprint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fingerprint").toString())); - } - if (!jsonObj.get("base64URL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `base64URL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("base64URL").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AndroidAppConfigUpdateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AndroidAppConfigUpdateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AndroidAppConfigUpdateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AndroidAppConfigUpdateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AndroidAppConfigUpdateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AndroidAppConfigUpdateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of AndroidAppConfigUpdateRsp - * @throws IOException if the JSON string is invalid with respect to AndroidAppConfigUpdateRsp - */ - public static AndroidAppConfigUpdateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AndroidAppConfigUpdateRsp.class); - } - - /** - * Convert an instance of AndroidAppConfigUpdateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/AppType.java b/src/main/java/com/corbado/generated/model/AppType.java index 57f9c80..5f208e9 100644 --- a/src/main/java/com/corbado/generated/model/AppType.java +++ b/src/main/java/com/corbado/generated/model/AppType.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/corbado/generated/model/AssociationTokenCreateReq.java b/src/main/java/com/corbado/generated/model/AssociationTokenCreateReq.java deleted file mode 100644 index 6075eeb..0000000 --- a/src/main/java/com/corbado/generated/model/AssociationTokenCreateReq.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.corbado.generated.model.LoginIdentifierType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * AssociationTokenCreateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class AssociationTokenCreateReq { - public static final String SERIALIZED_NAME_LOGIN_IDENTIFIER = "loginIdentifier"; - @SerializedName(SERIALIZED_NAME_LOGIN_IDENTIFIER) - private String loginIdentifier; - - public static final String SERIALIZED_NAME_LOGIN_IDENTIFIER_TYPE = "loginIdentifierType"; - @SerializedName(SERIALIZED_NAME_LOGIN_IDENTIFIER_TYPE) - private LoginIdentifierType loginIdentifierType; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public AssociationTokenCreateReq() { - } - - public AssociationTokenCreateReq loginIdentifier(String loginIdentifier) { - this.loginIdentifier = loginIdentifier; - return this; - } - - /** - * Get loginIdentifier - * @return loginIdentifier - **/ - @javax.annotation.Nonnull - public String getLoginIdentifier() { - return loginIdentifier; - } - - public void setLoginIdentifier(String loginIdentifier) { - this.loginIdentifier = loginIdentifier; - } - - - public AssociationTokenCreateReq loginIdentifierType(LoginIdentifierType loginIdentifierType) { - this.loginIdentifierType = loginIdentifierType; - return this; - } - - /** - * Get loginIdentifierType - * @return loginIdentifierType - **/ - @javax.annotation.Nonnull - public LoginIdentifierType getLoginIdentifierType() { - return loginIdentifierType; - } - - public void setLoginIdentifierType(LoginIdentifierType loginIdentifierType) { - this.loginIdentifierType = loginIdentifierType; - } - - - public AssociationTokenCreateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public AssociationTokenCreateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nonnull - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AssociationTokenCreateReq associationTokenCreateReq = (AssociationTokenCreateReq) o; - return Objects.equals(this.loginIdentifier, associationTokenCreateReq.loginIdentifier) && - Objects.equals(this.loginIdentifierType, associationTokenCreateReq.loginIdentifierType) && - Objects.equals(this.requestID, associationTokenCreateReq.requestID) && - Objects.equals(this.clientInfo, associationTokenCreateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(loginIdentifier, loginIdentifierType, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AssociationTokenCreateReq {\n"); - sb.append(" loginIdentifier: ").append(toIndentedString(loginIdentifier)).append("\n"); - sb.append(" loginIdentifierType: ").append(toIndentedString(loginIdentifierType)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("loginIdentifier"); - openapiFields.add("loginIdentifierType"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("loginIdentifier"); - openapiRequiredFields.add("loginIdentifierType"); - openapiRequiredFields.add("clientInfo"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AssociationTokenCreateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AssociationTokenCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AssociationTokenCreateReq is not found in the empty JSON string", AssociationTokenCreateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AssociationTokenCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssociationTokenCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AssociationTokenCreateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("loginIdentifier").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `loginIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginIdentifier").toString())); - } - // validate the required field `loginIdentifierType` - LoginIdentifierType.validateJsonElement(jsonObj.get("loginIdentifierType")); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the required field `clientInfo` - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AssociationTokenCreateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AssociationTokenCreateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AssociationTokenCreateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AssociationTokenCreateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AssociationTokenCreateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AssociationTokenCreateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of AssociationTokenCreateReq - * @throws IOException if the JSON string is invalid with respect to AssociationTokenCreateReq - */ - public static AssociationTokenCreateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AssociationTokenCreateReq.class); - } - - /** - * Convert an instance of AssociationTokenCreateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/AssociationTokenCreateRsp.java b/src/main/java/com/corbado/generated/model/AssociationTokenCreateRsp.java deleted file mode 100644 index 363e262..0000000 --- a/src/main/java/com/corbado/generated/model/AssociationTokenCreateRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.AssociationTokenCreateRspAllOfData; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * AssociationTokenCreateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class AssociationTokenCreateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private AssociationTokenCreateRspAllOfData data; - - public AssociationTokenCreateRsp() { - } - - public AssociationTokenCreateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public AssociationTokenCreateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public AssociationTokenCreateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public AssociationTokenCreateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public AssociationTokenCreateRsp data(AssociationTokenCreateRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public AssociationTokenCreateRspAllOfData getData() { - return data; - } - - public void setData(AssociationTokenCreateRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AssociationTokenCreateRsp associationTokenCreateRsp = (AssociationTokenCreateRsp) o; - return Objects.equals(this.httpStatusCode, associationTokenCreateRsp.httpStatusCode) && - Objects.equals(this.message, associationTokenCreateRsp.message) && - Objects.equals(this.requestData, associationTokenCreateRsp.requestData) && - Objects.equals(this.runtime, associationTokenCreateRsp.runtime) && - Objects.equals(this.data, associationTokenCreateRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AssociationTokenCreateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AssociationTokenCreateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AssociationTokenCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AssociationTokenCreateRsp is not found in the empty JSON string", AssociationTokenCreateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AssociationTokenCreateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssociationTokenCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AssociationTokenCreateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - AssociationTokenCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AssociationTokenCreateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AssociationTokenCreateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AssociationTokenCreateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AssociationTokenCreateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AssociationTokenCreateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AssociationTokenCreateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of AssociationTokenCreateRsp - * @throws IOException if the JSON string is invalid with respect to AssociationTokenCreateRsp - */ - public static AssociationTokenCreateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AssociationTokenCreateRsp.class); - } - - /** - * Convert an instance of AssociationTokenCreateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/AssociationTokenCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/AssociationTokenCreateRspAllOfData.java deleted file mode 100644 index 894c17f..0000000 --- a/src/main/java/com/corbado/generated/model/AssociationTokenCreateRspAllOfData.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * AssociationTokenCreateRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class AssociationTokenCreateRspAllOfData { - public static final String SERIALIZED_NAME_TOKEN = "token"; - @SerializedName(SERIALIZED_NAME_TOKEN) - private String token; - - public static final String SERIALIZED_NAME_REJECTION_REASON = "rejectionReason"; - @SerializedName(SERIALIZED_NAME_REJECTION_REASON) - private String rejectionReason; - - public AssociationTokenCreateRspAllOfData() { - } - - public AssociationTokenCreateRspAllOfData token(String token) { - this.token = token; - return this; - } - - /** - * Get token - * @return token - **/ - @javax.annotation.Nullable - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - - - public AssociationTokenCreateRspAllOfData rejectionReason(String rejectionReason) { - this.rejectionReason = rejectionReason; - return this; - } - - /** - * Get rejectionReason - * @return rejectionReason - **/ - @javax.annotation.Nullable - public String getRejectionReason() { - return rejectionReason; - } - - public void setRejectionReason(String rejectionReason) { - this.rejectionReason = rejectionReason; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AssociationTokenCreateRspAllOfData associationTokenCreateRspAllOfData = (AssociationTokenCreateRspAllOfData) o; - return Objects.equals(this.token, associationTokenCreateRspAllOfData.token) && - Objects.equals(this.rejectionReason, associationTokenCreateRspAllOfData.rejectionReason); - } - - @Override - public int hashCode() { - return Objects.hash(token, rejectionReason); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AssociationTokenCreateRspAllOfData {\n"); - sb.append(" token: ").append(toIndentedString(token)).append("\n"); - sb.append(" rejectionReason: ").append(toIndentedString(rejectionReason)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("token"); - openapiFields.add("rejectionReason"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AssociationTokenCreateRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AssociationTokenCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AssociationTokenCreateRspAllOfData is not found in the empty JSON string", AssociationTokenCreateRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AssociationTokenCreateRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssociationTokenCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("token") != null && !jsonObj.get("token").isJsonNull()) && !jsonObj.get("token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); - } - if ((jsonObj.get("rejectionReason") != null && !jsonObj.get("rejectionReason").isJsonNull()) && !jsonObj.get("rejectionReason").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `rejectionReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rejectionReason").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AssociationTokenCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AssociationTokenCreateRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AssociationTokenCreateRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AssociationTokenCreateRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AssociationTokenCreateRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AssociationTokenCreateRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of AssociationTokenCreateRspAllOfData - * @throws IOException if the JSON string is invalid with respect to AssociationTokenCreateRspAllOfData - */ - public static AssociationTokenCreateRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AssociationTokenCreateRspAllOfData.class); - } - - /** - * Convert an instance of AssociationTokenCreateRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/AuthEvent.java b/src/main/java/com/corbado/generated/model/AuthEvent.java new file mode 100644 index 0000000..7ef492a --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AuthEvent.java @@ -0,0 +1,394 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.AuthEventMethod; +import com.corbado.generated.model.AuthEventStatus; +import com.corbado.generated.model.AuthEventType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AuthEvent + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class AuthEvent { + public static final String SERIALIZED_NAME_AUTH_EVENT_I_D = "authEventID"; + @SerializedName(SERIALIZED_NAME_AUTH_EVENT_I_D) + private String authEventID; + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; + @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + private AuthEventType eventType; + + public static final String SERIALIZED_NAME_METHOD = "method"; + @SerializedName(SERIALIZED_NAME_METHOD) + private AuthEventMethod method; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private AuthEventStatus status; + + public AuthEvent() { + } + + public AuthEvent authEventID(String authEventID) { + this.authEventID = authEventID; + return this; + } + + /** + * Get authEventID + * @return authEventID + */ + @javax.annotation.Nonnull + public String getAuthEventID() { + return authEventID; + } + + public void setAuthEventID(String authEventID) { + this.authEventID = authEventID; + } + + + public AuthEvent userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + */ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public AuthEvent username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + public AuthEvent eventType(AuthEventType eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + */ + @javax.annotation.Nonnull + public AuthEventType getEventType() { + return eventType; + } + + public void setEventType(AuthEventType eventType) { + this.eventType = eventType; + } + + + public AuthEvent method(AuthEventMethod method) { + this.method = method; + return this; + } + + /** + * Get method + * @return method + */ + @javax.annotation.Nonnull + public AuthEventMethod getMethod() { + return method; + } + + public void setMethod(AuthEventMethod method) { + this.method = method; + } + + + public AuthEvent created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + */ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public AuthEvent status(AuthEventStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public AuthEventStatus getStatus() { + return status; + } + + public void setStatus(AuthEventStatus status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthEvent authEvent = (AuthEvent) o; + return Objects.equals(this.authEventID, authEvent.authEventID) && + Objects.equals(this.userID, authEvent.userID) && + Objects.equals(this.username, authEvent.username) && + Objects.equals(this.eventType, authEvent.eventType) && + Objects.equals(this.method, authEvent.method) && + Objects.equals(this.created, authEvent.created) && + Objects.equals(this.status, authEvent.status); + } + + @Override + public int hashCode() { + return Objects.hash(authEventID, userID, username, eventType, method, created, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthEvent {\n"); + sb.append(" authEventID: ").append(toIndentedString(authEventID)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("authEventID"); + openapiFields.add("userID"); + openapiFields.add("username"); + openapiFields.add("eventType"); + openapiFields.add("method"); + openapiFields.add("created"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("authEventID"); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("eventType"); + openapiRequiredFields.add("method"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AuthEvent + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthEvent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthEvent is not found in the empty JSON string", AuthEvent.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AuthEvent.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthEvent` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AuthEvent.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("authEventID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authEventID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authEventID").toString())); + } + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + // validate the required field `eventType` + AuthEventType.validateJsonElement(jsonObj.get("eventType")); + // validate the required field `method` + AuthEventMethod.validateJsonElement(jsonObj.get("method")); + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + // validate the required field `status` + AuthEventStatus.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuthEvent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthEvent' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthEvent.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AuthEvent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AuthEvent read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthEvent + * @throws IOException if the JSON string is invalid with respect to AuthEvent + */ + public static AuthEvent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthEvent.class); + } + + /** + * Convert an instance of AuthEvent to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AuthEventCreateReq.java b/src/main/java/com/corbado/generated/model/AuthEventCreateReq.java new file mode 100644 index 0000000..95ad2ce --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AuthEventCreateReq.java @@ -0,0 +1,334 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.AuthEventMethod; +import com.corbado.generated.model.AuthEventStatus; +import com.corbado.generated.model.AuthEventType; +import com.corbado.generated.model.ClientInformation; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * AuthEventCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class AuthEventCreateReq { + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; + @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + private AuthEventType eventType; + + public static final String SERIALIZED_NAME_METHOD = "method"; + @SerializedName(SERIALIZED_NAME_METHOD) + private AuthEventMethod method; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private AuthEventStatus status; + + public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + private ClientInformation clientInformation; + + public AuthEventCreateReq() { + } + + public AuthEventCreateReq username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + public AuthEventCreateReq eventType(AuthEventType eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + */ + @javax.annotation.Nonnull + public AuthEventType getEventType() { + return eventType; + } + + public void setEventType(AuthEventType eventType) { + this.eventType = eventType; + } + + + public AuthEventCreateReq method(AuthEventMethod method) { + this.method = method; + return this; + } + + /** + * Get method + * @return method + */ + @javax.annotation.Nonnull + public AuthEventMethod getMethod() { + return method; + } + + public void setMethod(AuthEventMethod method) { + this.method = method; + } + + + public AuthEventCreateReq status(AuthEventStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public AuthEventStatus getStatus() { + return status; + } + + public void setStatus(AuthEventStatus status) { + this.status = status; + } + + + public AuthEventCreateReq clientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + return this; + } + + /** + * Get clientInformation + * @return clientInformation + */ + @javax.annotation.Nonnull + public ClientInformation getClientInformation() { + return clientInformation; + } + + public void setClientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthEventCreateReq authEventCreateReq = (AuthEventCreateReq) o; + return Objects.equals(this.username, authEventCreateReq.username) && + Objects.equals(this.eventType, authEventCreateReq.eventType) && + Objects.equals(this.method, authEventCreateReq.method) && + Objects.equals(this.status, authEventCreateReq.status) && + Objects.equals(this.clientInformation, authEventCreateReq.clientInformation); + } + + @Override + public int hashCode() { + return Objects.hash(username, eventType, method, status, clientInformation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthEventCreateReq {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("username"); + openapiFields.add("eventType"); + openapiFields.add("method"); + openapiFields.add("status"); + openapiFields.add("clientInformation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("eventType"); + openapiRequiredFields.add("method"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("clientInformation"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AuthEventCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthEventCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthEventCreateReq is not found in the empty JSON string", AuthEventCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AuthEventCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthEventCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AuthEventCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + // validate the required field `eventType` + AuthEventType.validateJsonElement(jsonObj.get("eventType")); + // validate the required field `method` + AuthEventMethod.validateJsonElement(jsonObj.get("method")); + // validate the required field `status` + AuthEventStatus.validateJsonElement(jsonObj.get("status")); + // validate the required field `clientInformation` + ClientInformation.validateJsonElement(jsonObj.get("clientInformation")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuthEventCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthEventCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthEventCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AuthEventCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AuthEventCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthEventCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthEventCreateReq + * @throws IOException if the JSON string is invalid with respect to AuthEventCreateReq + */ + public static AuthEventCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthEventCreateReq.class); + } + + /** + * Convert an instance of AuthEventCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AuthEventMethod.java b/src/main/java/com/corbado/generated/model/AuthEventMethod.java new file mode 100644 index 0000000..ff07d4d --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AuthEventMethod.java @@ -0,0 +1,90 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets authEventMethod + */ +@JsonAdapter(AuthEventMethod.Adapter.class) +public enum AuthEventMethod { + + PASSWORD("password"), + + EMAIL_OTP("email_otp"), + + EMAIL_LINK("email_link"), + + PHONE_OTP("phone_otp"), + + PASSKEY("passkey"), + + SOCIAL_GITHUB("social_github"), + + SOCIAL_GOOGLE("social_google"), + + SOCIAL_MICROSOFT("social_microsoft"); + + private String value; + + AuthEventMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AuthEventMethod fromValue(String value) { + for (AuthEventMethod b : AuthEventMethod.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AuthEventMethod enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AuthEventMethod read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AuthEventMethod.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AuthEventMethod.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AuthEventStatus.java b/src/main/java/com/corbado/generated/model/AuthEventStatus.java new file mode 100644 index 0000000..5dc76c7 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AuthEventStatus.java @@ -0,0 +1,78 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets authEventStatus + */ +@JsonAdapter(AuthEventStatus.Adapter.class) +public enum AuthEventStatus { + + SUCCESS("success"), + + FAILURE("failure"); + + private String value; + + AuthEventStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AuthEventStatus fromValue(String value) { + for (AuthEventStatus b : AuthEventStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AuthEventStatus enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AuthEventStatus read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AuthEventStatus.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AuthEventStatus.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AuthEventType.java b/src/main/java/com/corbado/generated/model/AuthEventType.java new file mode 100644 index 0000000..b5d9d74 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/AuthEventType.java @@ -0,0 +1,80 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets authEventType + */ +@JsonAdapter(AuthEventType.Adapter.class) +public enum AuthEventType { + + SIGN_UP("sign_up"), + + LOGIN("login"), + + NEW_PASSKEY_ADDED("new_passkey_added"); + + private String value; + + AuthEventType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AuthEventType fromValue(String value) { + for (AuthEventType b : AuthEventType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AuthEventType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AuthEventType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AuthEventType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AuthEventType.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/AuthMethod.java b/src/main/java/com/corbado/generated/model/AuthMethod.java deleted file mode 100644 index 187870b..0000000 --- a/src/main/java/com/corbado/generated/model/AuthMethod.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Authentication methods - */ -@JsonAdapter(AuthMethod.Adapter.class) -public enum AuthMethod { - - EMAIL("email"), - - PHONE_NUMBER("phone_number"), - - WEBAUTHN("webauthn"), - - PASSWORD("password"); - - private String value; - - AuthMethod(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AuthMethod fromValue(String value) { - for (AuthMethod b : AuthMethod.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AuthMethod enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AuthMethod read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AuthMethod.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - AuthMethod.fromValue(value); - } -} - diff --git a/src/main/java/com/corbado/generated/model/AuthMethodsListReq.java b/src/main/java/com/corbado/generated/model/AuthMethodsListReq.java deleted file mode 100644 index 623dce7..0000000 --- a/src/main/java/com/corbado/generated/model/AuthMethodsListReq.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * AuthMethodsListReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class AuthMethodsListReq { - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private String username; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public AuthMethodsListReq() { - } - - public AuthMethodsListReq username(String username) { - this.username = username; - return this; - } - - /** - * Client's username - * @return username - **/ - @javax.annotation.Nonnull - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - - public AuthMethodsListReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public AuthMethodsListReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nonnull - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AuthMethodsListReq authMethodsListReq = (AuthMethodsListReq) o; - return Objects.equals(this.username, authMethodsListReq.username) && - Objects.equals(this.requestID, authMethodsListReq.requestID) && - Objects.equals(this.clientInfo, authMethodsListReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(username, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AuthMethodsListReq {\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("username"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("username"); - openapiRequiredFields.add("clientInfo"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AuthMethodsListReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AuthMethodsListReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AuthMethodsListReq is not found in the empty JSON string", AuthMethodsListReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AuthMethodsListReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthMethodsListReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AuthMethodsListReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the required field `clientInfo` - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AuthMethodsListReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AuthMethodsListReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AuthMethodsListReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AuthMethodsListReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AuthMethodsListReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AuthMethodsListReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of AuthMethodsListReq - * @throws IOException if the JSON string is invalid with respect to AuthMethodsListReq - */ - public static AuthMethodsListReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AuthMethodsListReq.class); - } - - /** - * Convert an instance of AuthMethodsListReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/AuthMethodsListRsp.java b/src/main/java/com/corbado/generated/model/AuthMethodsListRsp.java deleted file mode 100644 index c6627c0..0000000 --- a/src/main/java/com/corbado/generated/model/AuthMethodsListRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.AuthMethodsListRspAllOfData; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * AuthMethodsListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class AuthMethodsListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private AuthMethodsListRspAllOfData data; - - public AuthMethodsListRsp() { - } - - public AuthMethodsListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public AuthMethodsListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public AuthMethodsListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public AuthMethodsListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public AuthMethodsListRsp data(AuthMethodsListRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public AuthMethodsListRspAllOfData getData() { - return data; - } - - public void setData(AuthMethodsListRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AuthMethodsListRsp authMethodsListRsp = (AuthMethodsListRsp) o; - return Objects.equals(this.httpStatusCode, authMethodsListRsp.httpStatusCode) && - Objects.equals(this.message, authMethodsListRsp.message) && - Objects.equals(this.requestData, authMethodsListRsp.requestData) && - Objects.equals(this.runtime, authMethodsListRsp.runtime) && - Objects.equals(this.data, authMethodsListRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AuthMethodsListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AuthMethodsListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AuthMethodsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AuthMethodsListRsp is not found in the empty JSON string", AuthMethodsListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AuthMethodsListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthMethodsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AuthMethodsListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - AuthMethodsListRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AuthMethodsListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AuthMethodsListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AuthMethodsListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AuthMethodsListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AuthMethodsListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AuthMethodsListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of AuthMethodsListRsp - * @throws IOException if the JSON string is invalid with respect to AuthMethodsListRsp - */ - public static AuthMethodsListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AuthMethodsListRsp.class); - } - - /** - * Convert an instance of AuthMethodsListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/AuthMethodsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/AuthMethodsListRspAllOfData.java deleted file mode 100644 index d0ff59a..0000000 --- a/src/main/java/com/corbado/generated/model/AuthMethodsListRspAllOfData.java +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.AuthMethod; -import com.corbado.generated.model.Paging; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * AuthMethodsListRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class AuthMethodsListRspAllOfData { - public static final String SERIALIZED_NAME_SELECT_METHODS = "selectMethods"; - @SerializedName(SERIALIZED_NAME_SELECT_METHODS) - private List selectMethods = new ArrayList<>(); - - public static final String SERIALIZED_NAME_POSSIBLE_METHODS = "possibleMethods"; - @SerializedName(SERIALIZED_NAME_POSSIBLE_METHODS) - private List possibleMethods = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public AuthMethodsListRspAllOfData() { - } - - public AuthMethodsListRspAllOfData selectMethods(List selectMethods) { - this.selectMethods = selectMethods; - return this; - } - - public AuthMethodsListRspAllOfData addSelectMethodsItem(AuthMethod selectMethodsItem) { - if (this.selectMethods == null) { - this.selectMethods = new ArrayList<>(); - } - this.selectMethods.add(selectMethodsItem); - return this; - } - - /** - * Get selectMethods - * @return selectMethods - **/ - @javax.annotation.Nonnull - public List getSelectMethods() { - return selectMethods; - } - - public void setSelectMethods(List selectMethods) { - this.selectMethods = selectMethods; - } - - - public AuthMethodsListRspAllOfData possibleMethods(List possibleMethods) { - this.possibleMethods = possibleMethods; - return this; - } - - public AuthMethodsListRspAllOfData addPossibleMethodsItem(AuthMethod possibleMethodsItem) { - if (this.possibleMethods == null) { - this.possibleMethods = new ArrayList<>(); - } - this.possibleMethods.add(possibleMethodsItem); - return this; - } - - /** - * Get possibleMethods - * @return possibleMethods - **/ - @javax.annotation.Nonnull - public List getPossibleMethods() { - return possibleMethods; - } - - public void setPossibleMethods(List possibleMethods) { - this.possibleMethods = possibleMethods; - } - - - public AuthMethodsListRspAllOfData paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AuthMethodsListRspAllOfData authMethodsListRspAllOfData = (AuthMethodsListRspAllOfData) o; - return Objects.equals(this.selectMethods, authMethodsListRspAllOfData.selectMethods) && - Objects.equals(this.possibleMethods, authMethodsListRspAllOfData.possibleMethods) && - Objects.equals(this.paging, authMethodsListRspAllOfData.paging); - } - - @Override - public int hashCode() { - return Objects.hash(selectMethods, possibleMethods, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AuthMethodsListRspAllOfData {\n"); - sb.append(" selectMethods: ").append(toIndentedString(selectMethods)).append("\n"); - sb.append(" possibleMethods: ").append(toIndentedString(possibleMethods)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("selectMethods"); - openapiFields.add("possibleMethods"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("selectMethods"); - openapiRequiredFields.add("possibleMethods"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AuthMethodsListRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AuthMethodsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AuthMethodsListRspAllOfData is not found in the empty JSON string", AuthMethodsListRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AuthMethodsListRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthMethodsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AuthMethodsListRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("selectMethods") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("selectMethods").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `selectMethods` to be an array in the JSON string but got `%s`", jsonObj.get("selectMethods").toString())); - } - // ensure the required json array is present - if (jsonObj.get("possibleMethods") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("possibleMethods").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `possibleMethods` to be an array in the JSON string but got `%s`", jsonObj.get("possibleMethods").toString())); - } - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AuthMethodsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AuthMethodsListRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AuthMethodsListRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AuthMethodsListRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AuthMethodsListRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AuthMethodsListRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of AuthMethodsListRspAllOfData - * @throws IOException if the JSON string is invalid with respect to AuthMethodsListRspAllOfData - */ - public static AuthMethodsListRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AuthMethodsListRspAllOfData.class); - } - - /** - * Convert an instance of AuthMethodsListRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/AuthTokenValidateReq.java b/src/main/java/com/corbado/generated/model/AuthTokenValidateReq.java deleted file mode 100644 index a861ce3..0000000 --- a/src/main/java/com/corbado/generated/model/AuthTokenValidateReq.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * AuthTokenValidateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class AuthTokenValidateReq { - public static final String SERIALIZED_NAME_TOKEN = "token"; - @SerializedName(SERIALIZED_NAME_TOKEN) - private String token; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public AuthTokenValidateReq() { - } - - public AuthTokenValidateReq token(String token) { - this.token = token; - return this; - } - - /** - * Get token - * @return token - **/ - @javax.annotation.Nonnull - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - - - public AuthTokenValidateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public AuthTokenValidateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nonnull - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AuthTokenValidateReq authTokenValidateReq = (AuthTokenValidateReq) o; - return Objects.equals(this.token, authTokenValidateReq.token) && - Objects.equals(this.requestID, authTokenValidateReq.requestID) && - Objects.equals(this.clientInfo, authTokenValidateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(token, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AuthTokenValidateReq {\n"); - sb.append(" token: ").append(toIndentedString(token)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("token"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("token"); - openapiRequiredFields.add("clientInfo"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AuthTokenValidateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AuthTokenValidateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AuthTokenValidateReq is not found in the empty JSON string", AuthTokenValidateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AuthTokenValidateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthTokenValidateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AuthTokenValidateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the required field `clientInfo` - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AuthTokenValidateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AuthTokenValidateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AuthTokenValidateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AuthTokenValidateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AuthTokenValidateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AuthTokenValidateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of AuthTokenValidateReq - * @throws IOException if the JSON string is invalid with respect to AuthTokenValidateReq - */ - public static AuthTokenValidateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AuthTokenValidateReq.class); - } - - /** - * Convert an instance of AuthTokenValidateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/AuthTokenValidateRsp.java b/src/main/java/com/corbado/generated/model/AuthTokenValidateRsp.java deleted file mode 100644 index cab43c7..0000000 --- a/src/main/java/com/corbado/generated/model/AuthTokenValidateRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.SessionTokenVerifyRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * AuthTokenValidateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class AuthTokenValidateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private SessionTokenVerifyRspAllOfData data; - - public AuthTokenValidateRsp() { - } - - public AuthTokenValidateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public AuthTokenValidateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public AuthTokenValidateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public AuthTokenValidateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public AuthTokenValidateRsp data(SessionTokenVerifyRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public SessionTokenVerifyRspAllOfData getData() { - return data; - } - - public void setData(SessionTokenVerifyRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AuthTokenValidateRsp authTokenValidateRsp = (AuthTokenValidateRsp) o; - return Objects.equals(this.httpStatusCode, authTokenValidateRsp.httpStatusCode) && - Objects.equals(this.message, authTokenValidateRsp.message) && - Objects.equals(this.requestData, authTokenValidateRsp.requestData) && - Objects.equals(this.runtime, authTokenValidateRsp.runtime) && - Objects.equals(this.data, authTokenValidateRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AuthTokenValidateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AuthTokenValidateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!AuthTokenValidateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in AuthTokenValidateRsp is not found in the empty JSON string", AuthTokenValidateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!AuthTokenValidateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthTokenValidateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AuthTokenValidateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - SessionTokenVerifyRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!AuthTokenValidateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'AuthTokenValidateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(AuthTokenValidateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, AuthTokenValidateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public AuthTokenValidateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of AuthTokenValidateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of AuthTokenValidateRsp - * @throws IOException if the JSON string is invalid with respect to AuthTokenValidateRsp - */ - public static AuthTokenValidateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, AuthTokenValidateRsp.class); - } - - /** - * Convert an instance of AuthTokenValidateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/Challenge.java b/src/main/java/com/corbado/generated/model/Challenge.java new file mode 100644 index 0000000..75d1f74 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/Challenge.java @@ -0,0 +1,334 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ChallengeStatus; +import com.corbado.generated.model.ChallengeType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * Challenge + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class Challenge { + public static final String SERIALIZED_NAME_CHALLENGE_I_D = "challengeID"; + @SerializedName(SERIALIZED_NAME_CHALLENGE_I_D) + private String challengeID; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private ChallengeType type; + + public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) + private String identifierValue; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private ChallengeStatus status; + + public Challenge() { + } + + public Challenge challengeID(String challengeID) { + this.challengeID = challengeID; + return this; + } + + /** + * Get challengeID + * @return challengeID + */ + @javax.annotation.Nonnull + public String getChallengeID() { + return challengeID; + } + + public void setChallengeID(String challengeID) { + this.challengeID = challengeID; + } + + + public Challenge type(ChallengeType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public ChallengeType getType() { + return type; + } + + public void setType(ChallengeType type) { + this.type = type; + } + + + public Challenge identifierValue(String identifierValue) { + this.identifierValue = identifierValue; + return this; + } + + /** + * Get identifierValue + * @return identifierValue + */ + @javax.annotation.Nonnull + public String getIdentifierValue() { + return identifierValue; + } + + public void setIdentifierValue(String identifierValue) { + this.identifierValue = identifierValue; + } + + + public Challenge value(String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + public Challenge status(ChallengeStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public ChallengeStatus getStatus() { + return status; + } + + public void setStatus(ChallengeStatus status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Challenge challenge = (Challenge) o; + return Objects.equals(this.challengeID, challenge.challengeID) && + Objects.equals(this.type, challenge.type) && + Objects.equals(this.identifierValue, challenge.identifierValue) && + Objects.equals(this.value, challenge.value) && + Objects.equals(this.status, challenge.status); + } + + @Override + public int hashCode() { + return Objects.hash(challengeID, type, identifierValue, value, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Challenge {\n"); + sb.append(" challengeID: ").append(toIndentedString(challengeID)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" identifierValue: ").append(toIndentedString(identifierValue)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("challengeID"); + openapiFields.add("type"); + openapiFields.add("identifierValue"); + openapiFields.add("value"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("challengeID"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("identifierValue"); + openapiRequiredFields.add("value"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Challenge + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Challenge.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Challenge is not found in the empty JSON string", Challenge.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Challenge.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Challenge` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Challenge.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("challengeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `challengeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("challengeID").toString())); + } + // validate the required field `type` + ChallengeType.validateJsonElement(jsonObj.get("type")); + if (!jsonObj.get("identifierValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identifierValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifierValue").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + // validate the required field `status` + ChallengeStatus.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Challenge.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Challenge' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Challenge.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Challenge value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Challenge read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Challenge given an JSON string + * + * @param jsonString JSON string + * @return An instance of Challenge + * @throws IOException if the JSON string is invalid with respect to Challenge + */ + public static Challenge fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Challenge.class); + } + + /** + * Convert an instance of Challenge to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ChallengeCreateReq.java b/src/main/java/com/corbado/generated/model/ChallengeCreateReq.java new file mode 100644 index 0000000..46bf4a5 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ChallengeCreateReq.java @@ -0,0 +1,300 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ChallengeType; +import com.corbado.generated.model.ClientInformation; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ChallengeCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class ChallengeCreateReq { + public static final String SERIALIZED_NAME_CHALLENGE_TYPE = "challengeType"; + @SerializedName(SERIALIZED_NAME_CHALLENGE_TYPE) + private ChallengeType challengeType; + + public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) + private String identifierValue; + + public static final String SERIALIZED_NAME_CHALLENGE_METADATA = "challengeMetadata"; + @SerializedName(SERIALIZED_NAME_CHALLENGE_METADATA) + private Object challengeMetadata; + + public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + private ClientInformation clientInformation; + + public ChallengeCreateReq() { + } + + public ChallengeCreateReq challengeType(ChallengeType challengeType) { + this.challengeType = challengeType; + return this; + } + + /** + * Get challengeType + * @return challengeType + */ + @javax.annotation.Nonnull + public ChallengeType getChallengeType() { + return challengeType; + } + + public void setChallengeType(ChallengeType challengeType) { + this.challengeType = challengeType; + } + + + public ChallengeCreateReq identifierValue(String identifierValue) { + this.identifierValue = identifierValue; + return this; + } + + /** + * Get identifierValue + * @return identifierValue + */ + @javax.annotation.Nonnull + public String getIdentifierValue() { + return identifierValue; + } + + public void setIdentifierValue(String identifierValue) { + this.identifierValue = identifierValue; + } + + + public ChallengeCreateReq challengeMetadata(Object challengeMetadata) { + this.challengeMetadata = challengeMetadata; + return this; + } + + /** + * Get challengeMetadata + * @return challengeMetadata + */ + @javax.annotation.Nullable + public Object getChallengeMetadata() { + return challengeMetadata; + } + + public void setChallengeMetadata(Object challengeMetadata) { + this.challengeMetadata = challengeMetadata; + } + + + public ChallengeCreateReq clientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + return this; + } + + /** + * Get clientInformation + * @return clientInformation + */ + @javax.annotation.Nonnull + public ClientInformation getClientInformation() { + return clientInformation; + } + + public void setClientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChallengeCreateReq challengeCreateReq = (ChallengeCreateReq) o; + return Objects.equals(this.challengeType, challengeCreateReq.challengeType) && + Objects.equals(this.identifierValue, challengeCreateReq.identifierValue) && + Objects.equals(this.challengeMetadata, challengeCreateReq.challengeMetadata) && + Objects.equals(this.clientInformation, challengeCreateReq.clientInformation); + } + + @Override + public int hashCode() { + return Objects.hash(challengeType, identifierValue, challengeMetadata, clientInformation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChallengeCreateReq {\n"); + sb.append(" challengeType: ").append(toIndentedString(challengeType)).append("\n"); + sb.append(" identifierValue: ").append(toIndentedString(identifierValue)).append("\n"); + sb.append(" challengeMetadata: ").append(toIndentedString(challengeMetadata)).append("\n"); + sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("challengeType"); + openapiFields.add("identifierValue"); + openapiFields.add("challengeMetadata"); + openapiFields.add("clientInformation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("challengeType"); + openapiRequiredFields.add("identifierValue"); + openapiRequiredFields.add("clientInformation"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ChallengeCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ChallengeCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ChallengeCreateReq is not found in the empty JSON string", ChallengeCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ChallengeCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ChallengeCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ChallengeCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `challengeType` + ChallengeType.validateJsonElement(jsonObj.get("challengeType")); + if (!jsonObj.get("identifierValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identifierValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifierValue").toString())); + } + // validate the required field `clientInformation` + ClientInformation.validateJsonElement(jsonObj.get("clientInformation")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ChallengeCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ChallengeCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ChallengeCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ChallengeCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ChallengeCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ChallengeCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of ChallengeCreateReq + * @throws IOException if the JSON string is invalid with respect to ChallengeCreateReq + */ + public static ChallengeCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ChallengeCreateReq.class); + } + + /** + * Convert an instance of ChallengeCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ChallengeStatus.java b/src/main/java/com/corbado/generated/model/ChallengeStatus.java new file mode 100644 index 0000000..a5a04d3 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ChallengeStatus.java @@ -0,0 +1,80 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets challengeStatus + */ +@JsonAdapter(ChallengeStatus.Adapter.class) +public enum ChallengeStatus { + + PENDING("pending"), + + COMPLETED("completed"), + + EXPIRED("expired"); + + private String value; + + ChallengeStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ChallengeStatus fromValue(String value) { + for (ChallengeStatus b : ChallengeStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ChallengeStatus enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ChallengeStatus read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ChallengeStatus.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ChallengeStatus.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ChallengeType.java b/src/main/java/com/corbado/generated/model/ChallengeType.java new file mode 100644 index 0000000..dc37c63 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ChallengeType.java @@ -0,0 +1,80 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets challengeType + */ +@JsonAdapter(ChallengeType.Adapter.class) +public enum ChallengeType { + + EMAIL_OTP("email_otp"), + + EMAIL_LINK("email_link"), + + SMS_OTP("sms_otp"); + + private String value; + + ChallengeType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ChallengeType fromValue(String value) { + for (ChallengeType b : ChallengeType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ChallengeType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ChallengeType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ChallengeType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ChallengeType.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java b/src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java new file mode 100644 index 0000000..9b65f6c --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ChallengeUpdateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class ChallengeUpdateReq { + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public ChallengeUpdateReq() { + } + + public ChallengeUpdateReq value(String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChallengeUpdateReq challengeUpdateReq = (ChallengeUpdateReq) o; + return Objects.equals(this.value, challengeUpdateReq.value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChallengeUpdateReq {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ChallengeUpdateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ChallengeUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ChallengeUpdateReq is not found in the empty JSON string", ChallengeUpdateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ChallengeUpdateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ChallengeUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ChallengeUpdateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ChallengeUpdateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ChallengeUpdateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ChallengeUpdateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ChallengeUpdateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ChallengeUpdateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ChallengeUpdateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of ChallengeUpdateReq + * @throws IOException if the JSON string is invalid with respect to ChallengeUpdateReq + */ + public static ChallengeUpdateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ChallengeUpdateReq.class); + } + + /** + * Convert an instance of ChallengeUpdateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ClientInfo.java b/src/main/java/com/corbado/generated/model/ClientInfo.java deleted file mode 100644 index 21e68e4..0000000 --- a/src/main/java/com/corbado/generated/model/ClientInfo.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ClientInfo - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ClientInfo { - public static final String SERIALIZED_NAME_REMOTE_ADDRESS = "remoteAddress"; - @SerializedName(SERIALIZED_NAME_REMOTE_ADDRESS) - private String remoteAddress; - - public static final String SERIALIZED_NAME_USER_AGENT = "userAgent"; - @SerializedName(SERIALIZED_NAME_USER_AGENT) - private String userAgent; - - public ClientInfo() { - } - - public ClientInfo remoteAddress(String remoteAddress) { - this.remoteAddress = remoteAddress; - return this; - } - - /** - * client's IP address - * @return remoteAddress - **/ - @javax.annotation.Nonnull - public String getRemoteAddress() { - return remoteAddress; - } - - public void setRemoteAddress(String remoteAddress) { - this.remoteAddress = remoteAddress; - } - - - public ClientInfo userAgent(String userAgent) { - this.userAgent = userAgent; - return this; - } - - /** - * client's User Agent - * @return userAgent - **/ - @javax.annotation.Nonnull - public String getUserAgent() { - return userAgent; - } - - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClientInfo clientInfo = (ClientInfo) o; - return Objects.equals(this.remoteAddress, clientInfo.remoteAddress) && - Objects.equals(this.userAgent, clientInfo.userAgent); - } - - @Override - public int hashCode() { - return Objects.hash(remoteAddress, userAgent); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClientInfo {\n"); - sb.append(" remoteAddress: ").append(toIndentedString(remoteAddress)).append("\n"); - sb.append(" userAgent: ").append(toIndentedString(userAgent)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("remoteAddress"); - openapiFields.add("userAgent"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("remoteAddress"); - openapiRequiredFields.add("userAgent"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ClientInfo - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ClientInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ClientInfo is not found in the empty JSON string", ClientInfo.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ClientInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClientInfo` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ClientInfo.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("remoteAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `remoteAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remoteAddress").toString())); - } - if (!jsonObj.get("userAgent").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userAgent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userAgent").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ClientInfo.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ClientInfo' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ClientInfo.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ClientInfo value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ClientInfo read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ClientInfo given an JSON string - * - * @param jsonString JSON string - * @return An instance of ClientInfo - * @throws IOException if the JSON string is invalid with respect to ClientInfo - */ - public static ClientInfo fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ClientInfo.class); - } - - /** - * Convert an instance of ClientInfo to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ClientInformation.java b/src/main/java/com/corbado/generated/model/ClientInformation.java new file mode 100644 index 0000000..4eb743f --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ClientInformation.java @@ -0,0 +1,412 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.JavaScriptHighEntropy; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ClientInformation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class ClientInformation { + public static final String SERIALIZED_NAME_REMOTE_ADDRESS = "remoteAddress"; + @SerializedName(SERIALIZED_NAME_REMOTE_ADDRESS) + private String remoteAddress; + + public static final String SERIALIZED_NAME_USER_AGENT = "userAgent"; + @SerializedName(SERIALIZED_NAME_USER_AGENT) + private String userAgent; + + public static final String SERIALIZED_NAME_CLIENT_ENV_HANDLE = "clientEnvHandle"; + @SerializedName(SERIALIZED_NAME_CLIENT_ENV_HANDLE) + private String clientEnvHandle; + + public static final String SERIALIZED_NAME_JAVASCRIPT_FINGERPRINT = "javascriptFingerprint"; + @SerializedName(SERIALIZED_NAME_JAVASCRIPT_FINGERPRINT) + private String javascriptFingerprint; + + public static final String SERIALIZED_NAME_JAVA_SCRIPT_HIGH_ENTROPY = "javaScriptHighEntropy"; + @SerializedName(SERIALIZED_NAME_JAVA_SCRIPT_HIGH_ENTROPY) + private JavaScriptHighEntropy javaScriptHighEntropy; + + public static final String SERIALIZED_NAME_BLUETOOTH_AVAILABLE = "bluetoothAvailable"; + @SerializedName(SERIALIZED_NAME_BLUETOOTH_AVAILABLE) + private Boolean bluetoothAvailable; + + public static final String SERIALIZED_NAME_PASSWORD_MANAGER_AVAILABLE = "passwordManagerAvailable"; + @SerializedName(SERIALIZED_NAME_PASSWORD_MANAGER_AVAILABLE) + private Boolean passwordManagerAvailable; + + public static final String SERIALIZED_NAME_USER_VERIFYING_PLATFORM_AUTHENTICATOR_AVAILABLE = "userVerifyingPlatformAuthenticatorAvailable"; + @SerializedName(SERIALIZED_NAME_USER_VERIFYING_PLATFORM_AUTHENTICATOR_AVAILABLE) + private Boolean userVerifyingPlatformAuthenticatorAvailable; + + public ClientInformation() { + } + + public ClientInformation remoteAddress(String remoteAddress) { + this.remoteAddress = remoteAddress; + return this; + } + + /** + * Client's IP address + * @return remoteAddress + */ + @javax.annotation.Nonnull + public String getRemoteAddress() { + return remoteAddress; + } + + public void setRemoteAddress(String remoteAddress) { + this.remoteAddress = remoteAddress; + } + + + public ClientInformation userAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + * Client's user agent + * @return userAgent + */ + @javax.annotation.Nonnull + public String getUserAgent() { + return userAgent; + } + + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + + public ClientInformation clientEnvHandle(String clientEnvHandle) { + this.clientEnvHandle = clientEnvHandle; + return this; + } + + /** + * Client's environment handle + * @return clientEnvHandle + */ + @javax.annotation.Nullable + public String getClientEnvHandle() { + return clientEnvHandle; + } + + public void setClientEnvHandle(String clientEnvHandle) { + this.clientEnvHandle = clientEnvHandle; + } + + + public ClientInformation javascriptFingerprint(String javascriptFingerprint) { + this.javascriptFingerprint = javascriptFingerprint; + return this; + } + + /** + * Client's fingerprint + * @return javascriptFingerprint + */ + @javax.annotation.Nullable + public String getJavascriptFingerprint() { + return javascriptFingerprint; + } + + public void setJavascriptFingerprint(String javascriptFingerprint) { + this.javascriptFingerprint = javascriptFingerprint; + } + + + public ClientInformation javaScriptHighEntropy(JavaScriptHighEntropy javaScriptHighEntropy) { + this.javaScriptHighEntropy = javaScriptHighEntropy; + return this; + } + + /** + * Get javaScriptHighEntropy + * @return javaScriptHighEntropy + */ + @javax.annotation.Nullable + public JavaScriptHighEntropy getJavaScriptHighEntropy() { + return javaScriptHighEntropy; + } + + public void setJavaScriptHighEntropy(JavaScriptHighEntropy javaScriptHighEntropy) { + this.javaScriptHighEntropy = javaScriptHighEntropy; + } + + + public ClientInformation bluetoothAvailable(Boolean bluetoothAvailable) { + this.bluetoothAvailable = bluetoothAvailable; + return this; + } + + /** + * Client's Bluetooth availability + * @return bluetoothAvailable + */ + @javax.annotation.Nullable + public Boolean getBluetoothAvailable() { + return bluetoothAvailable; + } + + public void setBluetoothAvailable(Boolean bluetoothAvailable) { + this.bluetoothAvailable = bluetoothAvailable; + } + + + public ClientInformation passwordManagerAvailable(Boolean passwordManagerAvailable) { + this.passwordManagerAvailable = passwordManagerAvailable; + return this; + } + + /** + * Client's password manager availability + * @return passwordManagerAvailable + */ + @javax.annotation.Nullable + public Boolean getPasswordManagerAvailable() { + return passwordManagerAvailable; + } + + public void setPasswordManagerAvailable(Boolean passwordManagerAvailable) { + this.passwordManagerAvailable = passwordManagerAvailable; + } + + + public ClientInformation userVerifyingPlatformAuthenticatorAvailable(Boolean userVerifyingPlatformAuthenticatorAvailable) { + this.userVerifyingPlatformAuthenticatorAvailable = userVerifyingPlatformAuthenticatorAvailable; + return this; + } + + /** + * Get userVerifyingPlatformAuthenticatorAvailable + * @return userVerifyingPlatformAuthenticatorAvailable + */ + @javax.annotation.Nonnull + public Boolean getUserVerifyingPlatformAuthenticatorAvailable() { + return userVerifyingPlatformAuthenticatorAvailable; + } + + public void setUserVerifyingPlatformAuthenticatorAvailable(Boolean userVerifyingPlatformAuthenticatorAvailable) { + this.userVerifyingPlatformAuthenticatorAvailable = userVerifyingPlatformAuthenticatorAvailable; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientInformation clientInformation = (ClientInformation) o; + return Objects.equals(this.remoteAddress, clientInformation.remoteAddress) && + Objects.equals(this.userAgent, clientInformation.userAgent) && + Objects.equals(this.clientEnvHandle, clientInformation.clientEnvHandle) && + Objects.equals(this.javascriptFingerprint, clientInformation.javascriptFingerprint) && + Objects.equals(this.javaScriptHighEntropy, clientInformation.javaScriptHighEntropy) && + Objects.equals(this.bluetoothAvailable, clientInformation.bluetoothAvailable) && + Objects.equals(this.passwordManagerAvailable, clientInformation.passwordManagerAvailable) && + Objects.equals(this.userVerifyingPlatformAuthenticatorAvailable, clientInformation.userVerifyingPlatformAuthenticatorAvailable); + } + + @Override + public int hashCode() { + return Objects.hash(remoteAddress, userAgent, clientEnvHandle, javascriptFingerprint, javaScriptHighEntropy, bluetoothAvailable, passwordManagerAvailable, userVerifyingPlatformAuthenticatorAvailable); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClientInformation {\n"); + sb.append(" remoteAddress: ").append(toIndentedString(remoteAddress)).append("\n"); + sb.append(" userAgent: ").append(toIndentedString(userAgent)).append("\n"); + sb.append(" clientEnvHandle: ").append(toIndentedString(clientEnvHandle)).append("\n"); + sb.append(" javascriptFingerprint: ").append(toIndentedString(javascriptFingerprint)).append("\n"); + sb.append(" javaScriptHighEntropy: ").append(toIndentedString(javaScriptHighEntropy)).append("\n"); + sb.append(" bluetoothAvailable: ").append(toIndentedString(bluetoothAvailable)).append("\n"); + sb.append(" passwordManagerAvailable: ").append(toIndentedString(passwordManagerAvailable)).append("\n"); + sb.append(" userVerifyingPlatformAuthenticatorAvailable: ").append(toIndentedString(userVerifyingPlatformAuthenticatorAvailable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("remoteAddress"); + openapiFields.add("userAgent"); + openapiFields.add("clientEnvHandle"); + openapiFields.add("javascriptFingerprint"); + openapiFields.add("javaScriptHighEntropy"); + openapiFields.add("bluetoothAvailable"); + openapiFields.add("passwordManagerAvailable"); + openapiFields.add("userVerifyingPlatformAuthenticatorAvailable"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("remoteAddress"); + openapiRequiredFields.add("userAgent"); + openapiRequiredFields.add("userVerifyingPlatformAuthenticatorAvailable"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ClientInformation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ClientInformation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ClientInformation is not found in the empty JSON string", ClientInformation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ClientInformation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClientInformation` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ClientInformation.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("remoteAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `remoteAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remoteAddress").toString())); + } + if (!jsonObj.get("userAgent").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userAgent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userAgent").toString())); + } + if ((jsonObj.get("clientEnvHandle") != null && !jsonObj.get("clientEnvHandle").isJsonNull()) && !jsonObj.get("clientEnvHandle").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientEnvHandle` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientEnvHandle").toString())); + } + if ((jsonObj.get("javascriptFingerprint") != null && !jsonObj.get("javascriptFingerprint").isJsonNull()) && !jsonObj.get("javascriptFingerprint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `javascriptFingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("javascriptFingerprint").toString())); + } + // validate the optional field `javaScriptHighEntropy` + if (jsonObj.get("javaScriptHighEntropy") != null && !jsonObj.get("javaScriptHighEntropy").isJsonNull()) { + JavaScriptHighEntropy.validateJsonElement(jsonObj.get("javaScriptHighEntropy")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ClientInformation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClientInformation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClientInformation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ClientInformation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ClientInformation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ClientInformation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClientInformation + * @throws IOException if the JSON string is invalid with respect to ClientInformation + */ + public static ClientInformation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClientInformation.class); + } + + /** + * Convert an instance of ClientInformation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ConnectToken.java b/src/main/java/com/corbado/generated/model/ConnectToken.java new file mode 100644 index 0000000..206530d --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ConnectToken.java @@ -0,0 +1,360 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ConnectTokenData; +import com.corbado.generated.model.ConnectTokenStatus; +import com.corbado.generated.model.ConnectTokenType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ConnectToken + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class ConnectToken { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_TOKEN_TYPE = "tokenType"; + @SerializedName(SERIALIZED_NAME_TOKEN_TYPE) + private ConnectTokenType tokenType; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private ConnectTokenData data; + + public static final String SERIALIZED_NAME_CONNECT_TOKEN_STATUS = "connectTokenStatus"; + @SerializedName(SERIALIZED_NAME_CONNECT_TOKEN_STATUS) + private ConnectTokenStatus connectTokenStatus; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public static final String SERIALIZED_NAME_EXPIRES = "expires"; + @SerializedName(SERIALIZED_NAME_EXPIRES) + private Integer expires; + + public ConnectToken() { + } + + public ConnectToken id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public ConnectToken tokenType(ConnectTokenType tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Get tokenType + * @return tokenType + */ + @javax.annotation.Nonnull + public ConnectTokenType getTokenType() { + return tokenType; + } + + public void setTokenType(ConnectTokenType tokenType) { + this.tokenType = tokenType; + } + + + public ConnectToken data(ConnectTokenData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public ConnectTokenData getData() { + return data; + } + + public void setData(ConnectTokenData data) { + this.data = data; + } + + + public ConnectToken connectTokenStatus(ConnectTokenStatus connectTokenStatus) { + this.connectTokenStatus = connectTokenStatus; + return this; + } + + /** + * Get connectTokenStatus + * @return connectTokenStatus + */ + @javax.annotation.Nonnull + public ConnectTokenStatus getConnectTokenStatus() { + return connectTokenStatus; + } + + public void setConnectTokenStatus(ConnectTokenStatus connectTokenStatus) { + this.connectTokenStatus = connectTokenStatus; + } + + + public ConnectToken secret(String secret) { + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @javax.annotation.Nullable + public String getSecret() { + return secret; + } + + public void setSecret(String secret) { + this.secret = secret; + } + + + public ConnectToken expires(Integer expires) { + this.expires = expires; + return this; + } + + /** + * Get expires + * @return expires + */ + @javax.annotation.Nonnull + public Integer getExpires() { + return expires; + } + + public void setExpires(Integer expires) { + this.expires = expires; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectToken connectToken = (ConnectToken) o; + return Objects.equals(this.id, connectToken.id) && + Objects.equals(this.tokenType, connectToken.tokenType) && + Objects.equals(this.data, connectToken.data) && + Objects.equals(this.connectTokenStatus, connectToken.connectTokenStatus) && + Objects.equals(this.secret, connectToken.secret) && + Objects.equals(this.expires, connectToken.expires); + } + + @Override + public int hashCode() { + return Objects.hash(id, tokenType, data, connectTokenStatus, secret, expires); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectToken {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" connectTokenStatus: ").append(toIndentedString(connectTokenStatus)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("tokenType"); + openapiFields.add("data"); + openapiFields.add("connectTokenStatus"); + openapiFields.add("secret"); + openapiFields.add("expires"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("tokenType"); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("connectTokenStatus"); + openapiRequiredFields.add("expires"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConnectToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConnectToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectToken is not found in the empty JSON string", ConnectToken.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConnectToken.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectToken` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConnectToken.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the required field `tokenType` + ConnectTokenType.validateJsonElement(jsonObj.get("tokenType")); + // validate the required field `data` + ConnectTokenData.validateJsonElement(jsonObj.get("data")); + // validate the required field `connectTokenStatus` + ConnectTokenStatus.validateJsonElement(jsonObj.get("connectTokenStatus")); + if ((jsonObj.get("secret") != null && !jsonObj.get("secret").isJsonNull()) && !jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConnectToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectToken' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectToken.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConnectToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConnectToken read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectToken + * @throws IOException if the JSON string is invalid with respect to ConnectToken + */ + public static ConnectToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectToken.class); + } + + /** + * Convert an instance of ConnectToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java b/src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java new file mode 100644 index 0000000..9e3fce0 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java @@ -0,0 +1,270 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ConnectTokenData; +import com.corbado.generated.model.ConnectTokenType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ConnectTokenCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class ConnectTokenCreateReq { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private ConnectTokenType type; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private ConnectTokenData data; + + public static final String SERIALIZED_NAME_MAX_LIFETIME_IN_SECONDS = "maxLifetimeInSeconds"; + @SerializedName(SERIALIZED_NAME_MAX_LIFETIME_IN_SECONDS) + private Integer maxLifetimeInSeconds; + + public ConnectTokenCreateReq() { + } + + public ConnectTokenCreateReq type(ConnectTokenType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public ConnectTokenType getType() { + return type; + } + + public void setType(ConnectTokenType type) { + this.type = type; + } + + + public ConnectTokenCreateReq data(ConnectTokenData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public ConnectTokenData getData() { + return data; + } + + public void setData(ConnectTokenData data) { + this.data = data; + } + + + public ConnectTokenCreateReq maxLifetimeInSeconds(Integer maxLifetimeInSeconds) { + this.maxLifetimeInSeconds = maxLifetimeInSeconds; + return this; + } + + /** + * Get maxLifetimeInSeconds + * @return maxLifetimeInSeconds + */ + @javax.annotation.Nullable + public Integer getMaxLifetimeInSeconds() { + return maxLifetimeInSeconds; + } + + public void setMaxLifetimeInSeconds(Integer maxLifetimeInSeconds) { + this.maxLifetimeInSeconds = maxLifetimeInSeconds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectTokenCreateReq connectTokenCreateReq = (ConnectTokenCreateReq) o; + return Objects.equals(this.type, connectTokenCreateReq.type) && + Objects.equals(this.data, connectTokenCreateReq.data) && + Objects.equals(this.maxLifetimeInSeconds, connectTokenCreateReq.maxLifetimeInSeconds); + } + + @Override + public int hashCode() { + return Objects.hash(type, data, maxLifetimeInSeconds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectTokenCreateReq {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" maxLifetimeInSeconds: ").append(toIndentedString(maxLifetimeInSeconds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("data"); + openapiFields.add("maxLifetimeInSeconds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConnectTokenCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConnectTokenCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectTokenCreateReq is not found in the empty JSON string", ConnectTokenCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConnectTokenCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectTokenCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConnectTokenCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `type` + ConnectTokenType.validateJsonElement(jsonObj.get("type")); + // validate the required field `data` + ConnectTokenData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConnectTokenCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectTokenCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectTokenCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConnectTokenCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConnectTokenCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectTokenCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectTokenCreateReq + * @throws IOException if the JSON string is invalid with respect to ConnectTokenCreateReq + */ + public static ConnectTokenCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectTokenCreateReq.class); + } + + /** + * Convert an instance of ConnectTokenCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenData.java b/src/main/java/com/corbado/generated/model/ConnectTokenData.java new file mode 100644 index 0000000..d1a5594 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ConnectTokenData.java @@ -0,0 +1,318 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ConnectTokenDataPasskeyAppend; +import com.corbado.generated.model.ConnectTokenDataPasskeyDelete; +import com.corbado.generated.model.ConnectTokenDataPasskeyList; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.corbado.generated.invoker.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class ConnectTokenData extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ConnectTokenData.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConnectTokenData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectTokenData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterConnectTokenDataPasskeyAppend = gson.getDelegateAdapter(this, TypeToken.get(ConnectTokenDataPasskeyAppend.class)); + final TypeAdapter adapterConnectTokenDataPasskeyDelete = gson.getDelegateAdapter(this, TypeToken.get(ConnectTokenDataPasskeyDelete.class)); + final TypeAdapter adapterConnectTokenDataPasskeyList = gson.getDelegateAdapter(this, TypeToken.get(ConnectTokenDataPasskeyList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConnectTokenData value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `ConnectTokenDataPasskeyAppend` + if (value.getActualInstance() instanceof ConnectTokenDataPasskeyAppend) { + JsonElement element = adapterConnectTokenDataPasskeyAppend.toJsonTree((ConnectTokenDataPasskeyAppend)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ConnectTokenDataPasskeyDelete` + if (value.getActualInstance() instanceof ConnectTokenDataPasskeyDelete) { + JsonElement element = adapterConnectTokenDataPasskeyDelete.toJsonTree((ConnectTokenDataPasskeyDelete)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ConnectTokenDataPasskeyList` + if (value.getActualInstance() instanceof ConnectTokenDataPasskeyList) { + JsonElement element = adapterConnectTokenDataPasskeyList.toJsonTree((ConnectTokenDataPasskeyList)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList"); + } + + @Override + public ConnectTokenData read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ConnectTokenDataPasskeyAppend + try { + // validate the JSON object to see if any exception is thrown + ConnectTokenDataPasskeyAppend.validateJsonElement(jsonElement); + actualAdapter = adapterConnectTokenDataPasskeyAppend; + match++; + log.log(Level.FINER, "Input data matches schema 'ConnectTokenDataPasskeyAppend'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ConnectTokenDataPasskeyAppend failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ConnectTokenDataPasskeyAppend'", e); + } + // deserialize ConnectTokenDataPasskeyDelete + try { + // validate the JSON object to see if any exception is thrown + ConnectTokenDataPasskeyDelete.validateJsonElement(jsonElement); + actualAdapter = adapterConnectTokenDataPasskeyDelete; + match++; + log.log(Level.FINER, "Input data matches schema 'ConnectTokenDataPasskeyDelete'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ConnectTokenDataPasskeyDelete failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ConnectTokenDataPasskeyDelete'", e); + } + // deserialize ConnectTokenDataPasskeyList + try { + // validate the JSON object to see if any exception is thrown + ConnectTokenDataPasskeyList.validateJsonElement(jsonElement); + actualAdapter = adapterConnectTokenDataPasskeyList; + match++; + log.log(Level.FINER, "Input data matches schema 'ConnectTokenDataPasskeyList'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ConnectTokenDataPasskeyList failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ConnectTokenDataPasskeyList'", e); + } + + if (match == 1) { + ConnectTokenData ret = new ConnectTokenData(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for ConnectTokenData: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public ConnectTokenData() { + super("oneOf", Boolean.FALSE); + } + + public ConnectTokenData(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ConnectTokenDataPasskeyAppend", ConnectTokenDataPasskeyAppend.class); + schemas.put("ConnectTokenDataPasskeyDelete", ConnectTokenDataPasskeyDelete.class); + schemas.put("ConnectTokenDataPasskeyList", ConnectTokenDataPasskeyList.class); + } + + @Override + public Map> getSchemas() { + return ConnectTokenData.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ConnectTokenDataPasskeyAppend) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ConnectTokenDataPasskeyDelete) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ConnectTokenDataPasskeyList) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList"); + } + + /** + * Get the actual instance, which can be the following: + * ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList + * + * @return The actual instance (ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ConnectTokenDataPasskeyAppend`. If the actual instance is not `ConnectTokenDataPasskeyAppend`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ConnectTokenDataPasskeyAppend` + * @throws ClassCastException if the instance is not `ConnectTokenDataPasskeyAppend` + */ + public ConnectTokenDataPasskeyAppend getConnectTokenDataPasskeyAppend() throws ClassCastException { + return (ConnectTokenDataPasskeyAppend)super.getActualInstance(); + } + /** + * Get the actual instance of `ConnectTokenDataPasskeyDelete`. If the actual instance is not `ConnectTokenDataPasskeyDelete`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ConnectTokenDataPasskeyDelete` + * @throws ClassCastException if the instance is not `ConnectTokenDataPasskeyDelete` + */ + public ConnectTokenDataPasskeyDelete getConnectTokenDataPasskeyDelete() throws ClassCastException { + return (ConnectTokenDataPasskeyDelete)super.getActualInstance(); + } + /** + * Get the actual instance of `ConnectTokenDataPasskeyList`. If the actual instance is not `ConnectTokenDataPasskeyList`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ConnectTokenDataPasskeyList` + * @throws ClassCastException if the instance is not `ConnectTokenDataPasskeyList` + */ + public ConnectTokenDataPasskeyList getConnectTokenDataPasskeyList() throws ClassCastException { + return (ConnectTokenDataPasskeyList)super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConnectTokenData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ConnectTokenDataPasskeyAppend + try { + ConnectTokenDataPasskeyAppend.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ConnectTokenDataPasskeyAppend failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ConnectTokenDataPasskeyDelete + try { + ConnectTokenDataPasskeyDelete.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ConnectTokenDataPasskeyDelete failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ConnectTokenDataPasskeyList + try { + ConnectTokenDataPasskeyList.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ConnectTokenDataPasskeyList failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for ConnectTokenData with oneOf schemas: ConnectTokenDataPasskeyAppend, ConnectTokenDataPasskeyDelete, ConnectTokenDataPasskeyList. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of ConnectTokenData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectTokenData + * @throws IOException if the JSON string is invalid with respect to ConnectTokenData + */ + public static ConnectTokenData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectTokenData.class); + } + + /** + * Convert an instance of ConnectTokenData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java new file mode 100644 index 0000000..3fc9c1d --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java @@ -0,0 +1,244 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ConnectTokenDataPasskeyAppend + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class ConnectTokenDataPasskeyAppend { + public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + private String displayName; + + public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER) + private String identifier; + + public ConnectTokenDataPasskeyAppend() { + } + + public ConnectTokenDataPasskeyAppend displayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get displayName + * @return displayName + */ + @javax.annotation.Nonnull + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + + public ConnectTokenDataPasskeyAppend identifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get identifier + * @return identifier + */ + @javax.annotation.Nonnull + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectTokenDataPasskeyAppend connectTokenDataPasskeyAppend = (ConnectTokenDataPasskeyAppend) o; + return Objects.equals(this.displayName, connectTokenDataPasskeyAppend.displayName) && + Objects.equals(this.identifier, connectTokenDataPasskeyAppend.identifier); + } + + @Override + public int hashCode() { + return Objects.hash(displayName, identifier); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectTokenDataPasskeyAppend {\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("displayName"); + openapiFields.add("identifier"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("displayName"); + openapiRequiredFields.add("identifier"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConnectTokenDataPasskeyAppend + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConnectTokenDataPasskeyAppend.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectTokenDataPasskeyAppend is not found in the empty JSON string", ConnectTokenDataPasskeyAppend.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConnectTokenDataPasskeyAppend.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectTokenDataPasskeyAppend` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConnectTokenDataPasskeyAppend.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("displayName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `displayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayName").toString())); + } + if (!jsonObj.get("identifier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifier").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConnectTokenDataPasskeyAppend.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectTokenDataPasskeyAppend' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectTokenDataPasskeyAppend.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConnectTokenDataPasskeyAppend value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConnectTokenDataPasskeyAppend read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectTokenDataPasskeyAppend given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectTokenDataPasskeyAppend + * @throws IOException if the JSON string is invalid with respect to ConnectTokenDataPasskeyAppend + */ + public static ConnectTokenDataPasskeyAppend fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectTokenDataPasskeyAppend.class); + } + + /** + * Convert an instance of ConnectTokenDataPasskeyAppend to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java new file mode 100644 index 0000000..445812f --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ConnectTokenDataPasskeyDelete + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class ConnectTokenDataPasskeyDelete { + public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER) + private String identifier; + + public ConnectTokenDataPasskeyDelete() { + } + + public ConnectTokenDataPasskeyDelete identifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get identifier + * @return identifier + */ + @javax.annotation.Nonnull + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectTokenDataPasskeyDelete connectTokenDataPasskeyDelete = (ConnectTokenDataPasskeyDelete) o; + return Objects.equals(this.identifier, connectTokenDataPasskeyDelete.identifier); + } + + @Override + public int hashCode() { + return Objects.hash(identifier); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectTokenDataPasskeyDelete {\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("identifier"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("identifier"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConnectTokenDataPasskeyDelete + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConnectTokenDataPasskeyDelete.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectTokenDataPasskeyDelete is not found in the empty JSON string", ConnectTokenDataPasskeyDelete.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConnectTokenDataPasskeyDelete.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectTokenDataPasskeyDelete` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConnectTokenDataPasskeyDelete.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("identifier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifier").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConnectTokenDataPasskeyDelete.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectTokenDataPasskeyDelete' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectTokenDataPasskeyDelete.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConnectTokenDataPasskeyDelete value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConnectTokenDataPasskeyDelete read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectTokenDataPasskeyDelete given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectTokenDataPasskeyDelete + * @throws IOException if the JSON string is invalid with respect to ConnectTokenDataPasskeyDelete + */ + public static ConnectTokenDataPasskeyDelete fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectTokenDataPasskeyDelete.class); + } + + /** + * Convert an instance of ConnectTokenDataPasskeyDelete to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java new file mode 100644 index 0000000..ece4213 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ConnectTokenDataPasskeyList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class ConnectTokenDataPasskeyList { + public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER) + private String identifier; + + public ConnectTokenDataPasskeyList() { + } + + public ConnectTokenDataPasskeyList identifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get identifier + * @return identifier + */ + @javax.annotation.Nonnull + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectTokenDataPasskeyList connectTokenDataPasskeyList = (ConnectTokenDataPasskeyList) o; + return Objects.equals(this.identifier, connectTokenDataPasskeyList.identifier); + } + + @Override + public int hashCode() { + return Objects.hash(identifier); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectTokenDataPasskeyList {\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("identifier"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("identifier"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConnectTokenDataPasskeyList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConnectTokenDataPasskeyList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectTokenDataPasskeyList is not found in the empty JSON string", ConnectTokenDataPasskeyList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConnectTokenDataPasskeyList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectTokenDataPasskeyList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConnectTokenDataPasskeyList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("identifier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifier").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConnectTokenDataPasskeyList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectTokenDataPasskeyList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectTokenDataPasskeyList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConnectTokenDataPasskeyList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConnectTokenDataPasskeyList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectTokenDataPasskeyList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectTokenDataPasskeyList + * @throws IOException if the JSON string is invalid with respect to ConnectTokenDataPasskeyList + */ + public static ConnectTokenDataPasskeyList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectTokenDataPasskeyList.class); + } + + /** + * Convert an instance of ConnectTokenDataPasskeyList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenList.java b/src/main/java/com/corbado/generated/model/ConnectTokenList.java new file mode 100644 index 0000000..1896bd5 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ConnectTokenList.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ConnectToken; +import com.corbado.generated.model.Paging; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ConnectTokenList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class ConnectTokenList { + public static final String SERIALIZED_NAME_CONNECT_TOKENS = "connectTokens"; + @SerializedName(SERIALIZED_NAME_CONNECT_TOKENS) + private List connectTokens = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public ConnectTokenList() { + } + + public ConnectTokenList connectTokens(List connectTokens) { + this.connectTokens = connectTokens; + return this; + } + + public ConnectTokenList addConnectTokensItem(ConnectToken connectTokensItem) { + if (this.connectTokens == null) { + this.connectTokens = new ArrayList<>(); + } + this.connectTokens.add(connectTokensItem); + return this; + } + + /** + * Get connectTokens + * @return connectTokens + */ + @javax.annotation.Nonnull + public List getConnectTokens() { + return connectTokens; + } + + public void setConnectTokens(List connectTokens) { + this.connectTokens = connectTokens; + } + + + public ConnectTokenList paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + */ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectTokenList connectTokenList = (ConnectTokenList) o; + return Objects.equals(this.connectTokens, connectTokenList.connectTokens) && + Objects.equals(this.paging, connectTokenList.paging); + } + + @Override + public int hashCode() { + return Objects.hash(connectTokens, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectTokenList {\n"); + sb.append(" connectTokens: ").append(toIndentedString(connectTokens)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("connectTokens"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("connectTokens"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConnectTokenList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConnectTokenList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectTokenList is not found in the empty JSON string", ConnectTokenList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConnectTokenList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectTokenList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConnectTokenList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("connectTokens").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `connectTokens` to be an array in the JSON string but got `%s`", jsonObj.get("connectTokens").toString())); + } + + JsonArray jsonArrayconnectTokens = jsonObj.getAsJsonArray("connectTokens"); + // validate the required field `connectTokens` (array) + for (int i = 0; i < jsonArrayconnectTokens.size(); i++) { + ConnectToken.validateJsonElement(jsonArrayconnectTokens.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConnectTokenList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectTokenList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectTokenList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConnectTokenList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConnectTokenList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectTokenList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectTokenList + * @throws IOException if the JSON string is invalid with respect to ConnectTokenList + */ + public static ConnectTokenList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectTokenList.class); + } + + /** + * Convert an instance of ConnectTokenList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenStatus.java b/src/main/java/com/corbado/generated/model/ConnectTokenStatus.java new file mode 100644 index 0000000..2a0be6c --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ConnectTokenStatus.java @@ -0,0 +1,78 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets connectTokenStatus + */ +@JsonAdapter(ConnectTokenStatus.Adapter.class) +public enum ConnectTokenStatus { + + INITIAL("initial"), + + CONSUMED("consumed"); + + private String value; + + ConnectTokenStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConnectTokenStatus fromValue(String value) { + for (ConnectTokenStatus b : ConnectTokenStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ConnectTokenStatus enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConnectTokenStatus read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConnectTokenStatus.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConnectTokenStatus.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenType.java b/src/main/java/com/corbado/generated/model/ConnectTokenType.java new file mode 100644 index 0000000..97cf6f8 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ConnectTokenType.java @@ -0,0 +1,80 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets connectTokenType + */ +@JsonAdapter(ConnectTokenType.Adapter.class) +public enum ConnectTokenType { + + APPEND("passkey-append"), + + DELETE("passkey-delete"), + + LIST("passkey-list"); + + private String value; + + ConnectTokenType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConnectTokenType fromValue(String value) { + for (ConnectTokenType b : ConnectTokenType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ConnectTokenType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConnectTokenType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConnectTokenType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConnectTokenType.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java b/src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java new file mode 100644 index 0000000..76b17de --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ConnectTokenStatus; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ConnectTokenUpdateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class ConnectTokenUpdateReq { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private ConnectTokenStatus status; + + public ConnectTokenUpdateReq() { + } + + public ConnectTokenUpdateReq status(ConnectTokenStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public ConnectTokenStatus getStatus() { + return status; + } + + public void setStatus(ConnectTokenStatus status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectTokenUpdateReq connectTokenUpdateReq = (ConnectTokenUpdateReq) o; + return Objects.equals(this.status, connectTokenUpdateReq.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectTokenUpdateReq {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConnectTokenUpdateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConnectTokenUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectTokenUpdateReq is not found in the empty JSON string", ConnectTokenUpdateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ConnectTokenUpdateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectTokenUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConnectTokenUpdateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `status` + ConnectTokenStatus.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConnectTokenUpdateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectTokenUpdateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectTokenUpdateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConnectTokenUpdateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConnectTokenUpdateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectTokenUpdateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectTokenUpdateReq + * @throws IOException if the JSON string is invalid with respect to ConnectTokenUpdateReq + */ + public static ConnectTokenUpdateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectTokenUpdateReq.class); + } + + /** + * Convert an instance of ConnectTokenUpdateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/Credential.java b/src/main/java/com/corbado/generated/model/Credential.java new file mode 100644 index 0000000..a08a277 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/Credential.java @@ -0,0 +1,665 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * Credential + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class Credential { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CREDENTIAL_I_D = "credentialID"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_I_D) + private String credentialID; + + public static final String SERIALIZED_NAME_ATTESTATION_TYPE = "attestationType"; + @SerializedName(SERIALIZED_NAME_ATTESTATION_TYPE) + private String attestationType; + + /** + * Gets or Sets transport + */ + @JsonAdapter(TransportEnum.Adapter.class) + public enum TransportEnum { + USB("usb"), + + NFC("nfc"), + + BLE("ble"), + + INTERNAL("internal"), + + HYBRID("hybrid"), + + SMART_CARD("smart-card"); + + private String value; + + TransportEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TransportEnum fromValue(String value) { + for (TransportEnum b : TransportEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TransportEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TransportEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TransportEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TransportEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TRANSPORT = "transport"; + @SerializedName(SERIALIZED_NAME_TRANSPORT) + private List transport = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BACKUP_ELIGIBLE = "backupEligible"; + @SerializedName(SERIALIZED_NAME_BACKUP_ELIGIBLE) + private Boolean backupEligible; + + public static final String SERIALIZED_NAME_BACKUP_STATE = "backupState"; + @SerializedName(SERIALIZED_NAME_BACKUP_STATE) + private Boolean backupState; + + public static final String SERIALIZED_NAME_AUTHENTICATOR_A_A_G_U_I_D = "authenticatorAAGUID"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATOR_A_A_G_U_I_D) + private String authenticatorAAGUID; + + public static final String SERIALIZED_NAME_SOURCE_O_S = "sourceOS"; + @SerializedName(SERIALIZED_NAME_SOURCE_O_S) + private String sourceOS; + + public static final String SERIALIZED_NAME_SOURCE_BROWSER = "sourceBrowser"; + @SerializedName(SERIALIZED_NAME_SOURCE_BROWSER) + private String sourceBrowser; + + public static final String SERIALIZED_NAME_LAST_USED = "lastUsed"; + @SerializedName(SERIALIZED_NAME_LAST_USED) + private String lastUsed; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + /** + * Status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + PENDING("pending"), + + ACTIVE("active"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public Credential() { + } + + public Credential id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public Credential credentialID(String credentialID) { + this.credentialID = credentialID; + return this; + } + + /** + * Get credentialID + * @return credentialID + */ + @javax.annotation.Nonnull + public String getCredentialID() { + return credentialID; + } + + public void setCredentialID(String credentialID) { + this.credentialID = credentialID; + } + + + public Credential attestationType(String attestationType) { + this.attestationType = attestationType; + return this; + } + + /** + * Get attestationType + * @return attestationType + */ + @javax.annotation.Nonnull + public String getAttestationType() { + return attestationType; + } + + public void setAttestationType(String attestationType) { + this.attestationType = attestationType; + } + + + public Credential transport(List transport) { + this.transport = transport; + return this; + } + + public Credential addTransportItem(TransportEnum transportItem) { + if (this.transport == null) { + this.transport = new ArrayList<>(); + } + this.transport.add(transportItem); + return this; + } + + /** + * Get transport + * @return transport + */ + @javax.annotation.Nonnull + public List getTransport() { + return transport; + } + + public void setTransport(List transport) { + this.transport = transport; + } + + + public Credential backupEligible(Boolean backupEligible) { + this.backupEligible = backupEligible; + return this; + } + + /** + * Get backupEligible + * @return backupEligible + */ + @javax.annotation.Nonnull + public Boolean getBackupEligible() { + return backupEligible; + } + + public void setBackupEligible(Boolean backupEligible) { + this.backupEligible = backupEligible; + } + + + public Credential backupState(Boolean backupState) { + this.backupState = backupState; + return this; + } + + /** + * Get backupState + * @return backupState + */ + @javax.annotation.Nonnull + public Boolean getBackupState() { + return backupState; + } + + public void setBackupState(Boolean backupState) { + this.backupState = backupState; + } + + + public Credential authenticatorAAGUID(String authenticatorAAGUID) { + this.authenticatorAAGUID = authenticatorAAGUID; + return this; + } + + /** + * Get authenticatorAAGUID + * @return authenticatorAAGUID + */ + @javax.annotation.Nonnull + public String getAuthenticatorAAGUID() { + return authenticatorAAGUID; + } + + public void setAuthenticatorAAGUID(String authenticatorAAGUID) { + this.authenticatorAAGUID = authenticatorAAGUID; + } + + + public Credential sourceOS(String sourceOS) { + this.sourceOS = sourceOS; + return this; + } + + /** + * Get sourceOS + * @return sourceOS + */ + @javax.annotation.Nonnull + public String getSourceOS() { + return sourceOS; + } + + public void setSourceOS(String sourceOS) { + this.sourceOS = sourceOS; + } + + + public Credential sourceBrowser(String sourceBrowser) { + this.sourceBrowser = sourceBrowser; + return this; + } + + /** + * Get sourceBrowser + * @return sourceBrowser + */ + @javax.annotation.Nonnull + public String getSourceBrowser() { + return sourceBrowser; + } + + public void setSourceBrowser(String sourceBrowser) { + this.sourceBrowser = sourceBrowser; + } + + + public Credential lastUsed(String lastUsed) { + this.lastUsed = lastUsed; + return this; + } + + /** + * Timestamp of when the passkey was last used in yyyy-MM-dd'T'HH:mm:ss format + * @return lastUsed + */ + @javax.annotation.Nonnull + public String getLastUsed() { + return lastUsed; + } + + public void setLastUsed(String lastUsed) { + this.lastUsed = lastUsed; + } + + + public Credential created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + */ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + public Credential status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Status + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Credential credential = (Credential) o; + return Objects.equals(this.id, credential.id) && + Objects.equals(this.credentialID, credential.credentialID) && + Objects.equals(this.attestationType, credential.attestationType) && + Objects.equals(this.transport, credential.transport) && + Objects.equals(this.backupEligible, credential.backupEligible) && + Objects.equals(this.backupState, credential.backupState) && + Objects.equals(this.authenticatorAAGUID, credential.authenticatorAAGUID) && + Objects.equals(this.sourceOS, credential.sourceOS) && + Objects.equals(this.sourceBrowser, credential.sourceBrowser) && + Objects.equals(this.lastUsed, credential.lastUsed) && + Objects.equals(this.created, credential.created) && + Objects.equals(this.status, credential.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, credentialID, attestationType, transport, backupEligible, backupState, authenticatorAAGUID, sourceOS, sourceBrowser, lastUsed, created, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Credential {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" credentialID: ").append(toIndentedString(credentialID)).append("\n"); + sb.append(" attestationType: ").append(toIndentedString(attestationType)).append("\n"); + sb.append(" transport: ").append(toIndentedString(transport)).append("\n"); + sb.append(" backupEligible: ").append(toIndentedString(backupEligible)).append("\n"); + sb.append(" backupState: ").append(toIndentedString(backupState)).append("\n"); + sb.append(" authenticatorAAGUID: ").append(toIndentedString(authenticatorAAGUID)).append("\n"); + sb.append(" sourceOS: ").append(toIndentedString(sourceOS)).append("\n"); + sb.append(" sourceBrowser: ").append(toIndentedString(sourceBrowser)).append("\n"); + sb.append(" lastUsed: ").append(toIndentedString(lastUsed)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("credentialID"); + openapiFields.add("attestationType"); + openapiFields.add("transport"); + openapiFields.add("backupEligible"); + openapiFields.add("backupState"); + openapiFields.add("authenticatorAAGUID"); + openapiFields.add("sourceOS"); + openapiFields.add("sourceBrowser"); + openapiFields.add("lastUsed"); + openapiFields.add("created"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("credentialID"); + openapiRequiredFields.add("attestationType"); + openapiRequiredFields.add("transport"); + openapiRequiredFields.add("backupEligible"); + openapiRequiredFields.add("backupState"); + openapiRequiredFields.add("authenticatorAAGUID"); + openapiRequiredFields.add("sourceOS"); + openapiRequiredFields.add("sourceBrowser"); + openapiRequiredFields.add("lastUsed"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Credential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Credential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Credential is not found in the empty JSON string", Credential.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Credential.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Credential` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Credential.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("credentialID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `credentialID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialID").toString())); + } + if (!jsonObj.get("attestationType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `attestationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attestationType").toString())); + } + // ensure the required json array is present + if (jsonObj.get("transport") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("transport").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transport` to be an array in the JSON string but got `%s`", jsonObj.get("transport").toString())); + } + if (!jsonObj.get("authenticatorAAGUID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authenticatorAAGUID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticatorAAGUID").toString())); + } + if (!jsonObj.get("sourceOS").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceOS` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceOS").toString())); + } + if (!jsonObj.get("sourceBrowser").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceBrowser` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceBrowser").toString())); + } + if (!jsonObj.get("lastUsed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastUsed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUsed").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Credential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Credential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Credential.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Credential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Credential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Credential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Credential + * @throws IOException if the JSON string is invalid with respect to Credential + */ + public static Credential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Credential.class); + } + + /** + * Convert an instance of Credential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/CredentialList.java b/src/main/java/com/corbado/generated/model/CredentialList.java new file mode 100644 index 0000000..2859f41 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/CredentialList.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Credential; +import com.corbado.generated.model.Paging; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * CredentialList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class CredentialList { + public static final String SERIALIZED_NAME_CREDENTIALS = "credentials"; + @SerializedName(SERIALIZED_NAME_CREDENTIALS) + private List credentials = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public CredentialList() { + } + + public CredentialList credentials(List credentials) { + this.credentials = credentials; + return this; + } + + public CredentialList addCredentialsItem(Credential credentialsItem) { + if (this.credentials == null) { + this.credentials = new ArrayList<>(); + } + this.credentials.add(credentialsItem); + return this; + } + + /** + * Get credentials + * @return credentials + */ + @javax.annotation.Nonnull + public List getCredentials() { + return credentials; + } + + public void setCredentials(List credentials) { + this.credentials = credentials; + } + + + public CredentialList paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + */ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CredentialList credentialList = (CredentialList) o; + return Objects.equals(this.credentials, credentialList.credentials) && + Objects.equals(this.paging, credentialList.paging); + } + + @Override + public int hashCode() { + return Objects.hash(credentials, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CredentialList {\n"); + sb.append(" credentials: ").append(toIndentedString(credentials)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("credentials"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("credentials"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CredentialList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CredentialList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CredentialList is not found in the empty JSON string", CredentialList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CredentialList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CredentialList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CredentialList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("credentials").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `credentials` to be an array in the JSON string but got `%s`", jsonObj.get("credentials").toString())); + } + + JsonArray jsonArraycredentials = jsonObj.getAsJsonArray("credentials"); + // validate the required field `credentials` (array) + for (int i = 0; i < jsonArraycredentials.size(); i++) { + Credential.validateJsonElement(jsonArraycredentials.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CredentialList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CredentialList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CredentialList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CredentialList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CredentialList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CredentialList given an JSON string + * + * @param jsonString JSON string + * @return An instance of CredentialList + * @throws IOException if the JSON string is invalid with respect to CredentialList + */ + public static CredentialList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CredentialList.class); + } + + /** + * Convert an instance of CredentialList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/CrossDeviceAuthenticationStrategy.java b/src/main/java/com/corbado/generated/model/CrossDeviceAuthenticationStrategy.java new file mode 100644 index 0000000..38bd955 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/CrossDeviceAuthenticationStrategy.java @@ -0,0 +1,80 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets crossDeviceAuthenticationStrategy + */ +@JsonAdapter(CrossDeviceAuthenticationStrategy.Adapter.class) +public enum CrossDeviceAuthenticationStrategy { + + STANDARD("standard"), + + MINIMIZE("minimize"), + + MAXIMIZE("maximize"); + + private String value; + + CrossDeviceAuthenticationStrategy(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CrossDeviceAuthenticationStrategy fromValue(String value) { + for (CrossDeviceAuthenticationStrategy b : CrossDeviceAuthenticationStrategy.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CrossDeviceAuthenticationStrategy enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CrossDeviceAuthenticationStrategy read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CrossDeviceAuthenticationStrategy.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CrossDeviceAuthenticationStrategy.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/CustomLoginIdentifier.java b/src/main/java/com/corbado/generated/model/CustomLoginIdentifier.java deleted file mode 100644 index 73fe5a4..0000000 --- a/src/main/java/com/corbado/generated/model/CustomLoginIdentifier.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * CustomLoginIdentifier - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class CustomLoginIdentifier { - public static final String SERIALIZED_NAME_I_D = "ID"; - @SerializedName(SERIALIZED_NAME_I_D) - private String ID; - - public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; - @SerializedName(SERIALIZED_NAME_IDENTIFIER) - private String identifier; - - public static final String SERIALIZED_NAME_ADDITIONAL_DATA = "additionalData"; - @SerializedName(SERIALIZED_NAME_ADDITIONAL_DATA) - private String additionalData; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public CustomLoginIdentifier() { - } - - public CustomLoginIdentifier ID(String ID) { - this.ID = ID; - return this; - } - - /** - * ID of the phone number - * @return ID - **/ - @javax.annotation.Nonnull - public String getID() { - return ID; - } - - public void setID(String ID) { - this.ID = ID; - } - - - public CustomLoginIdentifier identifier(String identifier) { - this.identifier = identifier; - return this; - } - - /** - * Get identifier - * @return identifier - **/ - @javax.annotation.Nonnull - public String getIdentifier() { - return identifier; - } - - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - - public CustomLoginIdentifier additionalData(String additionalData) { - this.additionalData = additionalData; - return this; - } - - /** - * Get additionalData - * @return additionalData - **/ - @javax.annotation.Nullable - public String getAdditionalData() { - return additionalData; - } - - public void setAdditionalData(String additionalData) { - this.additionalData = additionalData; - } - - - public CustomLoginIdentifier created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public CustomLoginIdentifier updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CustomLoginIdentifier customLoginIdentifier = (CustomLoginIdentifier) o; - return Objects.equals(this.ID, customLoginIdentifier.ID) && - Objects.equals(this.identifier, customLoginIdentifier.identifier) && - Objects.equals(this.additionalData, customLoginIdentifier.additionalData) && - Objects.equals(this.created, customLoginIdentifier.created) && - Objects.equals(this.updated, customLoginIdentifier.updated); - } - - @Override - public int hashCode() { - return Objects.hash(ID, identifier, additionalData, created, updated); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CustomLoginIdentifier {\n"); - sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); - sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); - sb.append(" additionalData: ").append(toIndentedString(additionalData)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ID"); - openapiFields.add("identifier"); - openapiFields.add("additionalData"); - openapiFields.add("created"); - openapiFields.add("updated"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("ID"); - openapiRequiredFields.add("identifier"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CustomLoginIdentifier - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!CustomLoginIdentifier.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in CustomLoginIdentifier is not found in the empty JSON string", CustomLoginIdentifier.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!CustomLoginIdentifier.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CustomLoginIdentifier` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CustomLoginIdentifier.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("ID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); - } - if (!jsonObj.get("identifier").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `identifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifier").toString())); - } - if ((jsonObj.get("additionalData") != null && !jsonObj.get("additionalData").isJsonNull()) && !jsonObj.get("additionalData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `additionalData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalData").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CustomLoginIdentifier.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CustomLoginIdentifier' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CustomLoginIdentifier.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CustomLoginIdentifier value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CustomLoginIdentifier read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CustomLoginIdentifier given an JSON string - * - * @param jsonString JSON string - * @return An instance of CustomLoginIdentifier - * @throws IOException if the JSON string is invalid with respect to CustomLoginIdentifier - */ - public static CustomLoginIdentifier fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CustomLoginIdentifier.class); - } - - /** - * Convert an instance of CustomLoginIdentifier to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/DecisionTag.java b/src/main/java/com/corbado/generated/model/DecisionTag.java new file mode 100644 index 0000000..b52aac0 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/DecisionTag.java @@ -0,0 +1,110 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets decisionTag + */ +@JsonAdapter(DecisionTag.Adapter.class) +public enum DecisionTag { + + ENV_NO_PK_SUPPORT("env-no-pk-support"), + + USER_NO_PKS("user-no-pks"), + + USER_LOGIN_BLACKLISTED("user-login-blacklisted"), + + USER_SECURITY_KEY("user-security-key"), + + USER_POSITIVE_ENV_HISTORY("user-positive-env-history"), + + USER_NEGATIVE_ENV_HISTORY("user-negative-env-history"), + + ENV_BLACKLISTED("env-blacklisted"), + + USER_PLATFORM_PK_HIGH_CONFIDENCE("user-platform-pk-high-confidence"), + + USER_CROSS_PLATFORM_PK_HIGH_CONFIDENCE("user-cross-platform-pk-high-confidence"), + + USER_ENV_NO_PKS("user-env-no-pks"), + + DEFAULT_DENY("default-deny"), + + PASSKEY_LIST_INITIATED_PROCESS("passkey-list-initiated-process"), + + USER_APPEND_BLACKLISTED("user-append-blacklisted"), + + PROCESS_PK_LOGIN_SK_COMPLETED("process-pk-login-sk-completed"), + + PROCESS_PK_LOGIN_PLATFORM_COMPLETED("process-pk-login-platform-completed"), + + PROCESS_PK_LOGIN_NOT_OFFERED("process-pk-login-not-offered"), + + PROCESS_PK_LOGIN_INCOMPLETE("process-pk-login-incomplete"), + + PROCESS_PK_LOGIN_CROSS_PLATFORM_COMPLETED("process-pk-login-cross-platform-completed"); + + private String value; + + DecisionTag(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DecisionTag fromValue(String value) { + for (DecisionTag b : DecisionTag.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final DecisionTag enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DecisionTag read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DecisionTag.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + DecisionTag.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/DetectionTag.java b/src/main/java/com/corbado/generated/model/DetectionTag.java new file mode 100644 index 0000000..d9f70e5 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/DetectionTag.java @@ -0,0 +1,302 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * DetectionTag + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class DetectionTag { + /** + * Gets or Sets category + */ + @JsonAdapter(CategoryEnum.Adapter.class) + public enum CategoryEnum { + SUPPORT("support"), + + CLIENT_ENV("clientEnv"), + + HISTORY("history"), + + PASSKEY("passkey"); + + private String value; + + CategoryEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CategoryEnum fromValue(String value) { + for (CategoryEnum b : CategoryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CategoryEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CategoryEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CategoryEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CategoryEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CATEGORY = "category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + private CategoryEnum category; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public DetectionTag() { + } + + public DetectionTag category(CategoryEnum category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @javax.annotation.Nonnull + public CategoryEnum getCategory() { + return category; + } + + public void setCategory(CategoryEnum category) { + this.category = category; + } + + + public DetectionTag name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DetectionTag detectionTag = (DetectionTag) o; + return Objects.equals(this.category, detectionTag.category) && + Objects.equals(this.name, detectionTag.name); + } + + @Override + public int hashCode() { + return Objects.hash(category, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DetectionTag {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("category"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("category"); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DetectionTag + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DetectionTag.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DetectionTag is not found in the empty JSON string", DetectionTag.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DetectionTag.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DetectionTag` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DetectionTag.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("category").toString())); + } + // validate the required field `category` + CategoryEnum.validateJsonElement(jsonObj.get("category")); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DetectionTag.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DetectionTag' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DetectionTag.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DetectionTag value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DetectionTag read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DetectionTag given an JSON string + * + * @param jsonString JSON string + * @return An instance of DetectionTag + * @throws IOException if the JSON string is invalid with respect to DetectionTag + */ + public static DetectionTag fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DetectionTag.class); + } + + /** + * Convert an instance of DetectionTag to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/Email.java b/src/main/java/com/corbado/generated/model/Email.java deleted file mode 100644 index a42f6a6..0000000 --- a/src/main/java/com/corbado/generated/model/Email.java +++ /dev/null @@ -1,363 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Status; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * Email - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class Email { - public static final String SERIALIZED_NAME_I_D = "ID"; - @SerializedName(SERIALIZED_NAME_I_D) - private String ID; - - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public static final String SERIALIZED_NAME_DELETED = "deleted"; - @SerializedName(SERIALIZED_NAME_DELETED) - private String deleted; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private Status status; - - public Email() { - } - - public Email ID(String ID) { - this.ID = ID; - return this; - } - - /** - * ID of the email - * @return ID - **/ - @javax.annotation.Nonnull - public String getID() { - return ID; - } - - public void setID(String ID) { - this.ID = ID; - } - - - public Email email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - **/ - @javax.annotation.Nonnull - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - - public Email created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public Email updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - public Email deleted(String deleted) { - this.deleted = deleted; - return this; - } - - /** - * Timestamp of when the entity was deleted in yyyy-MM-dd'T'HH:mm:ss format - * @return deleted - **/ - @javax.annotation.Nullable - public String getDeleted() { - return deleted; - } - - public void setDeleted(String deleted) { - this.deleted = deleted; - } - - - public Email status(Status status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - **/ - @javax.annotation.Nonnull - public Status getStatus() { - return status; - } - - public void setStatus(Status status) { - this.status = status; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Email email = (Email) o; - return Objects.equals(this.ID, email.ID) && - Objects.equals(this.email, email.email) && - Objects.equals(this.created, email.created) && - Objects.equals(this.updated, email.updated) && - Objects.equals(this.deleted, email.deleted) && - Objects.equals(this.status, email.status); - } - - @Override - public int hashCode() { - return Objects.hash(ID, email, created, updated, deleted, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Email {\n"); - sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append(" deleted: ").append(toIndentedString(deleted)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ID"); - openapiFields.add("email"); - openapiFields.add("created"); - openapiFields.add("updated"); - openapiFields.add("deleted"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("ID"); - openapiRequiredFields.add("email"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Email - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Email.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Email is not found in the empty JSON string", Email.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Email.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Email` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Email.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("ID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); - } - if (!jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - if ((jsonObj.get("deleted") != null && !jsonObj.get("deleted").isJsonNull()) && !jsonObj.get("deleted").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deleted` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deleted").toString())); - } - // validate the required field `status` - Status.validateJsonElement(jsonObj.get("status")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Email.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Email' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Email.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Email value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Email read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Email given an JSON string - * - * @param jsonString JSON string - * @return An instance of Email - * @throws IOException if the JSON string is invalid with respect to Email - */ - public static Email fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Email.class); - } - - /** - * Convert an instance of Email to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailCode.java b/src/main/java/com/corbado/generated/model/EmailCode.java deleted file mode 100644 index 6d9532d..0000000 --- a/src/main/java/com/corbado/generated/model/EmailCode.java +++ /dev/null @@ -1,477 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailCode - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailCode { - public static final String SERIALIZED_NAME_I_D = "ID"; - @SerializedName(SERIALIZED_NAME_I_D) - private String ID; - - public static final String SERIALIZED_NAME_USER_I_D = "userID"; - @SerializedName(SERIALIZED_NAME_USER_I_D) - private String userID; - - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; - @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) - private String userFullName; - - public static final String SERIALIZED_NAME_ADDITIONAL_PAYLOAD = "additionalPayload"; - @SerializedName(SERIALIZED_NAME_ADDITIONAL_PAYLOAD) - private String additionalPayload; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - /** - * status values of an email OTP - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - ACTIVE("active"), - - CONFIRMED("confirmed"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StatusEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public EmailCode() { - } - - public EmailCode ID(String ID) { - this.ID = ID; - return this; - } - - /** - * ID of the email OTP - * @return ID - **/ - @javax.annotation.Nonnull - public String getID() { - return ID; - } - - public void setID(String ID) { - this.ID = ID; - } - - - public EmailCode userID(String userID) { - this.userID = userID; - return this; - } - - /** - * ID of the user - * @return userID - **/ - @javax.annotation.Nonnull - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - - public EmailCode email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - **/ - @javax.annotation.Nonnull - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - - public EmailCode userFullName(String userFullName) { - this.userFullName = userFullName; - return this; - } - - /** - * Get userFullName - * @return userFullName - **/ - @javax.annotation.Nullable - public String getUserFullName() { - return userFullName; - } - - public void setUserFullName(String userFullName) { - this.userFullName = userFullName; - } - - - public EmailCode additionalPayload(String additionalPayload) { - this.additionalPayload = additionalPayload; - return this; - } - - /** - * Additional payload in JSON format - * @return additionalPayload - **/ - @javax.annotation.Nonnull - public String getAdditionalPayload() { - return additionalPayload; - } - - public void setAdditionalPayload(String additionalPayload) { - this.additionalPayload = additionalPayload; - } - - - public EmailCode created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public EmailCode updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - public EmailCode status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * status values of an email OTP - * @return status - **/ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailCode emailCode = (EmailCode) o; - return Objects.equals(this.ID, emailCode.ID) && - Objects.equals(this.userID, emailCode.userID) && - Objects.equals(this.email, emailCode.email) && - Objects.equals(this.userFullName, emailCode.userFullName) && - Objects.equals(this.additionalPayload, emailCode.additionalPayload) && - Objects.equals(this.created, emailCode.created) && - Objects.equals(this.updated, emailCode.updated) && - Objects.equals(this.status, emailCode.status); - } - - @Override - public int hashCode() { - return Objects.hash(ID, userID, email, userFullName, additionalPayload, created, updated, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailCode {\n"); - sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); - sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); - sb.append(" additionalPayload: ").append(toIndentedString(additionalPayload)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ID"); - openapiFields.add("userID"); - openapiFields.add("email"); - openapiFields.add("userFullName"); - openapiFields.add("additionalPayload"); - openapiFields.add("created"); - openapiFields.add("updated"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("ID"); - openapiRequiredFields.add("userID"); - openapiRequiredFields.add("email"); - openapiRequiredFields.add("additionalPayload"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailCode - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailCode.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCode is not found in the empty JSON string", EmailCode.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailCode.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCode` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailCode.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("ID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); - } - if (!jsonObj.get("userID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); - } - if (!jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); - } - if (!jsonObj.get("additionalPayload").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `additionalPayload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalPayload").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // validate the required field `status` - StatusEnum.validateJsonElement(jsonObj.get("status")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailCode.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailCode' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailCode.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailCode value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailCode read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailCode given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailCode - * @throws IOException if the JSON string is invalid with respect to EmailCode - */ - public static EmailCode fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailCode.class); - } - - /** - * Convert an instance of EmailCode to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailCodeGetRsp.java b/src/main/java/com/corbado/generated/model/EmailCodeGetRsp.java deleted file mode 100644 index 3591572..0000000 --- a/src/main/java/com/corbado/generated/model/EmailCodeGetRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.EmailCodeGetRspAllOfData; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailCodeGetRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailCodeGetRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private EmailCodeGetRspAllOfData data; - - public EmailCodeGetRsp() { - } - - public EmailCodeGetRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public EmailCodeGetRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public EmailCodeGetRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public EmailCodeGetRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public EmailCodeGetRsp data(EmailCodeGetRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public EmailCodeGetRspAllOfData getData() { - return data; - } - - public void setData(EmailCodeGetRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailCodeGetRsp emailCodeGetRsp = (EmailCodeGetRsp) o; - return Objects.equals(this.httpStatusCode, emailCodeGetRsp.httpStatusCode) && - Objects.equals(this.message, emailCodeGetRsp.message) && - Objects.equals(this.requestData, emailCodeGetRsp.requestData) && - Objects.equals(this.runtime, emailCodeGetRsp.runtime) && - Objects.equals(this.data, emailCodeGetRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailCodeGetRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailCodeGetRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailCodeGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCodeGetRsp is not found in the empty JSON string", EmailCodeGetRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailCodeGetRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCodeGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailCodeGetRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - EmailCodeGetRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailCodeGetRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailCodeGetRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailCodeGetRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailCodeGetRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailCodeGetRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailCodeGetRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailCodeGetRsp - * @throws IOException if the JSON string is invalid with respect to EmailCodeGetRsp - */ - public static EmailCodeGetRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailCodeGetRsp.class); - } - - /** - * Convert an instance of EmailCodeGetRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailCodeGetRspAllOfData.java b/src/main/java/com/corbado/generated/model/EmailCodeGetRspAllOfData.java deleted file mode 100644 index 479c43c..0000000 --- a/src/main/java/com/corbado/generated/model/EmailCodeGetRspAllOfData.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.EmailCode; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailCodeGetRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailCodeGetRspAllOfData { - public static final String SERIALIZED_NAME_EMAIL_CODE = "emailCode"; - @SerializedName(SERIALIZED_NAME_EMAIL_CODE) - private EmailCode emailCode; - - public EmailCodeGetRspAllOfData() { - } - - public EmailCodeGetRspAllOfData emailCode(EmailCode emailCode) { - this.emailCode = emailCode; - return this; - } - - /** - * Get emailCode - * @return emailCode - **/ - @javax.annotation.Nonnull - public EmailCode getEmailCode() { - return emailCode; - } - - public void setEmailCode(EmailCode emailCode) { - this.emailCode = emailCode; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailCodeGetRspAllOfData emailCodeGetRspAllOfData = (EmailCodeGetRspAllOfData) o; - return Objects.equals(this.emailCode, emailCodeGetRspAllOfData.emailCode); - } - - @Override - public int hashCode() { - return Objects.hash(emailCode); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailCodeGetRspAllOfData {\n"); - sb.append(" emailCode: ").append(toIndentedString(emailCode)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("emailCode"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("emailCode"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailCodeGetRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailCodeGetRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCodeGetRspAllOfData is not found in the empty JSON string", EmailCodeGetRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailCodeGetRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCodeGetRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailCodeGetRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `emailCode` - EmailCode.validateJsonElement(jsonObj.get("emailCode")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailCodeGetRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailCodeGetRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailCodeGetRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailCodeGetRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailCodeGetRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailCodeGetRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailCodeGetRspAllOfData - * @throws IOException if the JSON string is invalid with respect to EmailCodeGetRspAllOfData - */ - public static EmailCodeGetRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailCodeGetRspAllOfData.class); - } - - /** - * Convert an instance of EmailCodeGetRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailCodeSendReq.java b/src/main/java/com/corbado/generated/model/EmailCodeSendReq.java deleted file mode 100644 index 9c7eb91..0000000 --- a/src/main/java/com/corbado/generated/model/EmailCodeSendReq.java +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailCodeSendReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailCodeSendReq { - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_CREATE = "create"; - @SerializedName(SERIALIZED_NAME_CREATE) - private Boolean create; - - public static final String SERIALIZED_NAME_TOKEN_LIFETIME = "tokenLifetime"; - @SerializedName(SERIALIZED_NAME_TOKEN_LIFETIME) - private String tokenLifetime; - - public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; - @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) - private String userFullName; - - public static final String SERIALIZED_NAME_TEMPLATE_NAME = "templateName"; - @SerializedName(SERIALIZED_NAME_TEMPLATE_NAME) - private String templateName; - - public static final String SERIALIZED_NAME_ADDITIONAL_PAYLOAD = "additionalPayload"; - @SerializedName(SERIALIZED_NAME_ADDITIONAL_PAYLOAD) - private String additionalPayload; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public EmailCodeSendReq() { - } - - public EmailCodeSendReq email(String email) { - this.email = email; - return this; - } - - /** - * Recipient email address - * @return email - **/ - @javax.annotation.Nonnull - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - - public EmailCodeSendReq create(Boolean create) { - this.create = create; - return this; - } - - /** - * Defines if user email should be created if not found - * @return create - **/ - @javax.annotation.Nonnull - public Boolean getCreate() { - return create; - } - - public void setCreate(Boolean create) { - this.create = create; - } - - - public EmailCodeSendReq tokenLifetime(String tokenLifetime) { - this.tokenLifetime = tokenLifetime; - return this; - } - - /** - * Defines the lifetime of the token that needs to be validated - * @return tokenLifetime - **/ - @javax.annotation.Nullable - public String getTokenLifetime() { - return tokenLifetime; - } - - public void setTokenLifetime(String tokenLifetime) { - this.tokenLifetime = tokenLifetime; - } - - - public EmailCodeSendReq userFullName(String userFullName) { - this.userFullName = userFullName; - return this; - } - - /** - * Optional user's full name to be used if the user wasn't found and needs to be created first - * @return userFullName - **/ - @javax.annotation.Nullable - public String getUserFullName() { - return userFullName; - } - - public void setUserFullName(String userFullName) { - this.userFullName = userFullName; - } - - - public EmailCodeSendReq templateName(String templateName) { - this.templateName = templateName; - return this; - } - - /** - * Template name of email to send - * @return templateName - **/ - @javax.annotation.Nullable - public String getTemplateName() { - return templateName; - } - - public void setTemplateName(String templateName) { - this.templateName = templateName; - } - - - public EmailCodeSendReq additionalPayload(String additionalPayload) { - this.additionalPayload = additionalPayload; - return this; - } - - /** - * Additional payload in JSON format - * @return additionalPayload - **/ - @javax.annotation.Nullable - public String getAdditionalPayload() { - return additionalPayload; - } - - public void setAdditionalPayload(String additionalPayload) { - this.additionalPayload = additionalPayload; - } - - - public EmailCodeSendReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public EmailCodeSendReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailCodeSendReq emailCodeSendReq = (EmailCodeSendReq) o; - return Objects.equals(this.email, emailCodeSendReq.email) && - Objects.equals(this.create, emailCodeSendReq.create) && - Objects.equals(this.tokenLifetime, emailCodeSendReq.tokenLifetime) && - Objects.equals(this.userFullName, emailCodeSendReq.userFullName) && - Objects.equals(this.templateName, emailCodeSendReq.templateName) && - Objects.equals(this.additionalPayload, emailCodeSendReq.additionalPayload) && - Objects.equals(this.requestID, emailCodeSendReq.requestID) && - Objects.equals(this.clientInfo, emailCodeSendReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(email, create, tokenLifetime, userFullName, templateName, additionalPayload, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailCodeSendReq {\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" create: ").append(toIndentedString(create)).append("\n"); - sb.append(" tokenLifetime: ").append(toIndentedString(tokenLifetime)).append("\n"); - sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); - sb.append(" templateName: ").append(toIndentedString(templateName)).append("\n"); - sb.append(" additionalPayload: ").append(toIndentedString(additionalPayload)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("email"); - openapiFields.add("create"); - openapiFields.add("tokenLifetime"); - openapiFields.add("userFullName"); - openapiFields.add("templateName"); - openapiFields.add("additionalPayload"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("email"); - openapiRequiredFields.add("create"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailCodeSendReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailCodeSendReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCodeSendReq is not found in the empty JSON string", EmailCodeSendReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailCodeSendReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCodeSendReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailCodeSendReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("tokenLifetime") != null && !jsonObj.get("tokenLifetime").isJsonNull()) && !jsonObj.get("tokenLifetime").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tokenLifetime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenLifetime").toString())); - } - if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); - } - if ((jsonObj.get("templateName") != null && !jsonObj.get("templateName").isJsonNull()) && !jsonObj.get("templateName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `templateName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("templateName").toString())); - } - if ((jsonObj.get("additionalPayload") != null && !jsonObj.get("additionalPayload").isJsonNull()) && !jsonObj.get("additionalPayload").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `additionalPayload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalPayload").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailCodeSendReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailCodeSendReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailCodeSendReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailCodeSendReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailCodeSendReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailCodeSendReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailCodeSendReq - * @throws IOException if the JSON string is invalid with respect to EmailCodeSendReq - */ - public static EmailCodeSendReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailCodeSendReq.class); - } - - /** - * Convert an instance of EmailCodeSendReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailCodeSendRsp.java b/src/main/java/com/corbado/generated/model/EmailCodeSendRsp.java deleted file mode 100644 index 645a302..0000000 --- a/src/main/java/com/corbado/generated/model/EmailCodeSendRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.EmailCodeSendRspAllOfData; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailCodeSendRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailCodeSendRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private EmailCodeSendRspAllOfData data; - - public EmailCodeSendRsp() { - } - - public EmailCodeSendRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public EmailCodeSendRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public EmailCodeSendRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public EmailCodeSendRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public EmailCodeSendRsp data(EmailCodeSendRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public EmailCodeSendRspAllOfData getData() { - return data; - } - - public void setData(EmailCodeSendRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailCodeSendRsp emailCodeSendRsp = (EmailCodeSendRsp) o; - return Objects.equals(this.httpStatusCode, emailCodeSendRsp.httpStatusCode) && - Objects.equals(this.message, emailCodeSendRsp.message) && - Objects.equals(this.requestData, emailCodeSendRsp.requestData) && - Objects.equals(this.runtime, emailCodeSendRsp.runtime) && - Objects.equals(this.data, emailCodeSendRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailCodeSendRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailCodeSendRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailCodeSendRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCodeSendRsp is not found in the empty JSON string", EmailCodeSendRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailCodeSendRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCodeSendRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailCodeSendRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - EmailCodeSendRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailCodeSendRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailCodeSendRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailCodeSendRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailCodeSendRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailCodeSendRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailCodeSendRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailCodeSendRsp - * @throws IOException if the JSON string is invalid with respect to EmailCodeSendRsp - */ - public static EmailCodeSendRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailCodeSendRsp.class); - } - - /** - * Convert an instance of EmailCodeSendRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailCodeSendRspAllOfData.java b/src/main/java/com/corbado/generated/model/EmailCodeSendRspAllOfData.java deleted file mode 100644 index 8f31a45..0000000 --- a/src/main/java/com/corbado/generated/model/EmailCodeSendRspAllOfData.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailCodeSendRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailCodeSendRspAllOfData { - public static final String SERIALIZED_NAME_EMAIL_CODE_I_D = "emailCodeID"; - @SerializedName(SERIALIZED_NAME_EMAIL_CODE_I_D) - private String emailCodeID; - - public EmailCodeSendRspAllOfData() { - } - - public EmailCodeSendRspAllOfData emailCodeID(String emailCodeID) { - this.emailCodeID = emailCodeID; - return this; - } - - /** - * Get emailCodeID - * @return emailCodeID - **/ - @javax.annotation.Nonnull - public String getEmailCodeID() { - return emailCodeID; - } - - public void setEmailCodeID(String emailCodeID) { - this.emailCodeID = emailCodeID; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailCodeSendRspAllOfData emailCodeSendRspAllOfData = (EmailCodeSendRspAllOfData) o; - return Objects.equals(this.emailCodeID, emailCodeSendRspAllOfData.emailCodeID); - } - - @Override - public int hashCode() { - return Objects.hash(emailCodeID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailCodeSendRspAllOfData {\n"); - sb.append(" emailCodeID: ").append(toIndentedString(emailCodeID)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("emailCodeID"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("emailCodeID"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailCodeSendRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailCodeSendRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCodeSendRspAllOfData is not found in the empty JSON string", EmailCodeSendRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailCodeSendRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCodeSendRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailCodeSendRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("emailCodeID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `emailCodeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailCodeID").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailCodeSendRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailCodeSendRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailCodeSendRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailCodeSendRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailCodeSendRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailCodeSendRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailCodeSendRspAllOfData - * @throws IOException if the JSON string is invalid with respect to EmailCodeSendRspAllOfData - */ - public static EmailCodeSendRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailCodeSendRspAllOfData.class); - } - - /** - * Convert an instance of EmailCodeSendRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailCodeValidateReq.java b/src/main/java/com/corbado/generated/model/EmailCodeValidateReq.java deleted file mode 100644 index 5c1994c..0000000 --- a/src/main/java/com/corbado/generated/model/EmailCodeValidateReq.java +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailCodeValidateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailCodeValidateReq { - public static final String SERIALIZED_NAME_CODE = "code"; - @SerializedName(SERIALIZED_NAME_CODE) - private String code; - - public static final String SERIALIZED_NAME_CREATE_LOGIN_TOKEN = "createLoginToken"; - @SerializedName(SERIALIZED_NAME_CREATE_LOGIN_TOKEN) - private Boolean createLoginToken; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public EmailCodeValidateReq() { - } - - public EmailCodeValidateReq code(String code) { - this.code = code; - return this; - } - - /** - * Email OTP to validate - * @return code - **/ - @javax.annotation.Nonnull - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - - public EmailCodeValidateReq createLoginToken(Boolean createLoginToken) { - this.createLoginToken = createLoginToken; - return this; - } - - /** - * Get createLoginToken - * @return createLoginToken - **/ - @javax.annotation.Nullable - public Boolean getCreateLoginToken() { - return createLoginToken; - } - - public void setCreateLoginToken(Boolean createLoginToken) { - this.createLoginToken = createLoginToken; - } - - - public EmailCodeValidateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public EmailCodeValidateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailCodeValidateReq emailCodeValidateReq = (EmailCodeValidateReq) o; - return Objects.equals(this.code, emailCodeValidateReq.code) && - Objects.equals(this.createLoginToken, emailCodeValidateReq.createLoginToken) && - Objects.equals(this.requestID, emailCodeValidateReq.requestID) && - Objects.equals(this.clientInfo, emailCodeValidateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(code, createLoginToken, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailCodeValidateReq {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" createLoginToken: ").append(toIndentedString(createLoginToken)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("code"); - openapiFields.add("createLoginToken"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("code"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailCodeValidateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailCodeValidateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCodeValidateReq is not found in the empty JSON string", EmailCodeValidateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailCodeValidateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCodeValidateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailCodeValidateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailCodeValidateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailCodeValidateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailCodeValidateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailCodeValidateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailCodeValidateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailCodeValidateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailCodeValidateReq - * @throws IOException if the JSON string is invalid with respect to EmailCodeValidateReq - */ - public static EmailCodeValidateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailCodeValidateReq.class); - } - - /** - * Convert an instance of EmailCodeValidateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailCodeValidateRsp.java b/src/main/java/com/corbado/generated/model/EmailCodeValidateRsp.java deleted file mode 100644 index eae3256..0000000 --- a/src/main/java/com/corbado/generated/model/EmailCodeValidateRsp.java +++ /dev/null @@ -1,448 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailCodeValidateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailCodeValidateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_ADDITIONAL_PAYLOAD = "additionalPayload"; - @SerializedName(SERIALIZED_NAME_ADDITIONAL_PAYLOAD) - private String additionalPayload; - - public static final String SERIALIZED_NAME_USER_I_D = "userID"; - @SerializedName(SERIALIZED_NAME_USER_I_D) - private String userID; - - public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; - @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) - private String userFullName; - - public static final String SERIALIZED_NAME_USER_EMAIL = "userEmail"; - @SerializedName(SERIALIZED_NAME_USER_EMAIL) - private String userEmail; - - public static final String SERIALIZED_NAME_LOGIN_TOKEN = "loginToken"; - @SerializedName(SERIALIZED_NAME_LOGIN_TOKEN) - private String loginToken; - - public EmailCodeValidateRsp() { - } - - public EmailCodeValidateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public EmailCodeValidateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public EmailCodeValidateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public EmailCodeValidateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public EmailCodeValidateRsp additionalPayload(String additionalPayload) { - this.additionalPayload = additionalPayload; - return this; - } - - /** - * Additional payload in JSON format - * @return additionalPayload - **/ - @javax.annotation.Nullable - public String getAdditionalPayload() { - return additionalPayload; - } - - public void setAdditionalPayload(String additionalPayload) { - this.additionalPayload = additionalPayload; - } - - - public EmailCodeValidateRsp userID(String userID) { - this.userID = userID; - return this; - } - - /** - * ID of the user - * @return userID - **/ - @javax.annotation.Nonnull - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - - public EmailCodeValidateRsp userFullName(String userFullName) { - this.userFullName = userFullName; - return this; - } - - /** - * Get userFullName - * @return userFullName - **/ - @javax.annotation.Nonnull - public String getUserFullName() { - return userFullName; - } - - public void setUserFullName(String userFullName) { - this.userFullName = userFullName; - } - - - public EmailCodeValidateRsp userEmail(String userEmail) { - this.userEmail = userEmail; - return this; - } - - /** - * Get userEmail - * @return userEmail - **/ - @javax.annotation.Nonnull - public String getUserEmail() { - return userEmail; - } - - public void setUserEmail(String userEmail) { - this.userEmail = userEmail; - } - - - public EmailCodeValidateRsp loginToken(String loginToken) { - this.loginToken = loginToken; - return this; - } - - /** - * Get loginToken - * @return loginToken - **/ - @javax.annotation.Nullable - public String getLoginToken() { - return loginToken; - } - - public void setLoginToken(String loginToken) { - this.loginToken = loginToken; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailCodeValidateRsp emailCodeValidateRsp = (EmailCodeValidateRsp) o; - return Objects.equals(this.httpStatusCode, emailCodeValidateRsp.httpStatusCode) && - Objects.equals(this.message, emailCodeValidateRsp.message) && - Objects.equals(this.requestData, emailCodeValidateRsp.requestData) && - Objects.equals(this.runtime, emailCodeValidateRsp.runtime) && - Objects.equals(this.additionalPayload, emailCodeValidateRsp.additionalPayload) && - Objects.equals(this.userID, emailCodeValidateRsp.userID) && - Objects.equals(this.userFullName, emailCodeValidateRsp.userFullName) && - Objects.equals(this.userEmail, emailCodeValidateRsp.userEmail) && - Objects.equals(this.loginToken, emailCodeValidateRsp.loginToken); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, additionalPayload, userID, userFullName, userEmail, loginToken); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailCodeValidateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" additionalPayload: ").append(toIndentedString(additionalPayload)).append("\n"); - sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); - sb.append(" userEmail: ").append(toIndentedString(userEmail)).append("\n"); - sb.append(" loginToken: ").append(toIndentedString(loginToken)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("additionalPayload"); - openapiFields.add("userID"); - openapiFields.add("userFullName"); - openapiFields.add("userEmail"); - openapiFields.add("loginToken"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("userID"); - openapiRequiredFields.add("userFullName"); - openapiRequiredFields.add("userEmail"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailCodeValidateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailCodeValidateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailCodeValidateRsp is not found in the empty JSON string", EmailCodeValidateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailCodeValidateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailCodeValidateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailCodeValidateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if ((jsonObj.get("additionalPayload") != null && !jsonObj.get("additionalPayload").isJsonNull()) && !jsonObj.get("additionalPayload").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `additionalPayload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalPayload").toString())); - } - if (!jsonObj.get("userID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); - } - if (!jsonObj.get("userFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); - } - if (!jsonObj.get("userEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userEmail").toString())); - } - if ((jsonObj.get("loginToken") != null && !jsonObj.get("loginToken").isJsonNull()) && !jsonObj.get("loginToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `loginToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginToken").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailCodeValidateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailCodeValidateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailCodeValidateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailCodeValidateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailCodeValidateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailCodeValidateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailCodeValidateRsp - * @throws IOException if the JSON string is invalid with respect to EmailCodeValidateRsp - */ - public static EmailCodeValidateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailCodeValidateRsp.class); - } - - /** - * Convert an instance of EmailCodeValidateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailLink.java b/src/main/java/com/corbado/generated/model/EmailLink.java deleted file mode 100644 index 8c68a48..0000000 --- a/src/main/java/com/corbado/generated/model/EmailLink.java +++ /dev/null @@ -1,506 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailLink - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailLink { - public static final String SERIALIZED_NAME_I_D = "ID"; - @SerializedName(SERIALIZED_NAME_I_D) - private String ID; - - public static final String SERIALIZED_NAME_USER_I_D = "userID"; - @SerializedName(SERIALIZED_NAME_USER_I_D) - private String userID; - - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; - @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) - private String userFullName; - - public static final String SERIALIZED_NAME_PURPOSE = "purpose"; - @SerializedName(SERIALIZED_NAME_PURPOSE) - private String purpose; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - /** - * status values of an email link - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - ACTIVE("active"), - - CONFIRMED("confirmed"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StatusEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_ADDITIONAL_PAYLOAD = "additionalPayload"; - @SerializedName(SERIALIZED_NAME_ADDITIONAL_PAYLOAD) - private String additionalPayload; - - public EmailLink() { - } - - public EmailLink ID(String ID) { - this.ID = ID; - return this; - } - - /** - * ID of the email magic link - * @return ID - **/ - @javax.annotation.Nonnull - public String getID() { - return ID; - } - - public void setID(String ID) { - this.ID = ID; - } - - - public EmailLink userID(String userID) { - this.userID = userID; - return this; - } - - /** - * ID of the user - * @return userID - **/ - @javax.annotation.Nonnull - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - - public EmailLink email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - **/ - @javax.annotation.Nonnull - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - - public EmailLink userFullName(String userFullName) { - this.userFullName = userFullName; - return this; - } - - /** - * Get userFullName - * @return userFullName - **/ - @javax.annotation.Nullable - public String getUserFullName() { - return userFullName; - } - - public void setUserFullName(String userFullName) { - this.userFullName = userFullName; - } - - - public EmailLink purpose(String purpose) { - this.purpose = purpose; - return this; - } - - /** - * Get purpose - * @return purpose - **/ - @javax.annotation.Nullable - public String getPurpose() { - return purpose; - } - - public void setPurpose(String purpose) { - this.purpose = purpose; - } - - - public EmailLink created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public EmailLink updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - public EmailLink status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * status values of an email link - * @return status - **/ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - - public EmailLink additionalPayload(String additionalPayload) { - this.additionalPayload = additionalPayload; - return this; - } - - /** - * Additional payload in JSON format - * @return additionalPayload - **/ - @javax.annotation.Nonnull - public String getAdditionalPayload() { - return additionalPayload; - } - - public void setAdditionalPayload(String additionalPayload) { - this.additionalPayload = additionalPayload; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailLink emailLink = (EmailLink) o; - return Objects.equals(this.ID, emailLink.ID) && - Objects.equals(this.userID, emailLink.userID) && - Objects.equals(this.email, emailLink.email) && - Objects.equals(this.userFullName, emailLink.userFullName) && - Objects.equals(this.purpose, emailLink.purpose) && - Objects.equals(this.created, emailLink.created) && - Objects.equals(this.updated, emailLink.updated) && - Objects.equals(this.status, emailLink.status) && - Objects.equals(this.additionalPayload, emailLink.additionalPayload); - } - - @Override - public int hashCode() { - return Objects.hash(ID, userID, email, userFullName, purpose, created, updated, status, additionalPayload); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailLink {\n"); - sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); - sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); - sb.append(" purpose: ").append(toIndentedString(purpose)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" additionalPayload: ").append(toIndentedString(additionalPayload)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ID"); - openapiFields.add("userID"); - openapiFields.add("email"); - openapiFields.add("userFullName"); - openapiFields.add("purpose"); - openapiFields.add("created"); - openapiFields.add("updated"); - openapiFields.add("status"); - openapiFields.add("additionalPayload"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("ID"); - openapiRequiredFields.add("userID"); - openapiRequiredFields.add("email"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("additionalPayload"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailLink - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailLink.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLink is not found in the empty JSON string", EmailLink.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailLink.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLink` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailLink.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("ID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); - } - if (!jsonObj.get("userID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); - } - if (!jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); - } - if ((jsonObj.get("purpose") != null && !jsonObj.get("purpose").isJsonNull()) && !jsonObj.get("purpose").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `purpose` to be a primitive type in the JSON string but got `%s`", jsonObj.get("purpose").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // validate the required field `status` - StatusEnum.validateJsonElement(jsonObj.get("status")); - if (!jsonObj.get("additionalPayload").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `additionalPayload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalPayload").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailLink.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailLink' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailLink.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailLink value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailLink read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailLink given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailLink - * @throws IOException if the JSON string is invalid with respect to EmailLink - */ - public static EmailLink fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailLink.class); - } - - /** - * Convert an instance of EmailLink to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailLinkGetRsp.java b/src/main/java/com/corbado/generated/model/EmailLinkGetRsp.java deleted file mode 100644 index ff29812..0000000 --- a/src/main/java/com/corbado/generated/model/EmailLinkGetRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.EmailLinkGetRspAllOfData; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailLinkGetRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailLinkGetRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private EmailLinkGetRspAllOfData data; - - public EmailLinkGetRsp() { - } - - public EmailLinkGetRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public EmailLinkGetRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public EmailLinkGetRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public EmailLinkGetRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public EmailLinkGetRsp data(EmailLinkGetRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public EmailLinkGetRspAllOfData getData() { - return data; - } - - public void setData(EmailLinkGetRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailLinkGetRsp emailLinkGetRsp = (EmailLinkGetRsp) o; - return Objects.equals(this.httpStatusCode, emailLinkGetRsp.httpStatusCode) && - Objects.equals(this.message, emailLinkGetRsp.message) && - Objects.equals(this.requestData, emailLinkGetRsp.requestData) && - Objects.equals(this.runtime, emailLinkGetRsp.runtime) && - Objects.equals(this.data, emailLinkGetRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailLinkGetRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailLinkGetRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailLinkGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinkGetRsp is not found in the empty JSON string", EmailLinkGetRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailLinkGetRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinkGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailLinkGetRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - EmailLinkGetRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailLinkGetRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailLinkGetRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailLinkGetRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailLinkGetRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailLinkGetRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailLinkGetRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailLinkGetRsp - * @throws IOException if the JSON string is invalid with respect to EmailLinkGetRsp - */ - public static EmailLinkGetRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailLinkGetRsp.class); - } - - /** - * Convert an instance of EmailLinkGetRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailLinkGetRspAllOfData.java b/src/main/java/com/corbado/generated/model/EmailLinkGetRspAllOfData.java deleted file mode 100644 index ba8cfc4..0000000 --- a/src/main/java/com/corbado/generated/model/EmailLinkGetRspAllOfData.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.EmailLink; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailLinkGetRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailLinkGetRspAllOfData { - public static final String SERIALIZED_NAME_EMAIL_LINK = "emailLink"; - @SerializedName(SERIALIZED_NAME_EMAIL_LINK) - private EmailLink emailLink; - - public EmailLinkGetRspAllOfData() { - } - - public EmailLinkGetRspAllOfData emailLink(EmailLink emailLink) { - this.emailLink = emailLink; - return this; - } - - /** - * Get emailLink - * @return emailLink - **/ - @javax.annotation.Nonnull - public EmailLink getEmailLink() { - return emailLink; - } - - public void setEmailLink(EmailLink emailLink) { - this.emailLink = emailLink; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailLinkGetRspAllOfData emailLinkGetRspAllOfData = (EmailLinkGetRspAllOfData) o; - return Objects.equals(this.emailLink, emailLinkGetRspAllOfData.emailLink); - } - - @Override - public int hashCode() { - return Objects.hash(emailLink); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailLinkGetRspAllOfData {\n"); - sb.append(" emailLink: ").append(toIndentedString(emailLink)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("emailLink"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("emailLink"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailLinkGetRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailLinkGetRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinkGetRspAllOfData is not found in the empty JSON string", EmailLinkGetRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailLinkGetRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinkGetRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailLinkGetRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `emailLink` - EmailLink.validateJsonElement(jsonObj.get("emailLink")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailLinkGetRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailLinkGetRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailLinkGetRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailLinkGetRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailLinkGetRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailLinkGetRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailLinkGetRspAllOfData - * @throws IOException if the JSON string is invalid with respect to EmailLinkGetRspAllOfData - */ - public static EmailLinkGetRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailLinkGetRspAllOfData.class); - } - - /** - * Convert an instance of EmailLinkGetRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailLinkSendReq.java b/src/main/java/com/corbado/generated/model/EmailLinkSendReq.java deleted file mode 100644 index e54cdc3..0000000 --- a/src/main/java/com/corbado/generated/model/EmailLinkSendReq.java +++ /dev/null @@ -1,535 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.net.URI; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailLinkSendReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailLinkSendReq { - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_CREATE = "create"; - @SerializedName(SERIALIZED_NAME_CREATE) - private Boolean create; - - public static final String SERIALIZED_NAME_TOKEN_LIFETIME = "tokenLifetime"; - @SerializedName(SERIALIZED_NAME_TOKEN_LIFETIME) - private String tokenLifetime; - - public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; - @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) - private String userFullName; - - public static final String SERIALIZED_NAME_TEMPLATE_NAME = "templateName"; - @SerializedName(SERIALIZED_NAME_TEMPLATE_NAME) - private String templateName; - - /** - * Purpose of the email link - */ - @JsonAdapter(PurposeEnum.Adapter.class) - public enum PurposeEnum { - AUTHENTICATION("authentication"), - - CONFIRMATION("confirmation"), - - INVITATION("invitation"); - - private String value; - - PurposeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static PurposeEnum fromValue(String value) { - for (PurposeEnum b : PurposeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final PurposeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public PurposeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return PurposeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - PurposeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_PURPOSE = "purpose"; - @SerializedName(SERIALIZED_NAME_PURPOSE) - private PurposeEnum purpose = PurposeEnum.AUTHENTICATION; - - public static final String SERIALIZED_NAME_REDIRECT = "redirect"; - @SerializedName(SERIALIZED_NAME_REDIRECT) - private URI redirect; - - public static final String SERIALIZED_NAME_ADDITIONAL_PAYLOAD = "additionalPayload"; - @SerializedName(SERIALIZED_NAME_ADDITIONAL_PAYLOAD) - private String additionalPayload; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public EmailLinkSendReq() { - } - - public EmailLinkSendReq email(String email) { - this.email = email; - return this; - } - - /** - * Recipient email address - * @return email - **/ - @javax.annotation.Nonnull - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - - public EmailLinkSendReq create(Boolean create) { - this.create = create; - return this; - } - - /** - * Defines if user email should be created if not found - * @return create - **/ - @javax.annotation.Nonnull - public Boolean getCreate() { - return create; - } - - public void setCreate(Boolean create) { - this.create = create; - } - - - public EmailLinkSendReq tokenLifetime(String tokenLifetime) { - this.tokenLifetime = tokenLifetime; - return this; - } - - /** - * Defines the lifetime of the token that needs to be validated - * @return tokenLifetime - **/ - @javax.annotation.Nullable - public String getTokenLifetime() { - return tokenLifetime; - } - - public void setTokenLifetime(String tokenLifetime) { - this.tokenLifetime = tokenLifetime; - } - - - public EmailLinkSendReq userFullName(String userFullName) { - this.userFullName = userFullName; - return this; - } - - /** - * Optional user's full name to be used if the user wasn't found and needs to be created first - * @return userFullName - **/ - @javax.annotation.Nullable - public String getUserFullName() { - return userFullName; - } - - public void setUserFullName(String userFullName) { - this.userFullName = userFullName; - } - - - public EmailLinkSendReq templateName(String templateName) { - this.templateName = templateName; - return this; - } - - /** - * Template name of email to send - * @return templateName - **/ - @javax.annotation.Nullable - public String getTemplateName() { - return templateName; - } - - public void setTemplateName(String templateName) { - this.templateName = templateName; - } - - - public EmailLinkSendReq purpose(PurposeEnum purpose) { - this.purpose = purpose; - return this; - } - - /** - * Purpose of the email link - * @return purpose - **/ - @javax.annotation.Nullable - public PurposeEnum getPurpose() { - return purpose; - } - - public void setPurpose(PurposeEnum purpose) { - this.purpose = purpose; - } - - - public EmailLinkSendReq redirect(URI redirect) { - this.redirect = redirect; - return this; - } - - /** - * Redirect target after user clicks on email magic link - * @return redirect - **/ - @javax.annotation.Nonnull - public URI getRedirect() { - return redirect; - } - - public void setRedirect(URI redirect) { - this.redirect = redirect; - } - - - public EmailLinkSendReq additionalPayload(String additionalPayload) { - this.additionalPayload = additionalPayload; - return this; - } - - /** - * Additional payload in JSON format - * @return additionalPayload - **/ - @javax.annotation.Nullable - public String getAdditionalPayload() { - return additionalPayload; - } - - public void setAdditionalPayload(String additionalPayload) { - this.additionalPayload = additionalPayload; - } - - - public EmailLinkSendReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public EmailLinkSendReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailLinkSendReq emailLinkSendReq = (EmailLinkSendReq) o; - return Objects.equals(this.email, emailLinkSendReq.email) && - Objects.equals(this.create, emailLinkSendReq.create) && - Objects.equals(this.tokenLifetime, emailLinkSendReq.tokenLifetime) && - Objects.equals(this.userFullName, emailLinkSendReq.userFullName) && - Objects.equals(this.templateName, emailLinkSendReq.templateName) && - Objects.equals(this.purpose, emailLinkSendReq.purpose) && - Objects.equals(this.redirect, emailLinkSendReq.redirect) && - Objects.equals(this.additionalPayload, emailLinkSendReq.additionalPayload) && - Objects.equals(this.requestID, emailLinkSendReq.requestID) && - Objects.equals(this.clientInfo, emailLinkSendReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(email, create, tokenLifetime, userFullName, templateName, purpose, redirect, additionalPayload, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailLinkSendReq {\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" create: ").append(toIndentedString(create)).append("\n"); - sb.append(" tokenLifetime: ").append(toIndentedString(tokenLifetime)).append("\n"); - sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); - sb.append(" templateName: ").append(toIndentedString(templateName)).append("\n"); - sb.append(" purpose: ").append(toIndentedString(purpose)).append("\n"); - sb.append(" redirect: ").append(toIndentedString(redirect)).append("\n"); - sb.append(" additionalPayload: ").append(toIndentedString(additionalPayload)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("email"); - openapiFields.add("create"); - openapiFields.add("tokenLifetime"); - openapiFields.add("userFullName"); - openapiFields.add("templateName"); - openapiFields.add("purpose"); - openapiFields.add("redirect"); - openapiFields.add("additionalPayload"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("email"); - openapiRequiredFields.add("create"); - openapiRequiredFields.add("redirect"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailLinkSendReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailLinkSendReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinkSendReq is not found in the empty JSON string", EmailLinkSendReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailLinkSendReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinkSendReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailLinkSendReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("tokenLifetime") != null && !jsonObj.get("tokenLifetime").isJsonNull()) && !jsonObj.get("tokenLifetime").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tokenLifetime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenLifetime").toString())); - } - if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); - } - if ((jsonObj.get("templateName") != null && !jsonObj.get("templateName").isJsonNull()) && !jsonObj.get("templateName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `templateName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("templateName").toString())); - } - if ((jsonObj.get("purpose") != null && !jsonObj.get("purpose").isJsonNull()) && !jsonObj.get("purpose").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `purpose` to be a primitive type in the JSON string but got `%s`", jsonObj.get("purpose").toString())); - } - // validate the optional field `purpose` - if (jsonObj.get("purpose") != null && !jsonObj.get("purpose").isJsonNull()) { - PurposeEnum.validateJsonElement(jsonObj.get("purpose")); - } - if (!jsonObj.get("redirect").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `redirect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirect").toString())); - } - if ((jsonObj.get("additionalPayload") != null && !jsonObj.get("additionalPayload").isJsonNull()) && !jsonObj.get("additionalPayload").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `additionalPayload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalPayload").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailLinkSendReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailLinkSendReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailLinkSendReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailLinkSendReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailLinkSendReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailLinkSendReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailLinkSendReq - * @throws IOException if the JSON string is invalid with respect to EmailLinkSendReq - */ - public static EmailLinkSendReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailLinkSendReq.class); - } - - /** - * Convert an instance of EmailLinkSendReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailLinkSendRsp.java b/src/main/java/com/corbado/generated/model/EmailLinkSendRsp.java deleted file mode 100644 index 883f04e..0000000 --- a/src/main/java/com/corbado/generated/model/EmailLinkSendRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.EmailLinkSendRspAllOfData; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailLinkSendRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailLinkSendRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private EmailLinkSendRspAllOfData data; - - public EmailLinkSendRsp() { - } - - public EmailLinkSendRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public EmailLinkSendRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public EmailLinkSendRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public EmailLinkSendRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public EmailLinkSendRsp data(EmailLinkSendRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public EmailLinkSendRspAllOfData getData() { - return data; - } - - public void setData(EmailLinkSendRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailLinkSendRsp emailLinkSendRsp = (EmailLinkSendRsp) o; - return Objects.equals(this.httpStatusCode, emailLinkSendRsp.httpStatusCode) && - Objects.equals(this.message, emailLinkSendRsp.message) && - Objects.equals(this.requestData, emailLinkSendRsp.requestData) && - Objects.equals(this.runtime, emailLinkSendRsp.runtime) && - Objects.equals(this.data, emailLinkSendRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailLinkSendRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailLinkSendRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailLinkSendRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinkSendRsp is not found in the empty JSON string", EmailLinkSendRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailLinkSendRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinkSendRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailLinkSendRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - EmailLinkSendRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailLinkSendRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailLinkSendRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailLinkSendRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailLinkSendRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailLinkSendRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailLinkSendRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailLinkSendRsp - * @throws IOException if the JSON string is invalid with respect to EmailLinkSendRsp - */ - public static EmailLinkSendRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailLinkSendRsp.class); - } - - /** - * Convert an instance of EmailLinkSendRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailLinkSendRspAllOfData.java b/src/main/java/com/corbado/generated/model/EmailLinkSendRspAllOfData.java deleted file mode 100644 index 4f3bc2f..0000000 --- a/src/main/java/com/corbado/generated/model/EmailLinkSendRspAllOfData.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailLinkSendRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailLinkSendRspAllOfData { - public static final String SERIALIZED_NAME_EMAIL_LINK_I_D = "emailLinkID"; - @SerializedName(SERIALIZED_NAME_EMAIL_LINK_I_D) - private String emailLinkID; - - public EmailLinkSendRspAllOfData() { - } - - public EmailLinkSendRspAllOfData emailLinkID(String emailLinkID) { - this.emailLinkID = emailLinkID; - return this; - } - - /** - * Get emailLinkID - * @return emailLinkID - **/ - @javax.annotation.Nonnull - public String getEmailLinkID() { - return emailLinkID; - } - - public void setEmailLinkID(String emailLinkID) { - this.emailLinkID = emailLinkID; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailLinkSendRspAllOfData emailLinkSendRspAllOfData = (EmailLinkSendRspAllOfData) o; - return Objects.equals(this.emailLinkID, emailLinkSendRspAllOfData.emailLinkID); - } - - @Override - public int hashCode() { - return Objects.hash(emailLinkID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailLinkSendRspAllOfData {\n"); - sb.append(" emailLinkID: ").append(toIndentedString(emailLinkID)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("emailLinkID"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("emailLinkID"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailLinkSendRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailLinkSendRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinkSendRspAllOfData is not found in the empty JSON string", EmailLinkSendRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailLinkSendRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinkSendRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailLinkSendRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("emailLinkID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `emailLinkID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailLinkID").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailLinkSendRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailLinkSendRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailLinkSendRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailLinkSendRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailLinkSendRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailLinkSendRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailLinkSendRspAllOfData - * @throws IOException if the JSON string is invalid with respect to EmailLinkSendRspAllOfData - */ - public static EmailLinkSendRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailLinkSendRspAllOfData.class); - } - - /** - * Convert an instance of EmailLinkSendRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailLinkValidateRsp.java b/src/main/java/com/corbado/generated/model/EmailLinkValidateRsp.java deleted file mode 100644 index 1c98df1..0000000 --- a/src/main/java/com/corbado/generated/model/EmailLinkValidateRsp.java +++ /dev/null @@ -1,448 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailLinkValidateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailLinkValidateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_ADDITIONAL_PAYLOAD = "additionalPayload"; - @SerializedName(SERIALIZED_NAME_ADDITIONAL_PAYLOAD) - private String additionalPayload; - - public static final String SERIALIZED_NAME_USER_I_D = "userID"; - @SerializedName(SERIALIZED_NAME_USER_I_D) - private String userID; - - public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; - @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) - private String userFullName; - - public static final String SERIALIZED_NAME_USER_EMAIL = "userEmail"; - @SerializedName(SERIALIZED_NAME_USER_EMAIL) - private String userEmail; - - public static final String SERIALIZED_NAME_LOGIN_TOKEN = "loginToken"; - @SerializedName(SERIALIZED_NAME_LOGIN_TOKEN) - private String loginToken; - - public EmailLinkValidateRsp() { - } - - public EmailLinkValidateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public EmailLinkValidateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public EmailLinkValidateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public EmailLinkValidateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public EmailLinkValidateRsp additionalPayload(String additionalPayload) { - this.additionalPayload = additionalPayload; - return this; - } - - /** - * Additional payload in JSON format - * @return additionalPayload - **/ - @javax.annotation.Nullable - public String getAdditionalPayload() { - return additionalPayload; - } - - public void setAdditionalPayload(String additionalPayload) { - this.additionalPayload = additionalPayload; - } - - - public EmailLinkValidateRsp userID(String userID) { - this.userID = userID; - return this; - } - - /** - * ID of the user - * @return userID - **/ - @javax.annotation.Nonnull - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - - public EmailLinkValidateRsp userFullName(String userFullName) { - this.userFullName = userFullName; - return this; - } - - /** - * Get userFullName - * @return userFullName - **/ - @javax.annotation.Nonnull - public String getUserFullName() { - return userFullName; - } - - public void setUserFullName(String userFullName) { - this.userFullName = userFullName; - } - - - public EmailLinkValidateRsp userEmail(String userEmail) { - this.userEmail = userEmail; - return this; - } - - /** - * Get userEmail - * @return userEmail - **/ - @javax.annotation.Nonnull - public String getUserEmail() { - return userEmail; - } - - public void setUserEmail(String userEmail) { - this.userEmail = userEmail; - } - - - public EmailLinkValidateRsp loginToken(String loginToken) { - this.loginToken = loginToken; - return this; - } - - /** - * Get loginToken - * @return loginToken - **/ - @javax.annotation.Nullable - public String getLoginToken() { - return loginToken; - } - - public void setLoginToken(String loginToken) { - this.loginToken = loginToken; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailLinkValidateRsp emailLinkValidateRsp = (EmailLinkValidateRsp) o; - return Objects.equals(this.httpStatusCode, emailLinkValidateRsp.httpStatusCode) && - Objects.equals(this.message, emailLinkValidateRsp.message) && - Objects.equals(this.requestData, emailLinkValidateRsp.requestData) && - Objects.equals(this.runtime, emailLinkValidateRsp.runtime) && - Objects.equals(this.additionalPayload, emailLinkValidateRsp.additionalPayload) && - Objects.equals(this.userID, emailLinkValidateRsp.userID) && - Objects.equals(this.userFullName, emailLinkValidateRsp.userFullName) && - Objects.equals(this.userEmail, emailLinkValidateRsp.userEmail) && - Objects.equals(this.loginToken, emailLinkValidateRsp.loginToken); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, additionalPayload, userID, userFullName, userEmail, loginToken); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailLinkValidateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" additionalPayload: ").append(toIndentedString(additionalPayload)).append("\n"); - sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); - sb.append(" userEmail: ").append(toIndentedString(userEmail)).append("\n"); - sb.append(" loginToken: ").append(toIndentedString(loginToken)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("additionalPayload"); - openapiFields.add("userID"); - openapiFields.add("userFullName"); - openapiFields.add("userEmail"); - openapiFields.add("loginToken"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("userID"); - openapiRequiredFields.add("userFullName"); - openapiRequiredFields.add("userEmail"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailLinkValidateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailLinkValidateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinkValidateRsp is not found in the empty JSON string", EmailLinkValidateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailLinkValidateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinkValidateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailLinkValidateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if ((jsonObj.get("additionalPayload") != null && !jsonObj.get("additionalPayload").isJsonNull()) && !jsonObj.get("additionalPayload").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `additionalPayload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalPayload").toString())); - } - if (!jsonObj.get("userID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); - } - if (!jsonObj.get("userFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); - } - if (!jsonObj.get("userEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userEmail").toString())); - } - if ((jsonObj.get("loginToken") != null && !jsonObj.get("loginToken").isJsonNull()) && !jsonObj.get("loginToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `loginToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginToken").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailLinkValidateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailLinkValidateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailLinkValidateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailLinkValidateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailLinkValidateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailLinkValidateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailLinkValidateRsp - * @throws IOException if the JSON string is invalid with respect to EmailLinkValidateRsp - */ - public static EmailLinkValidateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailLinkValidateRsp.class); - } - - /** - * Convert an instance of EmailLinkValidateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailLinksDeleteReq.java b/src/main/java/com/corbado/generated/model/EmailLinksDeleteReq.java deleted file mode 100644 index 4334e93..0000000 --- a/src/main/java/com/corbado/generated/model/EmailLinksDeleteReq.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailLinksDeleteReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailLinksDeleteReq { - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public EmailLinksDeleteReq() { - } - - public EmailLinksDeleteReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nonnull - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public EmailLinksDeleteReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailLinksDeleteReq emailLinksDeleteReq = (EmailLinksDeleteReq) o; - return Objects.equals(this.requestID, emailLinksDeleteReq.requestID) && - Objects.equals(this.clientInfo, emailLinksDeleteReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailLinksDeleteReq {\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("requestID"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailLinksDeleteReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailLinksDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinksDeleteReq is not found in the empty JSON string", EmailLinksDeleteReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailLinksDeleteReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinksDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailLinksDeleteReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailLinksDeleteReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailLinksDeleteReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailLinksDeleteReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailLinksDeleteReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailLinksDeleteReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailLinksDeleteReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailLinksDeleteReq - * @throws IOException if the JSON string is invalid with respect to EmailLinksDeleteReq - */ - public static EmailLinksDeleteReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailLinksDeleteReq.class); - } - - /** - * Convert an instance of EmailLinksDeleteReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailLinksValidateReq.java b/src/main/java/com/corbado/generated/model/EmailLinksValidateReq.java deleted file mode 100644 index c76d8cb..0000000 --- a/src/main/java/com/corbado/generated/model/EmailLinksValidateReq.java +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailLinksValidateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailLinksValidateReq { - public static final String SERIALIZED_NAME_TOKEN = "token"; - @SerializedName(SERIALIZED_NAME_TOKEN) - private String token; - - public static final String SERIALIZED_NAME_CREATE_LOGIN_TOKEN = "createLoginToken"; - @SerializedName(SERIALIZED_NAME_CREATE_LOGIN_TOKEN) - private Boolean createLoginToken; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public EmailLinksValidateReq() { - } - - public EmailLinksValidateReq token(String token) { - this.token = token; - return this; - } - - /** - * Token to validate - * @return token - **/ - @javax.annotation.Nonnull - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - - - public EmailLinksValidateReq createLoginToken(Boolean createLoginToken) { - this.createLoginToken = createLoginToken; - return this; - } - - /** - * Get createLoginToken - * @return createLoginToken - **/ - @javax.annotation.Nullable - public Boolean getCreateLoginToken() { - return createLoginToken; - } - - public void setCreateLoginToken(Boolean createLoginToken) { - this.createLoginToken = createLoginToken; - } - - - public EmailLinksValidateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public EmailLinksValidateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailLinksValidateReq emailLinksValidateReq = (EmailLinksValidateReq) o; - return Objects.equals(this.token, emailLinksValidateReq.token) && - Objects.equals(this.createLoginToken, emailLinksValidateReq.createLoginToken) && - Objects.equals(this.requestID, emailLinksValidateReq.requestID) && - Objects.equals(this.clientInfo, emailLinksValidateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(token, createLoginToken, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailLinksValidateReq {\n"); - sb.append(" token: ").append(toIndentedString(token)).append("\n"); - sb.append(" createLoginToken: ").append(toIndentedString(createLoginToken)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("token"); - openapiFields.add("createLoginToken"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("token"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailLinksValidateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailLinksValidateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailLinksValidateReq is not found in the empty JSON string", EmailLinksValidateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailLinksValidateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailLinksValidateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailLinksValidateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailLinksValidateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailLinksValidateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailLinksValidateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailLinksValidateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailLinksValidateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailLinksValidateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailLinksValidateReq - * @throws IOException if the JSON string is invalid with respect to EmailLinksValidateReq - */ - public static EmailLinksValidateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailLinksValidateReq.class); - } - - /** - * Convert an instance of EmailLinksValidateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailTemplateCreateReq.java b/src/main/java/com/corbado/generated/model/EmailTemplateCreateReq.java deleted file mode 100644 index c617ca3..0000000 --- a/src/main/java/com/corbado/generated/model/EmailTemplateCreateReq.java +++ /dev/null @@ -1,806 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailTemplateCreateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailTemplateCreateReq { - /** - * Gets or Sets lang - */ - @JsonAdapter(LangEnum.Adapter.class) - public enum LangEnum { - EN("en"), - - DE("de"), - - FR("fr"); - - private String value; - - LangEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LangEnum fromValue(String value) { - for (LangEnum b : LangEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LangEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LangEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LangEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - LangEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_LANG = "lang"; - @SerializedName(SERIALIZED_NAME_LANG) - private LangEnum lang; - - /** - * Gets or Sets type - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - EMAIL_LINK("email_link"), - - EMAIL_LINK_LOGIN("email_link_login"), - - LOGIN_NOTIFICATION("login_notification"), - - PASSKEY_NOTIFICATION("passkey_notification"), - - EMAIL_CODE("email_code"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_SUBJECT = "subject"; - @SerializedName(SERIALIZED_NAME_SUBJECT) - private String subject; - - public static final String SERIALIZED_NAME_ACTION = "action"; - @SerializedName(SERIALIZED_NAME_ACTION) - private String action; - - public static final String SERIALIZED_NAME_PLAIN_TEXT_BODY = "plainTextBody"; - @SerializedName(SERIALIZED_NAME_PLAIN_TEXT_BODY) - private String plainTextBody; - - public static final String SERIALIZED_NAME_HTML_TEXT_TITLE = "htmlTextTitle"; - @SerializedName(SERIALIZED_NAME_HTML_TEXT_TITLE) - private String htmlTextTitle; - - public static final String SERIALIZED_NAME_HTML_TEXT_BODY = "htmlTextBody"; - @SerializedName(SERIALIZED_NAME_HTML_TEXT_BODY) - private String htmlTextBody; - - public static final String SERIALIZED_NAME_HTML_TEXT_BUTTON = "htmlTextButton"; - @SerializedName(SERIALIZED_NAME_HTML_TEXT_BUTTON) - private String htmlTextButton; - - public static final String SERIALIZED_NAME_HTML_COLOR_FONT = "htmlColorFont"; - @SerializedName(SERIALIZED_NAME_HTML_COLOR_FONT) - private String htmlColorFont; - - public static final String SERIALIZED_NAME_HTML_COLOR_BACKGROUND_OUTER = "htmlColorBackgroundOuter"; - @SerializedName(SERIALIZED_NAME_HTML_COLOR_BACKGROUND_OUTER) - private String htmlColorBackgroundOuter; - - public static final String SERIALIZED_NAME_HTML_COLOR_BACKGROUND_INNER = "htmlColorBackgroundInner"; - @SerializedName(SERIALIZED_NAME_HTML_COLOR_BACKGROUND_INNER) - private String htmlColorBackgroundInner; - - public static final String SERIALIZED_NAME_HTML_COLOR_BUTTON = "htmlColorButton"; - @SerializedName(SERIALIZED_NAME_HTML_COLOR_BUTTON) - private String htmlColorButton; - - public static final String SERIALIZED_NAME_HTML_COLOR_BUTTON_FONT = "htmlColorButtonFont"; - @SerializedName(SERIALIZED_NAME_HTML_COLOR_BUTTON_FONT) - private String htmlColorButtonFont; - - public static final String SERIALIZED_NAME_IS_DEFAULT = "isDefault"; - @SerializedName(SERIALIZED_NAME_IS_DEFAULT) - private Boolean isDefault; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public EmailTemplateCreateReq() { - } - - public EmailTemplateCreateReq lang(LangEnum lang) { - this.lang = lang; - return this; - } - - /** - * Get lang - * @return lang - **/ - @javax.annotation.Nonnull - public LangEnum getLang() { - return lang; - } - - public void setLang(LangEnum lang) { - this.lang = lang; - } - - - public EmailTemplateCreateReq type(TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - **/ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - - public EmailTemplateCreateReq name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public EmailTemplateCreateReq subject(String subject) { - this.subject = subject; - return this; - } - - /** - * Get subject - * @return subject - **/ - @javax.annotation.Nonnull - public String getSubject() { - return subject; - } - - public void setSubject(String subject) { - this.subject = subject; - } - - - public EmailTemplateCreateReq action(String action) { - this.action = action; - return this; - } - - /** - * Get action - * @return action - **/ - @javax.annotation.Nullable - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - - public EmailTemplateCreateReq plainTextBody(String plainTextBody) { - this.plainTextBody = plainTextBody; - return this; - } - - /** - * Get plainTextBody - * @return plainTextBody - **/ - @javax.annotation.Nonnull - public String getPlainTextBody() { - return plainTextBody; - } - - public void setPlainTextBody(String plainTextBody) { - this.plainTextBody = plainTextBody; - } - - - public EmailTemplateCreateReq htmlTextTitle(String htmlTextTitle) { - this.htmlTextTitle = htmlTextTitle; - return this; - } - - /** - * Get htmlTextTitle - * @return htmlTextTitle - **/ - @javax.annotation.Nonnull - public String getHtmlTextTitle() { - return htmlTextTitle; - } - - public void setHtmlTextTitle(String htmlTextTitle) { - this.htmlTextTitle = htmlTextTitle; - } - - - public EmailTemplateCreateReq htmlTextBody(String htmlTextBody) { - this.htmlTextBody = htmlTextBody; - return this; - } - - /** - * Get htmlTextBody - * @return htmlTextBody - **/ - @javax.annotation.Nonnull - public String getHtmlTextBody() { - return htmlTextBody; - } - - public void setHtmlTextBody(String htmlTextBody) { - this.htmlTextBody = htmlTextBody; - } - - - public EmailTemplateCreateReq htmlTextButton(String htmlTextButton) { - this.htmlTextButton = htmlTextButton; - return this; - } - - /** - * Get htmlTextButton - * @return htmlTextButton - **/ - @javax.annotation.Nonnull - public String getHtmlTextButton() { - return htmlTextButton; - } - - public void setHtmlTextButton(String htmlTextButton) { - this.htmlTextButton = htmlTextButton; - } - - - public EmailTemplateCreateReq htmlColorFont(String htmlColorFont) { - this.htmlColorFont = htmlColorFont; - return this; - } - - /** - * Get htmlColorFont - * @return htmlColorFont - **/ - @javax.annotation.Nonnull - public String getHtmlColorFont() { - return htmlColorFont; - } - - public void setHtmlColorFont(String htmlColorFont) { - this.htmlColorFont = htmlColorFont; - } - - - public EmailTemplateCreateReq htmlColorBackgroundOuter(String htmlColorBackgroundOuter) { - this.htmlColorBackgroundOuter = htmlColorBackgroundOuter; - return this; - } - - /** - * Get htmlColorBackgroundOuter - * @return htmlColorBackgroundOuter - **/ - @javax.annotation.Nonnull - public String getHtmlColorBackgroundOuter() { - return htmlColorBackgroundOuter; - } - - public void setHtmlColorBackgroundOuter(String htmlColorBackgroundOuter) { - this.htmlColorBackgroundOuter = htmlColorBackgroundOuter; - } - - - public EmailTemplateCreateReq htmlColorBackgroundInner(String htmlColorBackgroundInner) { - this.htmlColorBackgroundInner = htmlColorBackgroundInner; - return this; - } - - /** - * Get htmlColorBackgroundInner - * @return htmlColorBackgroundInner - **/ - @javax.annotation.Nonnull - public String getHtmlColorBackgroundInner() { - return htmlColorBackgroundInner; - } - - public void setHtmlColorBackgroundInner(String htmlColorBackgroundInner) { - this.htmlColorBackgroundInner = htmlColorBackgroundInner; - } - - - public EmailTemplateCreateReq htmlColorButton(String htmlColorButton) { - this.htmlColorButton = htmlColorButton; - return this; - } - - /** - * Get htmlColorButton - * @return htmlColorButton - **/ - @javax.annotation.Nonnull - public String getHtmlColorButton() { - return htmlColorButton; - } - - public void setHtmlColorButton(String htmlColorButton) { - this.htmlColorButton = htmlColorButton; - } - - - public EmailTemplateCreateReq htmlColorButtonFont(String htmlColorButtonFont) { - this.htmlColorButtonFont = htmlColorButtonFont; - return this; - } - - /** - * Get htmlColorButtonFont - * @return htmlColorButtonFont - **/ - @javax.annotation.Nonnull - public String getHtmlColorButtonFont() { - return htmlColorButtonFont; - } - - public void setHtmlColorButtonFont(String htmlColorButtonFont) { - this.htmlColorButtonFont = htmlColorButtonFont; - } - - - public EmailTemplateCreateReq isDefault(Boolean isDefault) { - this.isDefault = isDefault; - return this; - } - - /** - * Get isDefault - * @return isDefault - **/ - @javax.annotation.Nonnull - public Boolean getIsDefault() { - return isDefault; - } - - public void setIsDefault(Boolean isDefault) { - this.isDefault = isDefault; - } - - - public EmailTemplateCreateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public EmailTemplateCreateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailTemplateCreateReq emailTemplateCreateReq = (EmailTemplateCreateReq) o; - return Objects.equals(this.lang, emailTemplateCreateReq.lang) && - Objects.equals(this.type, emailTemplateCreateReq.type) && - Objects.equals(this.name, emailTemplateCreateReq.name) && - Objects.equals(this.subject, emailTemplateCreateReq.subject) && - Objects.equals(this.action, emailTemplateCreateReq.action) && - Objects.equals(this.plainTextBody, emailTemplateCreateReq.plainTextBody) && - Objects.equals(this.htmlTextTitle, emailTemplateCreateReq.htmlTextTitle) && - Objects.equals(this.htmlTextBody, emailTemplateCreateReq.htmlTextBody) && - Objects.equals(this.htmlTextButton, emailTemplateCreateReq.htmlTextButton) && - Objects.equals(this.htmlColorFont, emailTemplateCreateReq.htmlColorFont) && - Objects.equals(this.htmlColorBackgroundOuter, emailTemplateCreateReq.htmlColorBackgroundOuter) && - Objects.equals(this.htmlColorBackgroundInner, emailTemplateCreateReq.htmlColorBackgroundInner) && - Objects.equals(this.htmlColorButton, emailTemplateCreateReq.htmlColorButton) && - Objects.equals(this.htmlColorButtonFont, emailTemplateCreateReq.htmlColorButtonFont) && - Objects.equals(this.isDefault, emailTemplateCreateReq.isDefault) && - Objects.equals(this.requestID, emailTemplateCreateReq.requestID) && - Objects.equals(this.clientInfo, emailTemplateCreateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(lang, type, name, subject, action, plainTextBody, htmlTextTitle, htmlTextBody, htmlTextButton, htmlColorFont, htmlColorBackgroundOuter, htmlColorBackgroundInner, htmlColorButton, htmlColorButtonFont, isDefault, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailTemplateCreateReq {\n"); - sb.append(" lang: ").append(toIndentedString(lang)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" action: ").append(toIndentedString(action)).append("\n"); - sb.append(" plainTextBody: ").append(toIndentedString(plainTextBody)).append("\n"); - sb.append(" htmlTextTitle: ").append(toIndentedString(htmlTextTitle)).append("\n"); - sb.append(" htmlTextBody: ").append(toIndentedString(htmlTextBody)).append("\n"); - sb.append(" htmlTextButton: ").append(toIndentedString(htmlTextButton)).append("\n"); - sb.append(" htmlColorFont: ").append(toIndentedString(htmlColorFont)).append("\n"); - sb.append(" htmlColorBackgroundOuter: ").append(toIndentedString(htmlColorBackgroundOuter)).append("\n"); - sb.append(" htmlColorBackgroundInner: ").append(toIndentedString(htmlColorBackgroundInner)).append("\n"); - sb.append(" htmlColorButton: ").append(toIndentedString(htmlColorButton)).append("\n"); - sb.append(" htmlColorButtonFont: ").append(toIndentedString(htmlColorButtonFont)).append("\n"); - sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("lang"); - openapiFields.add("type"); - openapiFields.add("name"); - openapiFields.add("subject"); - openapiFields.add("action"); - openapiFields.add("plainTextBody"); - openapiFields.add("htmlTextTitle"); - openapiFields.add("htmlTextBody"); - openapiFields.add("htmlTextButton"); - openapiFields.add("htmlColorFont"); - openapiFields.add("htmlColorBackgroundOuter"); - openapiFields.add("htmlColorBackgroundInner"); - openapiFields.add("htmlColorButton"); - openapiFields.add("htmlColorButtonFont"); - openapiFields.add("isDefault"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("lang"); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("subject"); - openapiRequiredFields.add("plainTextBody"); - openapiRequiredFields.add("htmlTextTitle"); - openapiRequiredFields.add("htmlTextBody"); - openapiRequiredFields.add("htmlTextButton"); - openapiRequiredFields.add("htmlColorFont"); - openapiRequiredFields.add("htmlColorBackgroundOuter"); - openapiRequiredFields.add("htmlColorBackgroundInner"); - openapiRequiredFields.add("htmlColorButton"); - openapiRequiredFields.add("htmlColorButtonFont"); - openapiRequiredFields.add("isDefault"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailTemplateCreateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailTemplateCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailTemplateCreateReq is not found in the empty JSON string", EmailTemplateCreateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailTemplateCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailTemplateCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailTemplateCreateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("lang").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lang` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lang").toString())); - } - // validate the required field `lang` - LangEnum.validateJsonElement(jsonObj.get("lang")); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - // validate the required field `type` - TypeEnum.validateJsonElement(jsonObj.get("type")); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("subject").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString())); - } - if ((jsonObj.get("action") != null && !jsonObj.get("action").isJsonNull()) && !jsonObj.get("action").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString())); - } - if (!jsonObj.get("plainTextBody").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `plainTextBody` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plainTextBody").toString())); - } - if (!jsonObj.get("htmlTextTitle").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `htmlTextTitle` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlTextTitle").toString())); - } - if (!jsonObj.get("htmlTextBody").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `htmlTextBody` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlTextBody").toString())); - } - if (!jsonObj.get("htmlTextButton").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `htmlTextButton` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlTextButton").toString())); - } - if (!jsonObj.get("htmlColorFont").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `htmlColorFont` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlColorFont").toString())); - } - if (!jsonObj.get("htmlColorBackgroundOuter").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `htmlColorBackgroundOuter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlColorBackgroundOuter").toString())); - } - if (!jsonObj.get("htmlColorBackgroundInner").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `htmlColorBackgroundInner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlColorBackgroundInner").toString())); - } - if (!jsonObj.get("htmlColorButton").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `htmlColorButton` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlColorButton").toString())); - } - if (!jsonObj.get("htmlColorButtonFont").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `htmlColorButtonFont` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htmlColorButtonFont").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailTemplateCreateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailTemplateCreateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailTemplateCreateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailTemplateCreateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailTemplateCreateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailTemplateCreateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailTemplateCreateReq - * @throws IOException if the JSON string is invalid with respect to EmailTemplateCreateReq - */ - public static EmailTemplateCreateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailTemplateCreateReq.class); - } - - /** - * Convert an instance of EmailTemplateCreateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailTemplateCreateRsp.java b/src/main/java/com/corbado/generated/model/EmailTemplateCreateRsp.java deleted file mode 100644 index 2405c66..0000000 --- a/src/main/java/com/corbado/generated/model/EmailTemplateCreateRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.EmailTemplateCreateRspAllOfData; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailTemplateCreateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailTemplateCreateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private EmailTemplateCreateRspAllOfData data; - - public EmailTemplateCreateRsp() { - } - - public EmailTemplateCreateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public EmailTemplateCreateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public EmailTemplateCreateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public EmailTemplateCreateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public EmailTemplateCreateRsp data(EmailTemplateCreateRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public EmailTemplateCreateRspAllOfData getData() { - return data; - } - - public void setData(EmailTemplateCreateRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailTemplateCreateRsp emailTemplateCreateRsp = (EmailTemplateCreateRsp) o; - return Objects.equals(this.httpStatusCode, emailTemplateCreateRsp.httpStatusCode) && - Objects.equals(this.message, emailTemplateCreateRsp.message) && - Objects.equals(this.requestData, emailTemplateCreateRsp.requestData) && - Objects.equals(this.runtime, emailTemplateCreateRsp.runtime) && - Objects.equals(this.data, emailTemplateCreateRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailTemplateCreateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailTemplateCreateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailTemplateCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailTemplateCreateRsp is not found in the empty JSON string", EmailTemplateCreateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailTemplateCreateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailTemplateCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailTemplateCreateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - EmailTemplateCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailTemplateCreateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailTemplateCreateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailTemplateCreateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailTemplateCreateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailTemplateCreateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailTemplateCreateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailTemplateCreateRsp - * @throws IOException if the JSON string is invalid with respect to EmailTemplateCreateRsp - */ - public static EmailTemplateCreateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailTemplateCreateRsp.class); - } - - /** - * Convert an instance of EmailTemplateCreateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailTemplateCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/EmailTemplateCreateRspAllOfData.java deleted file mode 100644 index 8d12900..0000000 --- a/src/main/java/com/corbado/generated/model/EmailTemplateCreateRspAllOfData.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailTemplateCreateRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailTemplateCreateRspAllOfData { - public static final String SERIALIZED_NAME_EMAIL_TEMPLATE_I_D = "emailTemplateID"; - @SerializedName(SERIALIZED_NAME_EMAIL_TEMPLATE_I_D) - private String emailTemplateID; - - public EmailTemplateCreateRspAllOfData() { - } - - public EmailTemplateCreateRspAllOfData emailTemplateID(String emailTemplateID) { - this.emailTemplateID = emailTemplateID; - return this; - } - - /** - * Get emailTemplateID - * @return emailTemplateID - **/ - @javax.annotation.Nonnull - public String getEmailTemplateID() { - return emailTemplateID; - } - - public void setEmailTemplateID(String emailTemplateID) { - this.emailTemplateID = emailTemplateID; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailTemplateCreateRspAllOfData emailTemplateCreateRspAllOfData = (EmailTemplateCreateRspAllOfData) o; - return Objects.equals(this.emailTemplateID, emailTemplateCreateRspAllOfData.emailTemplateID); - } - - @Override - public int hashCode() { - return Objects.hash(emailTemplateID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailTemplateCreateRspAllOfData {\n"); - sb.append(" emailTemplateID: ").append(toIndentedString(emailTemplateID)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("emailTemplateID"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("emailTemplateID"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailTemplateCreateRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailTemplateCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailTemplateCreateRspAllOfData is not found in the empty JSON string", EmailTemplateCreateRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailTemplateCreateRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailTemplateCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailTemplateCreateRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("emailTemplateID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `emailTemplateID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailTemplateID").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailTemplateCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailTemplateCreateRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailTemplateCreateRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailTemplateCreateRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailTemplateCreateRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailTemplateCreateRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailTemplateCreateRspAllOfData - * @throws IOException if the JSON string is invalid with respect to EmailTemplateCreateRspAllOfData - */ - public static EmailTemplateCreateRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailTemplateCreateRspAllOfData.class); - } - - /** - * Convert an instance of EmailTemplateCreateRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailTemplateDeleteReq.java b/src/main/java/com/corbado/generated/model/EmailTemplateDeleteReq.java deleted file mode 100644 index a6dbdbc..0000000 --- a/src/main/java/com/corbado/generated/model/EmailTemplateDeleteReq.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailTemplateDeleteReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailTemplateDeleteReq { - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public EmailTemplateDeleteReq() { - } - - public EmailTemplateDeleteReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public EmailTemplateDeleteReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailTemplateDeleteReq emailTemplateDeleteReq = (EmailTemplateDeleteReq) o; - return Objects.equals(this.requestID, emailTemplateDeleteReq.requestID) && - Objects.equals(this.clientInfo, emailTemplateDeleteReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailTemplateDeleteReq {\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailTemplateDeleteReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailTemplateDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailTemplateDeleteReq is not found in the empty JSON string", EmailTemplateDeleteReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailTemplateDeleteReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailTemplateDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailTemplateDeleteReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailTemplateDeleteReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailTemplateDeleteReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailTemplateDeleteReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailTemplateDeleteReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailTemplateDeleteReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailTemplateDeleteReq - * @throws IOException if the JSON string is invalid with respect to EmailTemplateDeleteReq - */ - public static EmailTemplateDeleteReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailTemplateDeleteReq.class); - } - - /** - * Convert an instance of EmailTemplateDeleteReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmailValidationResult.java b/src/main/java/com/corbado/generated/model/EmailValidationResult.java deleted file mode 100644 index ca736d9..0000000 --- a/src/main/java/com/corbado/generated/model/EmailValidationResult.java +++ /dev/null @@ -1,361 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ValidationEmail; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmailValidationResult - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmailValidationResult { - public static final String SERIALIZED_NAME_IS_VALID = "isValid"; - @SerializedName(SERIALIZED_NAME_IS_VALID) - private Boolean isValid; - - /** - * Gets or Sets validationCode - */ - @JsonAdapter(ValidationCodeEnum.Adapter.class) - public enum ValidationCodeEnum { - VALID("valid"), - - INVALID_SYNTAX("invalid_syntax"), - - NO_SUCH_HOST("no_such_host"), - - NOT_ALLOWED("not_allowed"), - - UNKNOWN("unknown"); - - private String value; - - ValidationCodeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ValidationCodeEnum fromValue(String value) { - for (ValidationCodeEnum b : ValidationCodeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ValidationCodeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ValidationCodeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ValidationCodeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ValidationCodeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_VALIDATION_CODE = "validationCode"; - @SerializedName(SERIALIZED_NAME_VALIDATION_CODE) - private ValidationCodeEnum validationCode; - - public static final String SERIALIZED_NAME_SUGGESTION = "suggestion"; - @SerializedName(SERIALIZED_NAME_SUGGESTION) - private String suggestion; - - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private ValidationEmail email; - - public EmailValidationResult() { - } - - public EmailValidationResult isValid(Boolean isValid) { - this.isValid = isValid; - return this; - } - - /** - * Get isValid - * @return isValid - **/ - @javax.annotation.Nonnull - public Boolean getIsValid() { - return isValid; - } - - public void setIsValid(Boolean isValid) { - this.isValid = isValid; - } - - - public EmailValidationResult validationCode(ValidationCodeEnum validationCode) { - this.validationCode = validationCode; - return this; - } - - /** - * Get validationCode - * @return validationCode - **/ - @javax.annotation.Nonnull - public ValidationCodeEnum getValidationCode() { - return validationCode; - } - - public void setValidationCode(ValidationCodeEnum validationCode) { - this.validationCode = validationCode; - } - - - public EmailValidationResult suggestion(String suggestion) { - this.suggestion = suggestion; - return this; - } - - /** - * Get suggestion - * @return suggestion - **/ - @javax.annotation.Nullable - public String getSuggestion() { - return suggestion; - } - - public void setSuggestion(String suggestion) { - this.suggestion = suggestion; - } - - - public EmailValidationResult email(ValidationEmail email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - **/ - @javax.annotation.Nullable - public ValidationEmail getEmail() { - return email; - } - - public void setEmail(ValidationEmail email) { - this.email = email; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmailValidationResult emailValidationResult = (EmailValidationResult) o; - return Objects.equals(this.isValid, emailValidationResult.isValid) && - Objects.equals(this.validationCode, emailValidationResult.validationCode) && - Objects.equals(this.suggestion, emailValidationResult.suggestion) && - Objects.equals(this.email, emailValidationResult.email); - } - - @Override - public int hashCode() { - return Objects.hash(isValid, validationCode, suggestion, email); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmailValidationResult {\n"); - sb.append(" isValid: ").append(toIndentedString(isValid)).append("\n"); - sb.append(" validationCode: ").append(toIndentedString(validationCode)).append("\n"); - sb.append(" suggestion: ").append(toIndentedString(suggestion)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("isValid"); - openapiFields.add("validationCode"); - openapiFields.add("suggestion"); - openapiFields.add("email"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("isValid"); - openapiRequiredFields.add("validationCode"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmailValidationResult - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmailValidationResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmailValidationResult is not found in the empty JSON string", EmailValidationResult.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmailValidationResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmailValidationResult` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EmailValidationResult.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("validationCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `validationCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("validationCode").toString())); - } - // validate the required field `validationCode` - ValidationCodeEnum.validateJsonElement(jsonObj.get("validationCode")); - if ((jsonObj.get("suggestion") != null && !jsonObj.get("suggestion").isJsonNull()) && !jsonObj.get("suggestion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `suggestion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("suggestion").toString())); - } - // validate the optional field `email` - if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) { - ValidationEmail.validateJsonElement(jsonObj.get("email")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmailValidationResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmailValidationResult' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmailValidationResult.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmailValidationResult value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmailValidationResult read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmailValidationResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmailValidationResult - * @throws IOException if the JSON string is invalid with respect to EmailValidationResult - */ - public static EmailValidationResult fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmailValidationResult.class); - } - - /** - * Convert an instance of EmailValidationResult to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/EmptyReq.java b/src/main/java/com/corbado/generated/model/EmptyReq.java deleted file mode 100644 index 5dcb975..0000000 --- a/src/main/java/com/corbado/generated/model/EmptyReq.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * EmptyReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class EmptyReq { - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public EmptyReq() { - } - - public EmptyReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public EmptyReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmptyReq emptyReq = (EmptyReq) o; - return Objects.equals(this.requestID, emptyReq.requestID) && - Objects.equals(this.clientInfo, emptyReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmptyReq {\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to EmptyReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!EmptyReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in EmptyReq is not found in the empty JSON string", EmptyReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!EmptyReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EmptyReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!EmptyReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'EmptyReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(EmptyReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, EmptyReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public EmptyReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of EmptyReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of EmptyReq - * @throws IOException if the JSON string is invalid with respect to EmptyReq - */ - public static EmptyReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, EmptyReq.class); - } - - /** - * Convert an instance of EmptyReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ErrorRsp.java b/src/main/java/com/corbado/generated/model/ErrorRsp.java index a9fdc57..ec63346 100644 --- a/src/main/java/com/corbado/generated/model/ErrorRsp.java +++ b/src/main/java/com/corbado/generated/model/ErrorRsp.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -51,7 +51,7 @@ /** * ErrorRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ErrorRsp { public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) @@ -85,12 +85,12 @@ public ErrorRsp httpStatusCode(Integer httpStatusCode) { return this; } - /** + /** * HTTP status code of operation * minimum: 200 * maximum: 599 * @return httpStatusCode - **/ + */ @javax.annotation.Nonnull public Integer getHttpStatusCode() { return httpStatusCode; @@ -106,10 +106,10 @@ public ErrorRsp message(String message) { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nonnull public String getMessage() { return message; @@ -125,10 +125,10 @@ public ErrorRsp requestData(RequestData requestData) { return this; } - /** + /** * Get requestData * @return requestData - **/ + */ @javax.annotation.Nonnull public RequestData getRequestData() { return requestData; @@ -144,10 +144,10 @@ public ErrorRsp runtime(Float runtime) { return this; } - /** + /** * Runtime in seconds for this request * @return runtime - **/ + */ @javax.annotation.Nonnull public Float getRuntime() { return runtime; @@ -163,10 +163,10 @@ public ErrorRsp data(Object data) { return this; } - /** + /** * Get data * @return data - **/ + */ @javax.annotation.Nullable public Object getData() { return data; @@ -182,10 +182,10 @@ public ErrorRsp error(ErrorRspAllOfError error) { return this; } - /** + /** * Get error * @return error - **/ + */ @javax.annotation.Nonnull public ErrorRspAllOfError getError() { return error; @@ -267,12 +267,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("error"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ErrorRsp - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ErrorRsp + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ErrorRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -333,22 +333,22 @@ public ErrorRsp read(JsonReader in) throws IOException { } } - /** - * Create an instance of ErrorRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of ErrorRsp - * @throws IOException if the JSON string is invalid with respect to ErrorRsp - */ + /** + * Create an instance of ErrorRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorRsp + * @throws IOException if the JSON string is invalid with respect to ErrorRsp + */ public static ErrorRsp fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ErrorRsp.class); } - /** - * Convert an instance of ErrorRsp to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ErrorRsp to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java b/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java index cbd83a3..1f49cb3 100644 --- a/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java +++ b/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,7 +52,7 @@ /** * ErrorRspAllOfError */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ErrorRspAllOfError { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @@ -78,10 +78,10 @@ public ErrorRspAllOfError type(String type) { return this; } - /** + /** * Type of error * @return type - **/ + */ @javax.annotation.Nonnull public String getType() { return type; @@ -97,10 +97,10 @@ public ErrorRspAllOfError details(String details) { return this; } - /** + /** * Details of error * @return details - **/ + */ @javax.annotation.Nullable public String getDetails() { return details; @@ -124,10 +124,10 @@ public ErrorRspAllOfError addValidationItem(ErrorRspAllOfErrorValidation validat return this; } - /** + /** * Validation errors per field * @return validation - **/ + */ @javax.annotation.Nullable public List getValidation() { return validation; @@ -151,10 +151,10 @@ public ErrorRspAllOfError addLinksItem(String linksItem) { return this; } - /** + /** * Additional links to help understand the error * @return links - **/ + */ @javax.annotation.Nonnull public List getLinks() { return links; @@ -227,12 +227,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("links"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ErrorRspAllOfError - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ErrorRspAllOfError + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ErrorRspAllOfError.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -312,22 +312,22 @@ public ErrorRspAllOfError read(JsonReader in) throws IOException { } } - /** - * Create an instance of ErrorRspAllOfError given an JSON string - * - * @param jsonString JSON string - * @return An instance of ErrorRspAllOfError - * @throws IOException if the JSON string is invalid with respect to ErrorRspAllOfError - */ + /** + * Create an instance of ErrorRspAllOfError given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorRspAllOfError + * @throws IOException if the JSON string is invalid with respect to ErrorRspAllOfError + */ public static ErrorRspAllOfError fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ErrorRspAllOfError.class); } - /** - * Convert an instance of ErrorRspAllOfError to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ErrorRspAllOfError to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java b/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java index e78aa53..2845e3a 100644 --- a/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java +++ b/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * ErrorRspAllOfErrorValidation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ErrorRspAllOfErrorValidation { public static final String SERIALIZED_NAME_FIELD = "field"; @SerializedName(SERIALIZED_NAME_FIELD) @@ -67,10 +67,10 @@ public ErrorRspAllOfErrorValidation field(String field) { return this; } - /** + /** * Get field * @return field - **/ + */ @javax.annotation.Nonnull public String getField() { return field; @@ -86,10 +86,10 @@ public ErrorRspAllOfErrorValidation message(String message) { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nonnull public String getMessage() { return message; @@ -156,12 +156,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("message"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ErrorRspAllOfErrorValidation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ErrorRspAllOfErrorValidation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ErrorRspAllOfErrorValidation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -221,22 +221,22 @@ public ErrorRspAllOfErrorValidation read(JsonReader in) throws IOException { } } - /** - * Create an instance of ErrorRspAllOfErrorValidation given an JSON string - * - * @param jsonString JSON string - * @return An instance of ErrorRspAllOfErrorValidation - * @throws IOException if the JSON string is invalid with respect to ErrorRspAllOfErrorValidation - */ + /** + * Create an instance of ErrorRspAllOfErrorValidation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorRspAllOfErrorValidation + * @throws IOException if the JSON string is invalid with respect to ErrorRspAllOfErrorValidation + */ public static ErrorRspAllOfErrorValidation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ErrorRspAllOfErrorValidation.class); } - /** - * Convert an instance of ErrorRspAllOfErrorValidation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ErrorRspAllOfErrorValidation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/com/corbado/generated/model/ExampleGetRsp.java b/src/main/java/com/corbado/generated/model/ExampleGetRsp.java deleted file mode 100644 index ffb6c66..0000000 --- a/src/main/java/com/corbado/generated/model/ExampleGetRsp.java +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ExampleGetRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ExampleGetRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private String data; - - /** - * The extension of the compressed example file - */ - @JsonAdapter(ExtensionEnum.Adapter.class) - public enum ExtensionEnum { - ZIP("zip"), - - TAR_GZ("tar.gz"); - - private String value; - - ExtensionEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ExtensionEnum fromValue(String value) { - for (ExtensionEnum b : ExtensionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ExtensionEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ExtensionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ExtensionEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ExtensionEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_EXTENSION = "extension"; - @SerializedName(SERIALIZED_NAME_EXTENSION) - private ExtensionEnum extension; - - public ExampleGetRsp() { - } - - public ExampleGetRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public ExampleGetRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public ExampleGetRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public ExampleGetRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public ExampleGetRsp data(String data) { - this.data = data; - return this; - } - - /** - * Base64 encoded data containing the compressed example file - * @return data - **/ - @javax.annotation.Nonnull - public String getData() { - return data; - } - - public void setData(String data) { - this.data = data; - } - - - public ExampleGetRsp extension(ExtensionEnum extension) { - this.extension = extension; - return this; - } - - /** - * The extension of the compressed example file - * @return extension - **/ - @javax.annotation.Nonnull - public ExtensionEnum getExtension() { - return extension; - } - - public void setExtension(ExtensionEnum extension) { - this.extension = extension; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ExampleGetRsp exampleGetRsp = (ExampleGetRsp) o; - return Objects.equals(this.httpStatusCode, exampleGetRsp.httpStatusCode) && - Objects.equals(this.message, exampleGetRsp.message) && - Objects.equals(this.requestData, exampleGetRsp.requestData) && - Objects.equals(this.runtime, exampleGetRsp.runtime) && - Objects.equals(this.data, exampleGetRsp.data) && - Objects.equals(this.extension, exampleGetRsp.extension); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data, extension); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ExampleGetRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append(" extension: ").append(toIndentedString(extension)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - openapiFields.add("extension"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - openapiRequiredFields.add("extension"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ExampleGetRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ExampleGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ExampleGetRsp is not found in the empty JSON string", ExampleGetRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ExampleGetRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ExampleGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ExampleGetRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("data").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); - } - if (!jsonObj.get("extension").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `extension` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extension").toString())); - } - // validate the required field `extension` - ExtensionEnum.validateJsonElement(jsonObj.get("extension")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ExampleGetRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ExampleGetRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ExampleGetRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ExampleGetRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ExampleGetRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ExampleGetRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of ExampleGetRsp - * @throws IOException if the JSON string is invalid with respect to ExampleGetRsp - */ - public static ExampleGetRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ExampleGetRsp.class); - } - - /** - * Convert an instance of ExampleGetRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/FullUser.java b/src/main/java/com/corbado/generated/model/FullUser.java deleted file mode 100644 index 2cbf1ce..0000000 --- a/src/main/java/com/corbado/generated/model/FullUser.java +++ /dev/null @@ -1,550 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Status; -import com.corbado.generated.model.UserEmail; -import com.corbado.generated.model.UserPhoneNumber; -import com.corbado.generated.model.UserSocialAccount; -import com.corbado.generated.model.UserUsername; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * User entry with emails and phone numbers - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class FullUser { - public static final String SERIALIZED_NAME_I_D = "ID"; - @SerializedName(SERIALIZED_NAME_I_D) - private String ID; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; - @SerializedName(SERIALIZED_NAME_FULL_NAME) - private String fullName; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private Status status; - - public static final String SERIALIZED_NAME_EMAILS = "emails"; - @SerializedName(SERIALIZED_NAME_EMAILS) - private List emails = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PHONE_NUMBERS = "phoneNumbers"; - @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS) - private List phoneNumbers = new ArrayList<>(); - - public static final String SERIALIZED_NAME_USERNAMES = "usernames"; - @SerializedName(SERIALIZED_NAME_USERNAMES) - private List usernames = new ArrayList<>(); - - public static final String SERIALIZED_NAME_SOCIAL_ACCOUNTS = "socialAccounts"; - @SerializedName(SERIALIZED_NAME_SOCIAL_ACCOUNTS) - private List socialAccounts = new ArrayList<>(); - - public FullUser() { - } - - public FullUser ID(String ID) { - this.ID = ID; - return this; - } - - /** - * ID of the user - * @return ID - **/ - @javax.annotation.Nonnull - public String getID() { - return ID; - } - - public void setID(String ID) { - this.ID = ID; - } - - - public FullUser name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public FullUser fullName(String fullName) { - this.fullName = fullName; - return this; - } - - /** - * Get fullName - * @return fullName - **/ - @javax.annotation.Nonnull - public String getFullName() { - return fullName; - } - - public void setFullName(String fullName) { - this.fullName = fullName; - } - - - public FullUser created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public FullUser updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - public FullUser status(Status status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - **/ - @javax.annotation.Nonnull - public Status getStatus() { - return status; - } - - public void setStatus(Status status) { - this.status = status; - } - - - public FullUser emails(List emails) { - this.emails = emails; - return this; - } - - public FullUser addEmailsItem(UserEmail emailsItem) { - if (this.emails == null) { - this.emails = new ArrayList<>(); - } - this.emails.add(emailsItem); - return this; - } - - /** - * Get emails - * @return emails - **/ - @javax.annotation.Nonnull - public List getEmails() { - return emails; - } - - public void setEmails(List emails) { - this.emails = emails; - } - - - public FullUser phoneNumbers(List phoneNumbers) { - this.phoneNumbers = phoneNumbers; - return this; - } - - public FullUser addPhoneNumbersItem(UserPhoneNumber phoneNumbersItem) { - if (this.phoneNumbers == null) { - this.phoneNumbers = new ArrayList<>(); - } - this.phoneNumbers.add(phoneNumbersItem); - return this; - } - - /** - * Get phoneNumbers - * @return phoneNumbers - **/ - @javax.annotation.Nonnull - public List getPhoneNumbers() { - return phoneNumbers; - } - - public void setPhoneNumbers(List phoneNumbers) { - this.phoneNumbers = phoneNumbers; - } - - - public FullUser usernames(List usernames) { - this.usernames = usernames; - return this; - } - - public FullUser addUsernamesItem(UserUsername usernamesItem) { - if (this.usernames == null) { - this.usernames = new ArrayList<>(); - } - this.usernames.add(usernamesItem); - return this; - } - - /** - * Get usernames - * @return usernames - **/ - @javax.annotation.Nonnull - public List getUsernames() { - return usernames; - } - - public void setUsernames(List usernames) { - this.usernames = usernames; - } - - - public FullUser socialAccounts(List socialAccounts) { - this.socialAccounts = socialAccounts; - return this; - } - - public FullUser addSocialAccountsItem(UserSocialAccount socialAccountsItem) { - if (this.socialAccounts == null) { - this.socialAccounts = new ArrayList<>(); - } - this.socialAccounts.add(socialAccountsItem); - return this; - } - - /** - * Get socialAccounts - * @return socialAccounts - **/ - @javax.annotation.Nonnull - public List getSocialAccounts() { - return socialAccounts; - } - - public void setSocialAccounts(List socialAccounts) { - this.socialAccounts = socialAccounts; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FullUser fullUser = (FullUser) o; - return Objects.equals(this.ID, fullUser.ID) && - Objects.equals(this.name, fullUser.name) && - Objects.equals(this.fullName, fullUser.fullName) && - Objects.equals(this.created, fullUser.created) && - Objects.equals(this.updated, fullUser.updated) && - Objects.equals(this.status, fullUser.status) && - Objects.equals(this.emails, fullUser.emails) && - Objects.equals(this.phoneNumbers, fullUser.phoneNumbers) && - Objects.equals(this.usernames, fullUser.usernames) && - Objects.equals(this.socialAccounts, fullUser.socialAccounts); - } - - @Override - public int hashCode() { - return Objects.hash(ID, name, fullName, created, updated, status, emails, phoneNumbers, usernames, socialAccounts); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FullUser {\n"); - sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" emails: ").append(toIndentedString(emails)).append("\n"); - sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); - sb.append(" usernames: ").append(toIndentedString(usernames)).append("\n"); - sb.append(" socialAccounts: ").append(toIndentedString(socialAccounts)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ID"); - openapiFields.add("name"); - openapiFields.add("fullName"); - openapiFields.add("created"); - openapiFields.add("updated"); - openapiFields.add("status"); - openapiFields.add("emails"); - openapiFields.add("phoneNumbers"); - openapiFields.add("usernames"); - openapiFields.add("socialAccounts"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("ID"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("fullName"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("emails"); - openapiRequiredFields.add("phoneNumbers"); - openapiRequiredFields.add("usernames"); - openapiRequiredFields.add("socialAccounts"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FullUser - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FullUser.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in FullUser is not found in the empty JSON string", FullUser.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FullUser.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FullUser` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FullUser.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("ID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("fullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - // validate the required field `status` - Status.validateJsonElement(jsonObj.get("status")); - // ensure the json data is an array - if (!jsonObj.get("emails").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `emails` to be an array in the JSON string but got `%s`", jsonObj.get("emails").toString())); - } - - JsonArray jsonArrayemails = jsonObj.getAsJsonArray("emails"); - // validate the required field `emails` (array) - for (int i = 0; i < jsonArrayemails.size(); i++) { - UserEmail.validateJsonElement(jsonArrayemails.get(i)); - }; - // ensure the json data is an array - if (!jsonObj.get("phoneNumbers").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `phoneNumbers` to be an array in the JSON string but got `%s`", jsonObj.get("phoneNumbers").toString())); - } - - JsonArray jsonArrayphoneNumbers = jsonObj.getAsJsonArray("phoneNumbers"); - // validate the required field `phoneNumbers` (array) - for (int i = 0; i < jsonArrayphoneNumbers.size(); i++) { - UserPhoneNumber.validateJsonElement(jsonArrayphoneNumbers.get(i)); - }; - // ensure the json data is an array - if (!jsonObj.get("usernames").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `usernames` to be an array in the JSON string but got `%s`", jsonObj.get("usernames").toString())); - } - - JsonArray jsonArrayusernames = jsonObj.getAsJsonArray("usernames"); - // validate the required field `usernames` (array) - for (int i = 0; i < jsonArrayusernames.size(); i++) { - UserUsername.validateJsonElement(jsonArrayusernames.get(i)); - }; - // ensure the json data is an array - if (!jsonObj.get("socialAccounts").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `socialAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("socialAccounts").toString())); - } - - JsonArray jsonArraysocialAccounts = jsonObj.getAsJsonArray("socialAccounts"); - // validate the required field `socialAccounts` (array) - for (int i = 0; i < jsonArraysocialAccounts.size(); i++) { - UserSocialAccount.validateJsonElement(jsonArraysocialAccounts.get(i)); - }; - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FullUser.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FullUser' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FullUser.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FullUser value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public FullUser read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FullUser given an JSON string - * - * @param jsonString JSON string - * @return An instance of FullUser - * @throws IOException if the JSON string is invalid with respect to FullUser - */ - public static FullUser fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FullUser.class); - } - - /** - * Convert an instance of FullUser to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/GenericRsp.java b/src/main/java/com/corbado/generated/model/GenericRsp.java index f475fe0..53508fc 100644 --- a/src/main/java/com/corbado/generated/model/GenericRsp.java +++ b/src/main/java/com/corbado/generated/model/GenericRsp.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -50,7 +50,7 @@ /** * GenericRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class GenericRsp { public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) @@ -76,12 +76,12 @@ public GenericRsp httpStatusCode(Integer httpStatusCode) { return this; } - /** + /** * HTTP status code of operation * minimum: 200 * maximum: 599 * @return httpStatusCode - **/ + */ @javax.annotation.Nonnull public Integer getHttpStatusCode() { return httpStatusCode; @@ -97,10 +97,10 @@ public GenericRsp message(String message) { return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nonnull public String getMessage() { return message; @@ -116,10 +116,10 @@ public GenericRsp requestData(RequestData requestData) { return this; } - /** + /** * Get requestData * @return requestData - **/ + */ @javax.annotation.Nonnull public RequestData getRequestData() { return requestData; @@ -135,10 +135,10 @@ public GenericRsp runtime(Float runtime) { return this; } - /** + /** * Runtime in seconds for this request * @return runtime - **/ + */ @javax.annotation.Nonnull public Float getRuntime() { return runtime; @@ -213,12 +213,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("runtime"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to GenericRsp - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GenericRsp + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!GenericRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -277,22 +277,22 @@ public GenericRsp read(JsonReader in) throws IOException { } } - /** - * Create an instance of GenericRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of GenericRsp - * @throws IOException if the JSON string is invalid with respect to GenericRsp - */ + /** + * Create an instance of GenericRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of GenericRsp + * @throws IOException if the JSON string is invalid with respect to GenericRsp + */ public static GenericRsp fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GenericRsp.class); } - /** - * Convert an instance of GenericRsp to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GenericRsp to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/com/corbado/generated/model/IOSAppConfigDeleteReq.java b/src/main/java/com/corbado/generated/model/IOSAppConfigDeleteReq.java deleted file mode 100644 index bc08fec..0000000 --- a/src/main/java/com/corbado/generated/model/IOSAppConfigDeleteReq.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * IOSAppConfigDeleteReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class IOSAppConfigDeleteReq { - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public IOSAppConfigDeleteReq() { - } - - public IOSAppConfigDeleteReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public IOSAppConfigDeleteReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IOSAppConfigDeleteReq iOSAppConfigDeleteReq = (IOSAppConfigDeleteReq) o; - return Objects.equals(this.requestID, iOSAppConfigDeleteReq.requestID) && - Objects.equals(this.clientInfo, iOSAppConfigDeleteReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IOSAppConfigDeleteReq {\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to IOSAppConfigDeleteReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IOSAppConfigDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IOSAppConfigDeleteReq is not found in the empty JSON string", IOSAppConfigDeleteReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IOSAppConfigDeleteReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IOSAppConfigDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IOSAppConfigDeleteReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IOSAppConfigDeleteReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IOSAppConfigDeleteReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IOSAppConfigDeleteReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IOSAppConfigDeleteReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of IOSAppConfigDeleteReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of IOSAppConfigDeleteReq - * @throws IOException if the JSON string is invalid with respect to IOSAppConfigDeleteReq - */ - public static IOSAppConfigDeleteReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IOSAppConfigDeleteReq.class); - } - - /** - * Convert an instance of IOSAppConfigDeleteReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/IOSAppConfigItem.java b/src/main/java/com/corbado/generated/model/IOSAppConfigItem.java deleted file mode 100644 index 33371a8..0000000 --- a/src/main/java/com/corbado/generated/model/IOSAppConfigItem.java +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * IOSAppConfigItem - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class IOSAppConfigItem { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; - @SerializedName(SERIALIZED_NAME_PROJECT_I_D) - private String projectID; - - public static final String SERIALIZED_NAME_APP_I_D_PREFIX = "appIDPrefix"; - @SerializedName(SERIALIZED_NAME_APP_I_D_PREFIX) - private String appIDPrefix; - - public static final String SERIALIZED_NAME_BUNDLE_I_D = "bundleID"; - @SerializedName(SERIALIZED_NAME_BUNDLE_I_D) - private String bundleID; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public IOSAppConfigItem() { - } - - public IOSAppConfigItem id(String id) { - this.id = id; - return this; - } - - /** - * ID of iOS app - * @return id - **/ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public IOSAppConfigItem projectID(String projectID) { - this.projectID = projectID; - return this; - } - - /** - * ID of project - * @return projectID - **/ - @javax.annotation.Nonnull - public String getProjectID() { - return projectID; - } - - public void setProjectID(String projectID) { - this.projectID = projectID; - } - - - public IOSAppConfigItem appIDPrefix(String appIDPrefix) { - this.appIDPrefix = appIDPrefix; - return this; - } - - /** - * Get appIDPrefix - * @return appIDPrefix - **/ - @javax.annotation.Nonnull - public String getAppIDPrefix() { - return appIDPrefix; - } - - public void setAppIDPrefix(String appIDPrefix) { - this.appIDPrefix = appIDPrefix; - } - - - public IOSAppConfigItem bundleID(String bundleID) { - this.bundleID = bundleID; - return this; - } - - /** - * Get bundleID - * @return bundleID - **/ - @javax.annotation.Nonnull - public String getBundleID() { - return bundleID; - } - - public void setBundleID(String bundleID) { - this.bundleID = bundleID; - } - - - public IOSAppConfigItem created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public IOSAppConfigItem updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IOSAppConfigItem iOSAppConfigItem = (IOSAppConfigItem) o; - return Objects.equals(this.id, iOSAppConfigItem.id) && - Objects.equals(this.projectID, iOSAppConfigItem.projectID) && - Objects.equals(this.appIDPrefix, iOSAppConfigItem.appIDPrefix) && - Objects.equals(this.bundleID, iOSAppConfigItem.bundleID) && - Objects.equals(this.created, iOSAppConfigItem.created) && - Objects.equals(this.updated, iOSAppConfigItem.updated); - } - - @Override - public int hashCode() { - return Objects.hash(id, projectID, appIDPrefix, bundleID, created, updated); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IOSAppConfigItem {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); - sb.append(" appIDPrefix: ").append(toIndentedString(appIDPrefix)).append("\n"); - sb.append(" bundleID: ").append(toIndentedString(bundleID)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("projectID"); - openapiFields.add("appIDPrefix"); - openapiFields.add("bundleID"); - openapiFields.add("created"); - openapiFields.add("updated"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("projectID"); - openapiRequiredFields.add("appIDPrefix"); - openapiRequiredFields.add("bundleID"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to IOSAppConfigItem - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IOSAppConfigItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IOSAppConfigItem is not found in the empty JSON string", IOSAppConfigItem.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IOSAppConfigItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IOSAppConfigItem` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IOSAppConfigItem.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("projectID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); - } - if (!jsonObj.get("appIDPrefix").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `appIDPrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appIDPrefix").toString())); - } - if (!jsonObj.get("bundleID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bundleID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bundleID").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IOSAppConfigItem.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IOSAppConfigItem' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IOSAppConfigItem.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IOSAppConfigItem value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IOSAppConfigItem read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of IOSAppConfigItem given an JSON string - * - * @param jsonString JSON string - * @return An instance of IOSAppConfigItem - * @throws IOException if the JSON string is invalid with respect to IOSAppConfigItem - */ - public static IOSAppConfigItem fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IOSAppConfigItem.class); - } - - /** - * Convert an instance of IOSAppConfigItem to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/IOSAppConfigListRsp.java b/src/main/java/com/corbado/generated/model/IOSAppConfigListRsp.java deleted file mode 100644 index 7aeea68..0000000 --- a/src/main/java/com/corbado/generated/model/IOSAppConfigListRsp.java +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.IOSAppConfigItem; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * IOSAppConfigListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class IOSAppConfigListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_ROWS = "rows"; - @SerializedName(SERIALIZED_NAME_ROWS) - private List rows = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public IOSAppConfigListRsp() { - } - - public IOSAppConfigListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public IOSAppConfigListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public IOSAppConfigListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public IOSAppConfigListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public IOSAppConfigListRsp rows(List rows) { - this.rows = rows; - return this; - } - - public IOSAppConfigListRsp addRowsItem(IOSAppConfigItem rowsItem) { - if (this.rows == null) { - this.rows = new ArrayList<>(); - } - this.rows.add(rowsItem); - return this; - } - - /** - * Get rows - * @return rows - **/ - @javax.annotation.Nonnull - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - - public IOSAppConfigListRsp paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IOSAppConfigListRsp iOSAppConfigListRsp = (IOSAppConfigListRsp) o; - return Objects.equals(this.httpStatusCode, iOSAppConfigListRsp.httpStatusCode) && - Objects.equals(this.message, iOSAppConfigListRsp.message) && - Objects.equals(this.requestData, iOSAppConfigListRsp.requestData) && - Objects.equals(this.runtime, iOSAppConfigListRsp.runtime) && - Objects.equals(this.rows, iOSAppConfigListRsp.rows) && - Objects.equals(this.paging, iOSAppConfigListRsp.paging); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, rows, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IOSAppConfigListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("rows"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("rows"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to IOSAppConfigListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IOSAppConfigListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IOSAppConfigListRsp is not found in the empty JSON string", IOSAppConfigListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IOSAppConfigListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IOSAppConfigListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IOSAppConfigListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // ensure the json data is an array - if (!jsonObj.get("rows").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rows` to be an array in the JSON string but got `%s`", jsonObj.get("rows").toString())); - } - - JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); - // validate the required field `rows` (array) - for (int i = 0; i < jsonArrayrows.size(); i++) { - IOSAppConfigItem.validateJsonElement(jsonArrayrows.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IOSAppConfigListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IOSAppConfigListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IOSAppConfigListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IOSAppConfigListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IOSAppConfigListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of IOSAppConfigListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of IOSAppConfigListRsp - * @throws IOException if the JSON string is invalid with respect to IOSAppConfigListRsp - */ - public static IOSAppConfigListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IOSAppConfigListRsp.class); - } - - /** - * Convert an instance of IOSAppConfigListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/IOSAppConfigSaveReq.java b/src/main/java/com/corbado/generated/model/IOSAppConfigSaveReq.java deleted file mode 100644 index 7c7a3ee..0000000 --- a/src/main/java/com/corbado/generated/model/IOSAppConfigSaveReq.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * IOSAppConfigSaveReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class IOSAppConfigSaveReq { - public static final String SERIALIZED_NAME_APP_I_D_PREFIX = "appIDPrefix"; - @SerializedName(SERIALIZED_NAME_APP_I_D_PREFIX) - private String appIDPrefix; - - public static final String SERIALIZED_NAME_BUNDLE_I_D = "bundleID"; - @SerializedName(SERIALIZED_NAME_BUNDLE_I_D) - private String bundleID; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public IOSAppConfigSaveReq() { - } - - public IOSAppConfigSaveReq appIDPrefix(String appIDPrefix) { - this.appIDPrefix = appIDPrefix; - return this; - } - - /** - * Get appIDPrefix - * @return appIDPrefix - **/ - @javax.annotation.Nonnull - public String getAppIDPrefix() { - return appIDPrefix; - } - - public void setAppIDPrefix(String appIDPrefix) { - this.appIDPrefix = appIDPrefix; - } - - - public IOSAppConfigSaveReq bundleID(String bundleID) { - this.bundleID = bundleID; - return this; - } - - /** - * Get bundleID - * @return bundleID - **/ - @javax.annotation.Nonnull - public String getBundleID() { - return bundleID; - } - - public void setBundleID(String bundleID) { - this.bundleID = bundleID; - } - - - public IOSAppConfigSaveReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public IOSAppConfigSaveReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IOSAppConfigSaveReq iOSAppConfigSaveReq = (IOSAppConfigSaveReq) o; - return Objects.equals(this.appIDPrefix, iOSAppConfigSaveReq.appIDPrefix) && - Objects.equals(this.bundleID, iOSAppConfigSaveReq.bundleID) && - Objects.equals(this.requestID, iOSAppConfigSaveReq.requestID) && - Objects.equals(this.clientInfo, iOSAppConfigSaveReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(appIDPrefix, bundleID, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IOSAppConfigSaveReq {\n"); - sb.append(" appIDPrefix: ").append(toIndentedString(appIDPrefix)).append("\n"); - sb.append(" bundleID: ").append(toIndentedString(bundleID)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("appIDPrefix"); - openapiFields.add("bundleID"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("appIDPrefix"); - openapiRequiredFields.add("bundleID"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to IOSAppConfigSaveReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IOSAppConfigSaveReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IOSAppConfigSaveReq is not found in the empty JSON string", IOSAppConfigSaveReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IOSAppConfigSaveReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IOSAppConfigSaveReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IOSAppConfigSaveReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("appIDPrefix").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `appIDPrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appIDPrefix").toString())); - } - if (!jsonObj.get("bundleID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bundleID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bundleID").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IOSAppConfigSaveReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IOSAppConfigSaveReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IOSAppConfigSaveReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IOSAppConfigSaveReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IOSAppConfigSaveReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of IOSAppConfigSaveReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of IOSAppConfigSaveReq - * @throws IOException if the JSON string is invalid with respect to IOSAppConfigSaveReq - */ - public static IOSAppConfigSaveReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IOSAppConfigSaveReq.class); - } - - /** - * Convert an instance of IOSAppConfigSaveReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/IOSAppConfigSaveRsp.java b/src/main/java/com/corbado/generated/model/IOSAppConfigSaveRsp.java deleted file mode 100644 index 7cb1fde..0000000 --- a/src/main/java/com/corbado/generated/model/IOSAppConfigSaveRsp.java +++ /dev/null @@ -1,480 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * IOSAppConfigSaveRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class IOSAppConfigSaveRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; - @SerializedName(SERIALIZED_NAME_PROJECT_I_D) - private String projectID; - - public static final String SERIALIZED_NAME_APP_I_D_PREFIX = "appIDPrefix"; - @SerializedName(SERIALIZED_NAME_APP_I_D_PREFIX) - private String appIDPrefix; - - public static final String SERIALIZED_NAME_BUNDLE_I_D = "bundleID"; - @SerializedName(SERIALIZED_NAME_BUNDLE_I_D) - private String bundleID; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public IOSAppConfigSaveRsp() { - } - - public IOSAppConfigSaveRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public IOSAppConfigSaveRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public IOSAppConfigSaveRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public IOSAppConfigSaveRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public IOSAppConfigSaveRsp id(String id) { - this.id = id; - return this; - } - - /** - * ID of iOS app - * @return id - **/ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public IOSAppConfigSaveRsp projectID(String projectID) { - this.projectID = projectID; - return this; - } - - /** - * ID of project - * @return projectID - **/ - @javax.annotation.Nonnull - public String getProjectID() { - return projectID; - } - - public void setProjectID(String projectID) { - this.projectID = projectID; - } - - - public IOSAppConfigSaveRsp appIDPrefix(String appIDPrefix) { - this.appIDPrefix = appIDPrefix; - return this; - } - - /** - * Get appIDPrefix - * @return appIDPrefix - **/ - @javax.annotation.Nonnull - public String getAppIDPrefix() { - return appIDPrefix; - } - - public void setAppIDPrefix(String appIDPrefix) { - this.appIDPrefix = appIDPrefix; - } - - - public IOSAppConfigSaveRsp bundleID(String bundleID) { - this.bundleID = bundleID; - return this; - } - - /** - * Get bundleID - * @return bundleID - **/ - @javax.annotation.Nonnull - public String getBundleID() { - return bundleID; - } - - public void setBundleID(String bundleID) { - this.bundleID = bundleID; - } - - - public IOSAppConfigSaveRsp created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public IOSAppConfigSaveRsp updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IOSAppConfigSaveRsp iOSAppConfigSaveRsp = (IOSAppConfigSaveRsp) o; - return Objects.equals(this.httpStatusCode, iOSAppConfigSaveRsp.httpStatusCode) && - Objects.equals(this.message, iOSAppConfigSaveRsp.message) && - Objects.equals(this.requestData, iOSAppConfigSaveRsp.requestData) && - Objects.equals(this.runtime, iOSAppConfigSaveRsp.runtime) && - Objects.equals(this.id, iOSAppConfigSaveRsp.id) && - Objects.equals(this.projectID, iOSAppConfigSaveRsp.projectID) && - Objects.equals(this.appIDPrefix, iOSAppConfigSaveRsp.appIDPrefix) && - Objects.equals(this.bundleID, iOSAppConfigSaveRsp.bundleID) && - Objects.equals(this.created, iOSAppConfigSaveRsp.created) && - Objects.equals(this.updated, iOSAppConfigSaveRsp.updated); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, id, projectID, appIDPrefix, bundleID, created, updated); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IOSAppConfigSaveRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); - sb.append(" appIDPrefix: ").append(toIndentedString(appIDPrefix)).append("\n"); - sb.append(" bundleID: ").append(toIndentedString(bundleID)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("id"); - openapiFields.add("projectID"); - openapiFields.add("appIDPrefix"); - openapiFields.add("bundleID"); - openapiFields.add("created"); - openapiFields.add("updated"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("projectID"); - openapiRequiredFields.add("appIDPrefix"); - openapiRequiredFields.add("bundleID"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to IOSAppConfigSaveRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IOSAppConfigSaveRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IOSAppConfigSaveRsp is not found in the empty JSON string", IOSAppConfigSaveRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IOSAppConfigSaveRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IOSAppConfigSaveRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IOSAppConfigSaveRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("projectID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); - } - if (!jsonObj.get("appIDPrefix").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `appIDPrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appIDPrefix").toString())); - } - if (!jsonObj.get("bundleID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bundleID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bundleID").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IOSAppConfigSaveRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IOSAppConfigSaveRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IOSAppConfigSaveRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IOSAppConfigSaveRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IOSAppConfigSaveRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of IOSAppConfigSaveRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of IOSAppConfigSaveRsp - * @throws IOException if the JSON string is invalid with respect to IOSAppConfigSaveRsp - */ - public static IOSAppConfigSaveRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IOSAppConfigSaveRsp.class); - } - - /** - * Convert an instance of IOSAppConfigSaveRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/IOSAppConfigUpdateReq.java b/src/main/java/com/corbado/generated/model/IOSAppConfigUpdateReq.java deleted file mode 100644 index 2c62d83..0000000 --- a/src/main/java/com/corbado/generated/model/IOSAppConfigUpdateReq.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * IOSAppConfigUpdateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class IOSAppConfigUpdateReq { - public static final String SERIALIZED_NAME_APP_I_D_PREFIX = "appIDPrefix"; - @SerializedName(SERIALIZED_NAME_APP_I_D_PREFIX) - private String appIDPrefix; - - public static final String SERIALIZED_NAME_BUNDLE_I_D = "bundleID"; - @SerializedName(SERIALIZED_NAME_BUNDLE_I_D) - private String bundleID; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public IOSAppConfigUpdateReq() { - } - - public IOSAppConfigUpdateReq appIDPrefix(String appIDPrefix) { - this.appIDPrefix = appIDPrefix; - return this; - } - - /** - * Get appIDPrefix - * @return appIDPrefix - **/ - @javax.annotation.Nonnull - public String getAppIDPrefix() { - return appIDPrefix; - } - - public void setAppIDPrefix(String appIDPrefix) { - this.appIDPrefix = appIDPrefix; - } - - - public IOSAppConfigUpdateReq bundleID(String bundleID) { - this.bundleID = bundleID; - return this; - } - - /** - * Get bundleID - * @return bundleID - **/ - @javax.annotation.Nonnull - public String getBundleID() { - return bundleID; - } - - public void setBundleID(String bundleID) { - this.bundleID = bundleID; - } - - - public IOSAppConfigUpdateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public IOSAppConfigUpdateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IOSAppConfigUpdateReq iOSAppConfigUpdateReq = (IOSAppConfigUpdateReq) o; - return Objects.equals(this.appIDPrefix, iOSAppConfigUpdateReq.appIDPrefix) && - Objects.equals(this.bundleID, iOSAppConfigUpdateReq.bundleID) && - Objects.equals(this.requestID, iOSAppConfigUpdateReq.requestID) && - Objects.equals(this.clientInfo, iOSAppConfigUpdateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(appIDPrefix, bundleID, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IOSAppConfigUpdateReq {\n"); - sb.append(" appIDPrefix: ").append(toIndentedString(appIDPrefix)).append("\n"); - sb.append(" bundleID: ").append(toIndentedString(bundleID)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("appIDPrefix"); - openapiFields.add("bundleID"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("appIDPrefix"); - openapiRequiredFields.add("bundleID"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to IOSAppConfigUpdateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IOSAppConfigUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IOSAppConfigUpdateReq is not found in the empty JSON string", IOSAppConfigUpdateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IOSAppConfigUpdateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IOSAppConfigUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IOSAppConfigUpdateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("appIDPrefix").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `appIDPrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appIDPrefix").toString())); - } - if (!jsonObj.get("bundleID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bundleID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bundleID").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IOSAppConfigUpdateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IOSAppConfigUpdateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IOSAppConfigUpdateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IOSAppConfigUpdateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IOSAppConfigUpdateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of IOSAppConfigUpdateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of IOSAppConfigUpdateReq - * @throws IOException if the JSON string is invalid with respect to IOSAppConfigUpdateReq - */ - public static IOSAppConfigUpdateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IOSAppConfigUpdateReq.class); - } - - /** - * Convert an instance of IOSAppConfigUpdateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/IOSAppConfigUpdateRsp.java b/src/main/java/com/corbado/generated/model/IOSAppConfigUpdateRsp.java deleted file mode 100644 index 03e404b..0000000 --- a/src/main/java/com/corbado/generated/model/IOSAppConfigUpdateRsp.java +++ /dev/null @@ -1,480 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * IOSAppConfigUpdateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class IOSAppConfigUpdateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; - @SerializedName(SERIALIZED_NAME_PROJECT_I_D) - private String projectID; - - public static final String SERIALIZED_NAME_APP_I_D_PREFIX = "appIDPrefix"; - @SerializedName(SERIALIZED_NAME_APP_I_D_PREFIX) - private String appIDPrefix; - - public static final String SERIALIZED_NAME_BUNDLE_I_D = "bundleID"; - @SerializedName(SERIALIZED_NAME_BUNDLE_I_D) - private String bundleID; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public IOSAppConfigUpdateRsp() { - } - - public IOSAppConfigUpdateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public IOSAppConfigUpdateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public IOSAppConfigUpdateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public IOSAppConfigUpdateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public IOSAppConfigUpdateRsp id(String id) { - this.id = id; - return this; - } - - /** - * ID of iOS app - * @return id - **/ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public IOSAppConfigUpdateRsp projectID(String projectID) { - this.projectID = projectID; - return this; - } - - /** - * ID of project - * @return projectID - **/ - @javax.annotation.Nonnull - public String getProjectID() { - return projectID; - } - - public void setProjectID(String projectID) { - this.projectID = projectID; - } - - - public IOSAppConfigUpdateRsp appIDPrefix(String appIDPrefix) { - this.appIDPrefix = appIDPrefix; - return this; - } - - /** - * Get appIDPrefix - * @return appIDPrefix - **/ - @javax.annotation.Nonnull - public String getAppIDPrefix() { - return appIDPrefix; - } - - public void setAppIDPrefix(String appIDPrefix) { - this.appIDPrefix = appIDPrefix; - } - - - public IOSAppConfigUpdateRsp bundleID(String bundleID) { - this.bundleID = bundleID; - return this; - } - - /** - * Get bundleID - * @return bundleID - **/ - @javax.annotation.Nonnull - public String getBundleID() { - return bundleID; - } - - public void setBundleID(String bundleID) { - this.bundleID = bundleID; - } - - - public IOSAppConfigUpdateRsp created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public IOSAppConfigUpdateRsp updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IOSAppConfigUpdateRsp iOSAppConfigUpdateRsp = (IOSAppConfigUpdateRsp) o; - return Objects.equals(this.httpStatusCode, iOSAppConfigUpdateRsp.httpStatusCode) && - Objects.equals(this.message, iOSAppConfigUpdateRsp.message) && - Objects.equals(this.requestData, iOSAppConfigUpdateRsp.requestData) && - Objects.equals(this.runtime, iOSAppConfigUpdateRsp.runtime) && - Objects.equals(this.id, iOSAppConfigUpdateRsp.id) && - Objects.equals(this.projectID, iOSAppConfigUpdateRsp.projectID) && - Objects.equals(this.appIDPrefix, iOSAppConfigUpdateRsp.appIDPrefix) && - Objects.equals(this.bundleID, iOSAppConfigUpdateRsp.bundleID) && - Objects.equals(this.created, iOSAppConfigUpdateRsp.created) && - Objects.equals(this.updated, iOSAppConfigUpdateRsp.updated); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, id, projectID, appIDPrefix, bundleID, created, updated); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IOSAppConfigUpdateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); - sb.append(" appIDPrefix: ").append(toIndentedString(appIDPrefix)).append("\n"); - sb.append(" bundleID: ").append(toIndentedString(bundleID)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("id"); - openapiFields.add("projectID"); - openapiFields.add("appIDPrefix"); - openapiFields.add("bundleID"); - openapiFields.add("created"); - openapiFields.add("updated"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("projectID"); - openapiRequiredFields.add("appIDPrefix"); - openapiRequiredFields.add("bundleID"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to IOSAppConfigUpdateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!IOSAppConfigUpdateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in IOSAppConfigUpdateRsp is not found in the empty JSON string", IOSAppConfigUpdateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!IOSAppConfigUpdateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IOSAppConfigUpdateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IOSAppConfigUpdateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("projectID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); - } - if (!jsonObj.get("appIDPrefix").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `appIDPrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appIDPrefix").toString())); - } - if (!jsonObj.get("bundleID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bundleID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bundleID").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!IOSAppConfigUpdateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'IOSAppConfigUpdateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(IOSAppConfigUpdateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, IOSAppConfigUpdateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public IOSAppConfigUpdateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of IOSAppConfigUpdateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of IOSAppConfigUpdateRsp - * @throws IOException if the JSON string is invalid with respect to IOSAppConfigUpdateRsp - */ - public static IOSAppConfigUpdateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, IOSAppConfigUpdateRsp.class); - } - - /** - * Convert an instance of IOSAppConfigUpdateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/Identifier.java b/src/main/java/com/corbado/generated/model/Identifier.java new file mode 100644 index 0000000..38c1f0c --- /dev/null +++ b/src/main/java/com/corbado/generated/model/Identifier.java @@ -0,0 +1,334 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.IdentifierStatus; +import com.corbado.generated.model.IdentifierType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * Identifier + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class Identifier { + public static final String SERIALIZED_NAME_IDENTIFIER_I_D = "identifierID"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER_I_D) + private String identifierID; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private IdentifierType type; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private IdentifierStatus status; + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public Identifier() { + } + + public Identifier identifierID(String identifierID) { + this.identifierID = identifierID; + return this; + } + + /** + * Get identifierID + * @return identifierID + */ + @javax.annotation.Nonnull + public String getIdentifierID() { + return identifierID; + } + + public void setIdentifierID(String identifierID) { + this.identifierID = identifierID; + } + + + public Identifier type(IdentifierType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public IdentifierType getType() { + return type; + } + + public void setType(IdentifierType type) { + this.type = type; + } + + + public Identifier value(String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + public Identifier status(IdentifierStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public IdentifierStatus getStatus() { + return status; + } + + public void setStatus(IdentifierStatus status) { + this.status = status; + } + + + public Identifier userID(String userID) { + this.userID = userID; + return this; + } + + /** + * Get userID + * @return userID + */ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Identifier identifier = (Identifier) o; + return Objects.equals(this.identifierID, identifier.identifierID) && + Objects.equals(this.type, identifier.type) && + Objects.equals(this.value, identifier.value) && + Objects.equals(this.status, identifier.status) && + Objects.equals(this.userID, identifier.userID); + } + + @Override + public int hashCode() { + return Objects.hash(identifierID, type, value, status, userID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Identifier {\n"); + sb.append(" identifierID: ").append(toIndentedString(identifierID)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("identifierID"); + openapiFields.add("type"); + openapiFields.add("value"); + openapiFields.add("status"); + openapiFields.add("userID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("identifierID"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("value"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("userID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Identifier + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Identifier.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Identifier is not found in the empty JSON string", Identifier.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Identifier.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Identifier` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Identifier.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("identifierID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identifierID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifierID").toString())); + } + // validate the required field `type` + IdentifierType.validateJsonElement(jsonObj.get("type")); + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + // validate the required field `status` + IdentifierStatus.validateJsonElement(jsonObj.get("status")); + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Identifier.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Identifier' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Identifier.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Identifier value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Identifier read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Identifier given an JSON string + * + * @param jsonString JSON string + * @return An instance of Identifier + * @throws IOException if the JSON string is invalid with respect to Identifier + */ + public static Identifier fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Identifier.class); + } + + /** + * Convert an instance of Identifier to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/IdentifierCreateReq.java b/src/main/java/com/corbado/generated/model/IdentifierCreateReq.java new file mode 100644 index 0000000..7b77233 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/IdentifierCreateReq.java @@ -0,0 +1,274 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.IdentifierStatus; +import com.corbado.generated.model.IdentifierType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * IdentifierCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class IdentifierCreateReq { + public static final String SERIALIZED_NAME_IDENTIFIER_TYPE = "identifierType"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER_TYPE) + private IdentifierType identifierType; + + public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) + private String identifierValue; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private IdentifierStatus status; + + public IdentifierCreateReq() { + } + + public IdentifierCreateReq identifierType(IdentifierType identifierType) { + this.identifierType = identifierType; + return this; + } + + /** + * Get identifierType + * @return identifierType + */ + @javax.annotation.Nonnull + public IdentifierType getIdentifierType() { + return identifierType; + } + + public void setIdentifierType(IdentifierType identifierType) { + this.identifierType = identifierType; + } + + + public IdentifierCreateReq identifierValue(String identifierValue) { + this.identifierValue = identifierValue; + return this; + } + + /** + * Get identifierValue + * @return identifierValue + */ + @javax.annotation.Nonnull + public String getIdentifierValue() { + return identifierValue; + } + + public void setIdentifierValue(String identifierValue) { + this.identifierValue = identifierValue; + } + + + public IdentifierCreateReq status(IdentifierStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public IdentifierStatus getStatus() { + return status; + } + + public void setStatus(IdentifierStatus status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IdentifierCreateReq identifierCreateReq = (IdentifierCreateReq) o; + return Objects.equals(this.identifierType, identifierCreateReq.identifierType) && + Objects.equals(this.identifierValue, identifierCreateReq.identifierValue) && + Objects.equals(this.status, identifierCreateReq.status); + } + + @Override + public int hashCode() { + return Objects.hash(identifierType, identifierValue, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IdentifierCreateReq {\n"); + sb.append(" identifierType: ").append(toIndentedString(identifierType)).append("\n"); + sb.append(" identifierValue: ").append(toIndentedString(identifierValue)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("identifierType"); + openapiFields.add("identifierValue"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("identifierType"); + openapiRequiredFields.add("identifierValue"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IdentifierCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IdentifierCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IdentifierCreateReq is not found in the empty JSON string", IdentifierCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IdentifierCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IdentifierCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IdentifierCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `identifierType` + IdentifierType.validateJsonElement(jsonObj.get("identifierType")); + if (!jsonObj.get("identifierValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identifierValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifierValue").toString())); + } + // validate the required field `status` + IdentifierStatus.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IdentifierCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IdentifierCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IdentifierCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IdentifierCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IdentifierCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IdentifierCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of IdentifierCreateReq + * @throws IOException if the JSON string is invalid with respect to IdentifierCreateReq + */ + public static IdentifierCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IdentifierCreateReq.class); + } + + /** + * Convert an instance of IdentifierCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/IdentifierList.java b/src/main/java/com/corbado/generated/model/IdentifierList.java new file mode 100644 index 0000000..19f8c24 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/IdentifierList.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Identifier; +import com.corbado.generated.model.Paging; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * IdentifierList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class IdentifierList { + public static final String SERIALIZED_NAME_IDENTIFIERS = "identifiers"; + @SerializedName(SERIALIZED_NAME_IDENTIFIERS) + private List identifiers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public IdentifierList() { + } + + public IdentifierList identifiers(List identifiers) { + this.identifiers = identifiers; + return this; + } + + public IdentifierList addIdentifiersItem(Identifier identifiersItem) { + if (this.identifiers == null) { + this.identifiers = new ArrayList<>(); + } + this.identifiers.add(identifiersItem); + return this; + } + + /** + * Get identifiers + * @return identifiers + */ + @javax.annotation.Nonnull + public List getIdentifiers() { + return identifiers; + } + + public void setIdentifiers(List identifiers) { + this.identifiers = identifiers; + } + + + public IdentifierList paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + */ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IdentifierList identifierList = (IdentifierList) o; + return Objects.equals(this.identifiers, identifierList.identifiers) && + Objects.equals(this.paging, identifierList.paging); + } + + @Override + public int hashCode() { + return Objects.hash(identifiers, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IdentifierList {\n"); + sb.append(" identifiers: ").append(toIndentedString(identifiers)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("identifiers"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("identifiers"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IdentifierList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IdentifierList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IdentifierList is not found in the empty JSON string", IdentifierList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IdentifierList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IdentifierList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IdentifierList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("identifiers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `identifiers` to be an array in the JSON string but got `%s`", jsonObj.get("identifiers").toString())); + } + + JsonArray jsonArrayidentifiers = jsonObj.getAsJsonArray("identifiers"); + // validate the required field `identifiers` (array) + for (int i = 0; i < jsonArrayidentifiers.size(); i++) { + Identifier.validateJsonElement(jsonArrayidentifiers.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IdentifierList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IdentifierList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IdentifierList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IdentifierList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IdentifierList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IdentifierList given an JSON string + * + * @param jsonString JSON string + * @return An instance of IdentifierList + * @throws IOException if the JSON string is invalid with respect to IdentifierList + */ + public static IdentifierList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IdentifierList.class); + } + + /** + * Convert an instance of IdentifierList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/IdentifierStatus.java b/src/main/java/com/corbado/generated/model/IdentifierStatus.java new file mode 100644 index 0000000..86596d5 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/IdentifierStatus.java @@ -0,0 +1,80 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets identifierStatus + */ +@JsonAdapter(IdentifierStatus.Adapter.class) +public enum IdentifierStatus { + + PENDING("pending"), + + PRIMARY("primary"), + + VERIFIED("verified"); + + private String value; + + IdentifierStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IdentifierStatus fromValue(String value) { + for (IdentifierStatus b : IdentifierStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final IdentifierStatus enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IdentifierStatus read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IdentifierStatus.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + IdentifierStatus.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/IdentifierType.java b/src/main/java/com/corbado/generated/model/IdentifierType.java new file mode 100644 index 0000000..0f7e3d0 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/IdentifierType.java @@ -0,0 +1,80 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets identifierType + */ +@JsonAdapter(IdentifierType.Adapter.class) +public enum IdentifierType { + + EMAIL("email"), + + PHONE("phone"), + + USERNAME("username"); + + private String value; + + IdentifierType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IdentifierType fromValue(String value) { + for (IdentifierType b : IdentifierType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final IdentifierType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IdentifierType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IdentifierType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + IdentifierType.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java b/src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java new file mode 100644 index 0000000..2d07537 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.IdentifierStatus; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * IdentifierUpdateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class IdentifierUpdateReq { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private IdentifierStatus status; + + public IdentifierUpdateReq() { + } + + public IdentifierUpdateReq status(IdentifierStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public IdentifierStatus getStatus() { + return status; + } + + public void setStatus(IdentifierStatus status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IdentifierUpdateReq identifierUpdateReq = (IdentifierUpdateReq) o; + return Objects.equals(this.status, identifierUpdateReq.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IdentifierUpdateReq {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IdentifierUpdateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IdentifierUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IdentifierUpdateReq is not found in the empty JSON string", IdentifierUpdateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IdentifierUpdateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IdentifierUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IdentifierUpdateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `status` + IdentifierStatus.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IdentifierUpdateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IdentifierUpdateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IdentifierUpdateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IdentifierUpdateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IdentifierUpdateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IdentifierUpdateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of IdentifierUpdateReq + * @throws IOException if the JSON string is invalid with respect to IdentifierUpdateReq + */ + public static IdentifierUpdateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IdentifierUpdateReq.class); + } + + /** + * Convert an instance of IdentifierUpdateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java b/src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java new file mode 100644 index 0000000..0b6eba3 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java @@ -0,0 +1,271 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * JavaScriptHighEntropy + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class JavaScriptHighEntropy { + public static final String SERIALIZED_NAME_PLATFORM = "platform"; + @SerializedName(SERIALIZED_NAME_PLATFORM) + private String platform; + + public static final String SERIALIZED_NAME_PLATFORM_VERSION = "platformVersion"; + @SerializedName(SERIALIZED_NAME_PLATFORM_VERSION) + private String platformVersion; + + public static final String SERIALIZED_NAME_MOBILE = "mobile"; + @SerializedName(SERIALIZED_NAME_MOBILE) + private Boolean mobile; + + public JavaScriptHighEntropy() { + } + + public JavaScriptHighEntropy platform(String platform) { + this.platform = platform; + return this; + } + + /** + * Get platform + * @return platform + */ + @javax.annotation.Nonnull + public String getPlatform() { + return platform; + } + + public void setPlatform(String platform) { + this.platform = platform; + } + + + public JavaScriptHighEntropy platformVersion(String platformVersion) { + this.platformVersion = platformVersion; + return this; + } + + /** + * Get platformVersion + * @return platformVersion + */ + @javax.annotation.Nonnull + public String getPlatformVersion() { + return platformVersion; + } + + public void setPlatformVersion(String platformVersion) { + this.platformVersion = platformVersion; + } + + + public JavaScriptHighEntropy mobile(Boolean mobile) { + this.mobile = mobile; + return this; + } + + /** + * Get mobile + * @return mobile + */ + @javax.annotation.Nonnull + public Boolean getMobile() { + return mobile; + } + + public void setMobile(Boolean mobile) { + this.mobile = mobile; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JavaScriptHighEntropy javaScriptHighEntropy = (JavaScriptHighEntropy) o; + return Objects.equals(this.platform, javaScriptHighEntropy.platform) && + Objects.equals(this.platformVersion, javaScriptHighEntropy.platformVersion) && + Objects.equals(this.mobile, javaScriptHighEntropy.mobile); + } + + @Override + public int hashCode() { + return Objects.hash(platform, platformVersion, mobile); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JavaScriptHighEntropy {\n"); + sb.append(" platform: ").append(toIndentedString(platform)).append("\n"); + sb.append(" platformVersion: ").append(toIndentedString(platformVersion)).append("\n"); + sb.append(" mobile: ").append(toIndentedString(mobile)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("platform"); + openapiFields.add("platformVersion"); + openapiFields.add("mobile"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("platform"); + openapiRequiredFields.add("platformVersion"); + openapiRequiredFields.add("mobile"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to JavaScriptHighEntropy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JavaScriptHighEntropy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JavaScriptHighEntropy is not found in the empty JSON string", JavaScriptHighEntropy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!JavaScriptHighEntropy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JavaScriptHighEntropy` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JavaScriptHighEntropy.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("platform").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `platform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("platform").toString())); + } + if (!jsonObj.get("platformVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `platformVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("platformVersion").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JavaScriptHighEntropy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JavaScriptHighEntropy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JavaScriptHighEntropy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JavaScriptHighEntropy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JavaScriptHighEntropy read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JavaScriptHighEntropy given an JSON string + * + * @param jsonString JSON string + * @return An instance of JavaScriptHighEntropy + * @throws IOException if the JSON string is invalid with respect to JavaScriptHighEntropy + */ + public static JavaScriptHighEntropy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JavaScriptHighEntropy.class); + } + + /** + * Convert an instance of JavaScriptHighEntropy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/LoginIdentifierType.java b/src/main/java/com/corbado/generated/model/LoginIdentifierType.java deleted file mode 100644 index fb2bdf3..0000000 --- a/src/main/java/com/corbado/generated/model/LoginIdentifierType.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Login Identifier type - */ -@JsonAdapter(LoginIdentifierType.Adapter.class) -public enum LoginIdentifierType { - - EMAIL("email"), - - PHONE_NUMBER("phone_number"), - - CUSTOM("custom"); - - private String value; - - LoginIdentifierType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LoginIdentifierType fromValue(String value) { - for (LoginIdentifierType b : LoginIdentifierType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LoginIdentifierType enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LoginIdentifierType read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LoginIdentifierType.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - LoginIdentifierType.fromValue(value); - } -} - diff --git a/src/main/java/com/corbado/generated/model/LongSession.java b/src/main/java/com/corbado/generated/model/LongSession.java index 8c404cc..6a6915d 100644 --- a/src/main/java/com/corbado/generated/model/LongSession.java +++ b/src/main/java/com/corbado/generated/model/LongSession.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,6 +14,7 @@ package com.corbado.generated.model; import java.util.Objects; +import com.corbado.generated.model.LongSessionStatus; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -49,121 +50,47 @@ /** * LongSession */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class LongSession { - public static final String SERIALIZED_NAME_I_D = "ID"; - @SerializedName(SERIALIZED_NAME_I_D) - private String ID; + public static final String SERIALIZED_NAME_LONG_SESSION_I_D = "longSessionID"; + @SerializedName(SERIALIZED_NAME_LONG_SESSION_I_D) + private String longSessionID; public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) private String userID; - public static final String SERIALIZED_NAME_USER_IDENTIFIER = "userIdentifier"; - @SerializedName(SERIALIZED_NAME_USER_IDENTIFIER) - private String userIdentifier; + public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) + private String identifierValue; - public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; - @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) - private String userFullName; + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private LongSessionStatus status; public static final String SERIALIZED_NAME_EXPIRES = "expires"; @SerializedName(SERIALIZED_NAME_EXPIRES) private String expires; - public static final String SERIALIZED_NAME_LAST_ACTION = "lastAction"; - @SerializedName(SERIALIZED_NAME_LAST_ACTION) - private String lastAction; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - /** - * status values of a long session - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - ACTIVE("active"), - - LOGGED_OUT("logged_out"), - - EXPIRED("expired"), - - INACTIVITY_REACHED("inactivity_reached"), - - REVOKED("revoked"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StatusEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - public LongSession() { } - public LongSession ID(String ID) { - this.ID = ID; + public LongSession longSessionID(String longSessionID) { + this.longSessionID = longSessionID; return this; } - /** - * Get ID - * @return ID - **/ + /** + * Get longSessionID + * @return longSessionID + */ @javax.annotation.Nonnull - public String getID() { - return ID; + public String getLongSessionID() { + return longSessionID; } - public void setID(String ID) { - this.ID = ID; + public void setLongSessionID(String longSessionID) { + this.longSessionID = longSessionID; } @@ -172,10 +99,10 @@ public LongSession userID(String userID) { return this; } - /** - * ID of the user + /** + * Get userID * @return userID - **/ + */ @javax.annotation.Nonnull public String getUserID() { return userID; @@ -186,41 +113,41 @@ public void setUserID(String userID) { } - public LongSession userIdentifier(String userIdentifier) { - this.userIdentifier = userIdentifier; + public LongSession identifierValue(String identifierValue) { + this.identifierValue = identifierValue; return this; } - /** - * Get userIdentifier - * @return userIdentifier - **/ + /** + * Get identifierValue + * @return identifierValue + */ @javax.annotation.Nonnull - public String getUserIdentifier() { - return userIdentifier; + public String getIdentifierValue() { + return identifierValue; } - public void setUserIdentifier(String userIdentifier) { - this.userIdentifier = userIdentifier; + public void setIdentifierValue(String identifierValue) { + this.identifierValue = identifierValue; } - public LongSession userFullName(String userFullName) { - this.userFullName = userFullName; + public LongSession status(LongSessionStatus status) { + this.status = status; return this; } - /** - * Get userFullName - * @return userFullName - **/ + /** + * Get status + * @return status + */ @javax.annotation.Nonnull - public String getUserFullName() { - return userFullName; + public LongSessionStatus getStatus() { + return status; } - public void setUserFullName(String userFullName) { - this.userFullName = userFullName; + public void setStatus(LongSessionStatus status) { + this.status = status; } @@ -229,10 +156,10 @@ public LongSession expires(String expires) { return this; } - /** - * Timestamp of when long session expires in yyyy-MM-dd'T'HH:mm:ss format + /** + * Get expires * @return expires - **/ + */ @javax.annotation.Nonnull public String getExpires() { return expires; @@ -243,82 +170,6 @@ public void setExpires(String expires) { } - public LongSession lastAction(String lastAction) { - this.lastAction = lastAction; - return this; - } - - /** - * Timestamp of when last action was done on long session in yyyy-MM-dd'T'HH:mm:ss format - * @return lastAction - **/ - @javax.annotation.Nonnull - public String getLastAction() { - return lastAction; - } - - public void setLastAction(String lastAction) { - this.lastAction = lastAction; - } - - - public LongSession created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public LongSession updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - public LongSession status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * status values of a long session - * @return status - **/ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override public boolean equals(Object o) { @@ -329,35 +180,27 @@ public boolean equals(Object o) { return false; } LongSession longSession = (LongSession) o; - return Objects.equals(this.ID, longSession.ID) && + return Objects.equals(this.longSessionID, longSession.longSessionID) && Objects.equals(this.userID, longSession.userID) && - Objects.equals(this.userIdentifier, longSession.userIdentifier) && - Objects.equals(this.userFullName, longSession.userFullName) && - Objects.equals(this.expires, longSession.expires) && - Objects.equals(this.lastAction, longSession.lastAction) && - Objects.equals(this.created, longSession.created) && - Objects.equals(this.updated, longSession.updated) && - Objects.equals(this.status, longSession.status); + Objects.equals(this.identifierValue, longSession.identifierValue) && + Objects.equals(this.status, longSession.status) && + Objects.equals(this.expires, longSession.expires); } @Override public int hashCode() { - return Objects.hash(ID, userID, userIdentifier, userFullName, expires, lastAction, created, updated, status); + return Objects.hash(longSessionID, userID, identifierValue, status, expires); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class LongSession {\n"); - sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" longSessionID: ").append(toIndentedString(longSessionID)).append("\n"); sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb.append(" userIdentifier: ").append(toIndentedString(userIdentifier)).append("\n"); - sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); - sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); - sb.append(" lastAction: ").append(toIndentedString(lastAction)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); + sb.append(" identifierValue: ").append(toIndentedString(identifierValue)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); sb.append("}"); return sb.toString(); } @@ -380,35 +223,27 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("ID"); + openapiFields.add("longSessionID"); openapiFields.add("userID"); - openapiFields.add("userIdentifier"); - openapiFields.add("userFullName"); - openapiFields.add("expires"); - openapiFields.add("lastAction"); - openapiFields.add("created"); - openapiFields.add("updated"); + openapiFields.add("identifierValue"); openapiFields.add("status"); + openapiFields.add("expires"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("ID"); + openapiRequiredFields.add("longSessionID"); openapiRequiredFields.add("userID"); - openapiRequiredFields.add("userIdentifier"); - openapiRequiredFields.add("userFullName"); - openapiRequiredFields.add("expires"); - openapiRequiredFields.add("lastAction"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); + openapiRequiredFields.add("identifierValue"); openapiRequiredFields.add("status"); + openapiRequiredFields.add("expires"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to LongSession - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to LongSession + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!LongSession.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -431,35 +266,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("ID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); + if (!jsonObj.get("longSessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `longSessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("longSessionID").toString())); } if (!jsonObj.get("userID").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); } - if (!jsonObj.get("userIdentifier").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userIdentifier").toString())); - } - if (!jsonObj.get("userFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); + if (!jsonObj.get("identifierValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identifierValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifierValue").toString())); } + // validate the required field `status` + LongSessionStatus.validateJsonElement(jsonObj.get("status")); if (!jsonObj.get("expires").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `expires` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expires").toString())); } - if (!jsonObj.get("lastAction").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastAction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastAction").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // validate the required field `status` - StatusEnum.validateJsonElement(jsonObj.get("status")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -491,22 +311,22 @@ public LongSession read(JsonReader in) throws IOException { } } - /** - * Create an instance of LongSession given an JSON string - * - * @param jsonString JSON string - * @return An instance of LongSession - * @throws IOException if the JSON string is invalid with respect to LongSession - */ + /** + * Create an instance of LongSession given an JSON string + * + * @param jsonString JSON string + * @return An instance of LongSession + * @throws IOException if the JSON string is invalid with respect to LongSession + */ public static LongSession fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, LongSession.class); } - /** - * Convert an instance of LongSession to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of LongSession to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/com/corbado/generated/model/LongSessionCreateReq.java b/src/main/java/com/corbado/generated/model/LongSessionCreateReq.java new file mode 100644 index 0000000..ef0ddbc --- /dev/null +++ b/src/main/java/com/corbado/generated/model/LongSessionCreateReq.java @@ -0,0 +1,244 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.AppType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * LongSessionCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class LongSessionCreateReq { + public static final String SERIALIZED_NAME_APP_TYPE = "appType"; + @SerializedName(SERIALIZED_NAME_APP_TYPE) + private AppType appType; + + public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) + private String identifierValue; + + public LongSessionCreateReq() { + } + + public LongSessionCreateReq appType(AppType appType) { + this.appType = appType; + return this; + } + + /** + * Get appType + * @return appType + */ + @javax.annotation.Nonnull + public AppType getAppType() { + return appType; + } + + public void setAppType(AppType appType) { + this.appType = appType; + } + + + public LongSessionCreateReq identifierValue(String identifierValue) { + this.identifierValue = identifierValue; + return this; + } + + /** + * Get identifierValue + * @return identifierValue + */ + @javax.annotation.Nonnull + public String getIdentifierValue() { + return identifierValue; + } + + public void setIdentifierValue(String identifierValue) { + this.identifierValue = identifierValue; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LongSessionCreateReq longSessionCreateReq = (LongSessionCreateReq) o; + return Objects.equals(this.appType, longSessionCreateReq.appType) && + Objects.equals(this.identifierValue, longSessionCreateReq.identifierValue); + } + + @Override + public int hashCode() { + return Objects.hash(appType, identifierValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LongSessionCreateReq {\n"); + sb.append(" appType: ").append(toIndentedString(appType)).append("\n"); + sb.append(" identifierValue: ").append(toIndentedString(identifierValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("appType"); + openapiFields.add("identifierValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("appType"); + openapiRequiredFields.add("identifierValue"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to LongSessionCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LongSessionCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LongSessionCreateReq is not found in the empty JSON string", LongSessionCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!LongSessionCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSessionCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LongSessionCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `appType` + AppType.validateJsonElement(jsonObj.get("appType")); + if (!jsonObj.get("identifierValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identifierValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifierValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LongSessionCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LongSessionCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LongSessionCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LongSessionCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LongSessionCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LongSessionCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of LongSessionCreateReq + * @throws IOException if the JSON string is invalid with respect to LongSessionCreateReq + */ + public static LongSessionCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LongSessionCreateReq.class); + } + + /** + * Convert an instance of LongSessionCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/LongSessionGetRsp.java b/src/main/java/com/corbado/generated/model/LongSessionGetRsp.java deleted file mode 100644 index b88377d..0000000 --- a/src/main/java/com/corbado/generated/model/LongSessionGetRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.LongSessionGetRspAllOfData; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * LongSessionGetRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class LongSessionGetRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private LongSessionGetRspAllOfData data; - - public LongSessionGetRsp() { - } - - public LongSessionGetRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public LongSessionGetRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public LongSessionGetRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public LongSessionGetRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public LongSessionGetRsp data(LongSessionGetRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public LongSessionGetRspAllOfData getData() { - return data; - } - - public void setData(LongSessionGetRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LongSessionGetRsp longSessionGetRsp = (LongSessionGetRsp) o; - return Objects.equals(this.httpStatusCode, longSessionGetRsp.httpStatusCode) && - Objects.equals(this.message, longSessionGetRsp.message) && - Objects.equals(this.requestData, longSessionGetRsp.requestData) && - Objects.equals(this.runtime, longSessionGetRsp.runtime) && - Objects.equals(this.data, longSessionGetRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class LongSessionGetRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to LongSessionGetRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!LongSessionGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in LongSessionGetRsp is not found in the empty JSON string", LongSessionGetRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!LongSessionGetRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSessionGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : LongSessionGetRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - LongSessionGetRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!LongSessionGetRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'LongSessionGetRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(LongSessionGetRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, LongSessionGetRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public LongSessionGetRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of LongSessionGetRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of LongSessionGetRsp - * @throws IOException if the JSON string is invalid with respect to LongSessionGetRsp - */ - public static LongSessionGetRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, LongSessionGetRsp.class); - } - - /** - * Convert an instance of LongSessionGetRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/LongSessionGetRspAllOfData.java b/src/main/java/com/corbado/generated/model/LongSessionGetRspAllOfData.java deleted file mode 100644 index 5b3bcef..0000000 --- a/src/main/java/com/corbado/generated/model/LongSessionGetRspAllOfData.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.LongSession; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * LongSessionGetRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class LongSessionGetRspAllOfData { - public static final String SERIALIZED_NAME_LONG_SESSION = "longSession"; - @SerializedName(SERIALIZED_NAME_LONG_SESSION) - private LongSession longSession; - - public LongSessionGetRspAllOfData() { - } - - public LongSessionGetRspAllOfData longSession(LongSession longSession) { - this.longSession = longSession; - return this; - } - - /** - * Get longSession - * @return longSession - **/ - @javax.annotation.Nonnull - public LongSession getLongSession() { - return longSession; - } - - public void setLongSession(LongSession longSession) { - this.longSession = longSession; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LongSessionGetRspAllOfData longSessionGetRspAllOfData = (LongSessionGetRspAllOfData) o; - return Objects.equals(this.longSession, longSessionGetRspAllOfData.longSession); - } - - @Override - public int hashCode() { - return Objects.hash(longSession); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class LongSessionGetRspAllOfData {\n"); - sb.append(" longSession: ").append(toIndentedString(longSession)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("longSession"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("longSession"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to LongSessionGetRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!LongSessionGetRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in LongSessionGetRspAllOfData is not found in the empty JSON string", LongSessionGetRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!LongSessionGetRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSessionGetRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : LongSessionGetRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `longSession` - LongSession.validateJsonElement(jsonObj.get("longSession")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!LongSessionGetRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'LongSessionGetRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(LongSessionGetRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, LongSessionGetRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public LongSessionGetRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of LongSessionGetRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of LongSessionGetRspAllOfData - * @throws IOException if the JSON string is invalid with respect to LongSessionGetRspAllOfData - */ - public static LongSessionGetRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, LongSessionGetRspAllOfData.class); - } - - /** - * Convert an instance of LongSessionGetRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/LongSessionListRsp.java b/src/main/java/com/corbado/generated/model/LongSessionListRsp.java deleted file mode 100644 index 0d97a17..0000000 --- a/src/main/java/com/corbado/generated/model/LongSessionListRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.LongSessionListRspAllOfData; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * LongSessionListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class LongSessionListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private LongSessionListRspAllOfData data; - - public LongSessionListRsp() { - } - - public LongSessionListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public LongSessionListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public LongSessionListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public LongSessionListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public LongSessionListRsp data(LongSessionListRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public LongSessionListRspAllOfData getData() { - return data; - } - - public void setData(LongSessionListRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LongSessionListRsp longSessionListRsp = (LongSessionListRsp) o; - return Objects.equals(this.httpStatusCode, longSessionListRsp.httpStatusCode) && - Objects.equals(this.message, longSessionListRsp.message) && - Objects.equals(this.requestData, longSessionListRsp.requestData) && - Objects.equals(this.runtime, longSessionListRsp.runtime) && - Objects.equals(this.data, longSessionListRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class LongSessionListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to LongSessionListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!LongSessionListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in LongSessionListRsp is not found in the empty JSON string", LongSessionListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!LongSessionListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSessionListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : LongSessionListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - LongSessionListRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!LongSessionListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'LongSessionListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(LongSessionListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, LongSessionListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public LongSessionListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of LongSessionListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of LongSessionListRsp - * @throws IOException if the JSON string is invalid with respect to LongSessionListRsp - */ - public static LongSessionListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, LongSessionListRsp.class); - } - - /** - * Convert an instance of LongSessionListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/LongSessionListRspAllOfData.java b/src/main/java/com/corbado/generated/model/LongSessionListRspAllOfData.java deleted file mode 100644 index 71b98fa..0000000 --- a/src/main/java/com/corbado/generated/model/LongSessionListRspAllOfData.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.LongSession; -import com.corbado.generated.model.Paging; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * LongSessionListRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class LongSessionListRspAllOfData { - public static final String SERIALIZED_NAME_LONG_SESSIONS = "longSessions"; - @SerializedName(SERIALIZED_NAME_LONG_SESSIONS) - private List longSessions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public LongSessionListRspAllOfData() { - } - - public LongSessionListRspAllOfData longSessions(List longSessions) { - this.longSessions = longSessions; - return this; - } - - public LongSessionListRspAllOfData addLongSessionsItem(LongSession longSessionsItem) { - if (this.longSessions == null) { - this.longSessions = new ArrayList<>(); - } - this.longSessions.add(longSessionsItem); - return this; - } - - /** - * Get longSessions - * @return longSessions - **/ - @javax.annotation.Nonnull - public List getLongSessions() { - return longSessions; - } - - public void setLongSessions(List longSessions) { - this.longSessions = longSessions; - } - - - public LongSessionListRspAllOfData paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LongSessionListRspAllOfData longSessionListRspAllOfData = (LongSessionListRspAllOfData) o; - return Objects.equals(this.longSessions, longSessionListRspAllOfData.longSessions) && - Objects.equals(this.paging, longSessionListRspAllOfData.paging); - } - - @Override - public int hashCode() { - return Objects.hash(longSessions, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class LongSessionListRspAllOfData {\n"); - sb.append(" longSessions: ").append(toIndentedString(longSessions)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("longSessions"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("longSessions"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to LongSessionListRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!LongSessionListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in LongSessionListRspAllOfData is not found in the empty JSON string", LongSessionListRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!LongSessionListRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSessionListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : LongSessionListRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("longSessions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `longSessions` to be an array in the JSON string but got `%s`", jsonObj.get("longSessions").toString())); - } - - JsonArray jsonArraylongSessions = jsonObj.getAsJsonArray("longSessions"); - // validate the required field `longSessions` (array) - for (int i = 0; i < jsonArraylongSessions.size(); i++) { - LongSession.validateJsonElement(jsonArraylongSessions.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!LongSessionListRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'LongSessionListRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(LongSessionListRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, LongSessionListRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public LongSessionListRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of LongSessionListRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of LongSessionListRspAllOfData - * @throws IOException if the JSON string is invalid with respect to LongSessionListRspAllOfData - */ - public static LongSessionListRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, LongSessionListRspAllOfData.class); - } - - /** - * Convert an instance of LongSessionListRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/LongSessionRevokeReq.java b/src/main/java/com/corbado/generated/model/LongSessionRevokeReq.java deleted file mode 100644 index 0642413..0000000 --- a/src/main/java/com/corbado/generated/model/LongSessionRevokeReq.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * LongSessionRevokeReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class LongSessionRevokeReq { - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public LongSessionRevokeReq() { - } - - public LongSessionRevokeReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public LongSessionRevokeReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LongSessionRevokeReq longSessionRevokeReq = (LongSessionRevokeReq) o; - return Objects.equals(this.requestID, longSessionRevokeReq.requestID) && - Objects.equals(this.clientInfo, longSessionRevokeReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class LongSessionRevokeReq {\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to LongSessionRevokeReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!LongSessionRevokeReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in LongSessionRevokeReq is not found in the empty JSON string", LongSessionRevokeReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!LongSessionRevokeReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSessionRevokeReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!LongSessionRevokeReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'LongSessionRevokeReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(LongSessionRevokeReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, LongSessionRevokeReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public LongSessionRevokeReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of LongSessionRevokeReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of LongSessionRevokeReq - * @throws IOException if the JSON string is invalid with respect to LongSessionRevokeReq - */ - public static LongSessionRevokeReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, LongSessionRevokeReq.class); - } - - /** - * Convert an instance of LongSessionRevokeReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/LongSessionStatus.java b/src/main/java/com/corbado/generated/model/LongSessionStatus.java new file mode 100644 index 0000000..4c36f82 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/LongSessionStatus.java @@ -0,0 +1,84 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets longSessionStatus + */ +@JsonAdapter(LongSessionStatus.Adapter.class) +public enum LongSessionStatus { + + ACTIVE("active"), + + LOGGED_OUT("logged_out"), + + EXPIRED("expired"), + + INACTIVITY_REACHED("inactivity_reached"), + + REVOKED("revoked"); + + private String value; + + LongSessionStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LongSessionStatus fromValue(String value) { + for (LongSessionStatus b : LongSessionStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LongSessionStatus enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LongSessionStatus read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LongSessionStatus.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + LongSessionStatus.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/LongSessionUpdateReq.java b/src/main/java/com/corbado/generated/model/LongSessionUpdateReq.java new file mode 100644 index 0000000..fac7295 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/LongSessionUpdateReq.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.LongSessionStatus; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * LongSessionUpdateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class LongSessionUpdateReq { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private LongSessionStatus status; + + public LongSessionUpdateReq() { + } + + public LongSessionUpdateReq status(LongSessionStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public LongSessionStatus getStatus() { + return status; + } + + public void setStatus(LongSessionStatus status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LongSessionUpdateReq longSessionUpdateReq = (LongSessionUpdateReq) o; + return Objects.equals(this.status, longSessionUpdateReq.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LongSessionUpdateReq {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to LongSessionUpdateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LongSessionUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LongSessionUpdateReq is not found in the empty JSON string", LongSessionUpdateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!LongSessionUpdateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LongSessionUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LongSessionUpdateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `status` + LongSessionStatus.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LongSessionUpdateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LongSessionUpdateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LongSessionUpdateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LongSessionUpdateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LongSessionUpdateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LongSessionUpdateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of LongSessionUpdateReq + * @throws IOException if the JSON string is invalid with respect to LongSessionUpdateReq + */ + public static LongSessionUpdateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LongSessionUpdateReq.class); + } + + /** + * Convert an instance of LongSessionUpdateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/Paging.java b/src/main/java/com/corbado/generated/model/Paging.java index 5b74878..696ab56 100644 --- a/src/main/java/com/corbado/generated/model/Paging.java +++ b/src/main/java/com/corbado/generated/model/Paging.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * Paging */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class Paging { public static final String SERIALIZED_NAME_PAGE = "page"; @SerializedName(SERIALIZED_NAME_PAGE) @@ -71,10 +71,10 @@ public Paging page(Integer page) { return this; } - /** + /** * current page returned in response * @return page - **/ + */ @javax.annotation.Nonnull public Integer getPage() { return page; @@ -90,10 +90,10 @@ public Paging totalPages(Integer totalPages) { return this; } - /** + /** * total number of pages available * @return totalPages - **/ + */ @javax.annotation.Nonnull public Integer getTotalPages() { return totalPages; @@ -109,10 +109,10 @@ public Paging totalItems(Integer totalItems) { return this; } - /** + /** * total number of items available * @return totalItems - **/ + */ @javax.annotation.Nonnull public Integer getTotalItems() { return totalItems; @@ -183,12 +183,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("totalItems"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Paging - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Paging + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Paging.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -242,22 +242,22 @@ public Paging read(JsonReader in) throws IOException { } } - /** - * Create an instance of Paging given an JSON string - * - * @param jsonString JSON string - * @return An instance of Paging - * @throws IOException if the JSON string is invalid with respect to Paging - */ + /** + * Create an instance of Paging given an JSON string + * + * @param jsonString JSON string + * @return An instance of Paging + * @throws IOException if the JSON string is invalid with respect to Paging + */ public static Paging fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Paging.class); } - /** - * Convert an instance of Paging to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Paging to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java new file mode 100644 index 0000000..3e4490b --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java @@ -0,0 +1,330 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInformation; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyAppendFinishReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyAppendFinishReq { + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_PROCESS_I_D = "processID"; + @SerializedName(SERIALIZED_NAME_PROCESS_I_D) + private String processID; + + public static final String SERIALIZED_NAME_ATTESTATION_RESPONSE = "attestationResponse"; + @SerializedName(SERIALIZED_NAME_ATTESTATION_RESPONSE) + private String attestationResponse; + + public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + private ClientInformation clientInformation; + + public static final String SERIALIZED_NAME_SEND_NOTIFICATION = "sendNotification"; + @SerializedName(SERIALIZED_NAME_SEND_NOTIFICATION) + private Boolean sendNotification; + + public PasskeyAppendFinishReq() { + } + + public PasskeyAppendFinishReq userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + */ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public PasskeyAppendFinishReq processID(String processID) { + this.processID = processID; + return this; + } + + /** + * Get processID + * @return processID + */ + @javax.annotation.Nonnull + public String getProcessID() { + return processID; + } + + public void setProcessID(String processID) { + this.processID = processID; + } + + + public PasskeyAppendFinishReq attestationResponse(String attestationResponse) { + this.attestationResponse = attestationResponse; + return this; + } + + /** + * Get attestationResponse + * @return attestationResponse + */ + @javax.annotation.Nonnull + public String getAttestationResponse() { + return attestationResponse; + } + + public void setAttestationResponse(String attestationResponse) { + this.attestationResponse = attestationResponse; + } + + + public PasskeyAppendFinishReq clientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + return this; + } + + /** + * Get clientInformation + * @return clientInformation + */ + @javax.annotation.Nonnull + public ClientInformation getClientInformation() { + return clientInformation; + } + + public void setClientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + } + + + public PasskeyAppendFinishReq sendNotification(Boolean sendNotification) { + this.sendNotification = sendNotification; + return this; + } + + /** + * Get sendNotification + * @return sendNotification + */ + @javax.annotation.Nullable + public Boolean getSendNotification() { + return sendNotification; + } + + public void setSendNotification(Boolean sendNotification) { + this.sendNotification = sendNotification; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyAppendFinishReq passkeyAppendFinishReq = (PasskeyAppendFinishReq) o; + return Objects.equals(this.userID, passkeyAppendFinishReq.userID) && + Objects.equals(this.processID, passkeyAppendFinishReq.processID) && + Objects.equals(this.attestationResponse, passkeyAppendFinishReq.attestationResponse) && + Objects.equals(this.clientInformation, passkeyAppendFinishReq.clientInformation) && + Objects.equals(this.sendNotification, passkeyAppendFinishReq.sendNotification); + } + + @Override + public int hashCode() { + return Objects.hash(userID, processID, attestationResponse, clientInformation, sendNotification); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyAppendFinishReq {\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" processID: ").append(toIndentedString(processID)).append("\n"); + sb.append(" attestationResponse: ").append(toIndentedString(attestationResponse)).append("\n"); + sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); + sb.append(" sendNotification: ").append(toIndentedString(sendNotification)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userID"); + openapiFields.add("processID"); + openapiFields.add("attestationResponse"); + openapiFields.add("clientInformation"); + openapiFields.add("sendNotification"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("processID"); + openapiRequiredFields.add("attestationResponse"); + openapiRequiredFields.add("clientInformation"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyAppendFinishReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyAppendFinishReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyAppendFinishReq is not found in the empty JSON string", PasskeyAppendFinishReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyAppendFinishReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyAppendFinishReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyAppendFinishReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("processID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `processID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processID").toString())); + } + if (!jsonObj.get("attestationResponse").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `attestationResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attestationResponse").toString())); + } + // validate the required field `clientInformation` + ClientInformation.validateJsonElement(jsonObj.get("clientInformation")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyAppendFinishReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyAppendFinishReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyAppendFinishReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyAppendFinishReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyAppendFinishReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyAppendFinishReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyAppendFinishReq + * @throws IOException if the JSON string is invalid with respect to PasskeyAppendFinishReq + */ + public static PasskeyAppendFinishReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyAppendFinishReq.class); + } + + /** + * Convert an instance of PasskeyAppendFinishReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java new file mode 100644 index 0000000..8cbffcb --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.PasskeyData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyAppendFinishRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyAppendFinishRsp { + public static final String SERIALIZED_NAME_PASSKEY_DATA = "passkeyData"; + @SerializedName(SERIALIZED_NAME_PASSKEY_DATA) + private PasskeyData passkeyData; + + public PasskeyAppendFinishRsp() { + } + + public PasskeyAppendFinishRsp passkeyData(PasskeyData passkeyData) { + this.passkeyData = passkeyData; + return this; + } + + /** + * Get passkeyData + * @return passkeyData + */ + @javax.annotation.Nonnull + public PasskeyData getPasskeyData() { + return passkeyData; + } + + public void setPasskeyData(PasskeyData passkeyData) { + this.passkeyData = passkeyData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyAppendFinishRsp passkeyAppendFinishRsp = (PasskeyAppendFinishRsp) o; + return Objects.equals(this.passkeyData, passkeyAppendFinishRsp.passkeyData); + } + + @Override + public int hashCode() { + return Objects.hash(passkeyData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyAppendFinishRsp {\n"); + sb.append(" passkeyData: ").append(toIndentedString(passkeyData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("passkeyData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("passkeyData"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyAppendFinishRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyAppendFinishRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyAppendFinishRsp is not found in the empty JSON string", PasskeyAppendFinishRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyAppendFinishRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyAppendFinishRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyAppendFinishRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `passkeyData` + PasskeyData.validateJsonElement(jsonObj.get("passkeyData")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyAppendFinishRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyAppendFinishRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyAppendFinishRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyAppendFinishRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyAppendFinishRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyAppendFinishRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyAppendFinishRsp + * @throws IOException if the JSON string is invalid with respect to PasskeyAppendFinishRsp + */ + public static PasskeyAppendFinishRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyAppendFinishRsp.class); + } + + /** + * Convert an instance of PasskeyAppendFinishRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java b/src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java new file mode 100644 index 0000000..c861a3a --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java @@ -0,0 +1,334 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInformation; +import com.corbado.generated.model.PasskeyIntelFlags; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyAppendStartReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyAppendStartReq { + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_PROCESS_I_D = "processID"; + @SerializedName(SERIALIZED_NAME_PROCESS_I_D) + private String processID; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + private ClientInformation clientInformation; + + public static final String SERIALIZED_NAME_PASSKEY_INTEL_FLAGS = "passkeyIntelFlags"; + @SerializedName(SERIALIZED_NAME_PASSKEY_INTEL_FLAGS) + private PasskeyIntelFlags passkeyIntelFlags; + + public PasskeyAppendStartReq() { + } + + public PasskeyAppendStartReq userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + */ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public PasskeyAppendStartReq processID(String processID) { + this.processID = processID; + return this; + } + + /** + * Get processID + * @return processID + */ + @javax.annotation.Nonnull + public String getProcessID() { + return processID; + } + + public void setProcessID(String processID) { + this.processID = processID; + } + + + public PasskeyAppendStartReq username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + public PasskeyAppendStartReq clientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + return this; + } + + /** + * Get clientInformation + * @return clientInformation + */ + @javax.annotation.Nonnull + public ClientInformation getClientInformation() { + return clientInformation; + } + + public void setClientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + } + + + public PasskeyAppendStartReq passkeyIntelFlags(PasskeyIntelFlags passkeyIntelFlags) { + this.passkeyIntelFlags = passkeyIntelFlags; + return this; + } + + /** + * Get passkeyIntelFlags + * @return passkeyIntelFlags + */ + @javax.annotation.Nonnull + public PasskeyIntelFlags getPasskeyIntelFlags() { + return passkeyIntelFlags; + } + + public void setPasskeyIntelFlags(PasskeyIntelFlags passkeyIntelFlags) { + this.passkeyIntelFlags = passkeyIntelFlags; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyAppendStartReq passkeyAppendStartReq = (PasskeyAppendStartReq) o; + return Objects.equals(this.userID, passkeyAppendStartReq.userID) && + Objects.equals(this.processID, passkeyAppendStartReq.processID) && + Objects.equals(this.username, passkeyAppendStartReq.username) && + Objects.equals(this.clientInformation, passkeyAppendStartReq.clientInformation) && + Objects.equals(this.passkeyIntelFlags, passkeyAppendStartReq.passkeyIntelFlags); + } + + @Override + public int hashCode() { + return Objects.hash(userID, processID, username, clientInformation, passkeyIntelFlags); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyAppendStartReq {\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" processID: ").append(toIndentedString(processID)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); + sb.append(" passkeyIntelFlags: ").append(toIndentedString(passkeyIntelFlags)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userID"); + openapiFields.add("processID"); + openapiFields.add("username"); + openapiFields.add("clientInformation"); + openapiFields.add("passkeyIntelFlags"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("processID"); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("clientInformation"); + openapiRequiredFields.add("passkeyIntelFlags"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyAppendStartReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyAppendStartReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyAppendStartReq is not found in the empty JSON string", PasskeyAppendStartReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyAppendStartReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyAppendStartReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyAppendStartReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("processID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `processID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processID").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + // validate the required field `clientInformation` + ClientInformation.validateJsonElement(jsonObj.get("clientInformation")); + // validate the required field `passkeyIntelFlags` + PasskeyIntelFlags.validateJsonElement(jsonObj.get("passkeyIntelFlags")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyAppendStartReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyAppendStartReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyAppendStartReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyAppendStartReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyAppendStartReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyAppendStartReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyAppendStartReq + * @throws IOException if the JSON string is invalid with respect to PasskeyAppendStartReq + */ + public static PasskeyAppendStartReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyAppendStartReq.class); + } + + /** + * Convert an instance of PasskeyAppendStartReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java b/src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java new file mode 100644 index 0000000..6641c43 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java @@ -0,0 +1,319 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.DecisionTag; +import com.corbado.generated.model.DetectionTag; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyAppendStartRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyAppendStartRsp { + public static final String SERIALIZED_NAME_APPEND_ALLOW = "appendAllow"; + @SerializedName(SERIALIZED_NAME_APPEND_ALLOW) + private Boolean appendAllow; + + public static final String SERIALIZED_NAME_DETECTION_TAGS = "detectionTags"; + @SerializedName(SERIALIZED_NAME_DETECTION_TAGS) + private List detectionTags = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DECISION_TAG = "decisionTag"; + @SerializedName(SERIALIZED_NAME_DECISION_TAG) + private DecisionTag decisionTag; + + public static final String SERIALIZED_NAME_ATTESTATION_OPTIONS = "attestationOptions"; + @SerializedName(SERIALIZED_NAME_ATTESTATION_OPTIONS) + private String attestationOptions; + + public PasskeyAppendStartRsp() { + } + + public PasskeyAppendStartRsp appendAllow(Boolean appendAllow) { + this.appendAllow = appendAllow; + return this; + } + + /** + * Get appendAllow + * @return appendAllow + */ + @javax.annotation.Nonnull + public Boolean getAppendAllow() { + return appendAllow; + } + + public void setAppendAllow(Boolean appendAllow) { + this.appendAllow = appendAllow; + } + + + public PasskeyAppendStartRsp detectionTags(List detectionTags) { + this.detectionTags = detectionTags; + return this; + } + + public PasskeyAppendStartRsp addDetectionTagsItem(DetectionTag detectionTagsItem) { + if (this.detectionTags == null) { + this.detectionTags = new ArrayList<>(); + } + this.detectionTags.add(detectionTagsItem); + return this; + } + + /** + * Get detectionTags + * @return detectionTags + */ + @javax.annotation.Nonnull + public List getDetectionTags() { + return detectionTags; + } + + public void setDetectionTags(List detectionTags) { + this.detectionTags = detectionTags; + } + + + public PasskeyAppendStartRsp decisionTag(DecisionTag decisionTag) { + this.decisionTag = decisionTag; + return this; + } + + /** + * Get decisionTag + * @return decisionTag + */ + @javax.annotation.Nonnull + public DecisionTag getDecisionTag() { + return decisionTag; + } + + public void setDecisionTag(DecisionTag decisionTag) { + this.decisionTag = decisionTag; + } + + + public PasskeyAppendStartRsp attestationOptions(String attestationOptions) { + this.attestationOptions = attestationOptions; + return this; + } + + /** + * Get attestationOptions + * @return attestationOptions + */ + @javax.annotation.Nonnull + public String getAttestationOptions() { + return attestationOptions; + } + + public void setAttestationOptions(String attestationOptions) { + this.attestationOptions = attestationOptions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyAppendStartRsp passkeyAppendStartRsp = (PasskeyAppendStartRsp) o; + return Objects.equals(this.appendAllow, passkeyAppendStartRsp.appendAllow) && + Objects.equals(this.detectionTags, passkeyAppendStartRsp.detectionTags) && + Objects.equals(this.decisionTag, passkeyAppendStartRsp.decisionTag) && + Objects.equals(this.attestationOptions, passkeyAppendStartRsp.attestationOptions); + } + + @Override + public int hashCode() { + return Objects.hash(appendAllow, detectionTags, decisionTag, attestationOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyAppendStartRsp {\n"); + sb.append(" appendAllow: ").append(toIndentedString(appendAllow)).append("\n"); + sb.append(" detectionTags: ").append(toIndentedString(detectionTags)).append("\n"); + sb.append(" decisionTag: ").append(toIndentedString(decisionTag)).append("\n"); + sb.append(" attestationOptions: ").append(toIndentedString(attestationOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("appendAllow"); + openapiFields.add("detectionTags"); + openapiFields.add("decisionTag"); + openapiFields.add("attestationOptions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("appendAllow"); + openapiRequiredFields.add("detectionTags"); + openapiRequiredFields.add("decisionTag"); + openapiRequiredFields.add("attestationOptions"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyAppendStartRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyAppendStartRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyAppendStartRsp is not found in the empty JSON string", PasskeyAppendStartRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyAppendStartRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyAppendStartRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyAppendStartRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("detectionTags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `detectionTags` to be an array in the JSON string but got `%s`", jsonObj.get("detectionTags").toString())); + } + + JsonArray jsonArraydetectionTags = jsonObj.getAsJsonArray("detectionTags"); + // validate the required field `detectionTags` (array) + for (int i = 0; i < jsonArraydetectionTags.size(); i++) { + DetectionTag.validateJsonElement(jsonArraydetectionTags.get(i)); + }; + // validate the required field `decisionTag` + DecisionTag.validateJsonElement(jsonObj.get("decisionTag")); + if (!jsonObj.get("attestationOptions").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `attestationOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attestationOptions").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyAppendStartRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyAppendStartRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyAppendStartRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyAppendStartRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyAppendStartRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyAppendStartRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyAppendStartRsp + * @throws IOException if the JSON string is invalid with respect to PasskeyAppendStartRsp + */ + public static PasskeyAppendStartRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyAppendStartRsp.class); + } + + /** + * Convert an instance of PasskeyAppendStartRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyData.java b/src/main/java/com/corbado/generated/model/PasskeyData.java new file mode 100644 index 0000000..ee499a6 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyData.java @@ -0,0 +1,301 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyData { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_IS_C_D_A = "isCDA"; + @SerializedName(SERIALIZED_NAME_IS_C_D_A) + private Boolean isCDA; + + public PasskeyData() { + } + + public PasskeyData id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public PasskeyData userID(String userID) { + this.userID = userID; + return this; + } + + /** + * Get userID + * @return userID + */ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public PasskeyData username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + public PasskeyData isCDA(Boolean isCDA) { + this.isCDA = isCDA; + return this; + } + + /** + * Get isCDA + * @return isCDA + */ + @javax.annotation.Nonnull + public Boolean getIsCDA() { + return isCDA; + } + + public void setIsCDA(Boolean isCDA) { + this.isCDA = isCDA; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyData passkeyData = (PasskeyData) o; + return Objects.equals(this.id, passkeyData.id) && + Objects.equals(this.userID, passkeyData.userID) && + Objects.equals(this.username, passkeyData.username) && + Objects.equals(this.isCDA, passkeyData.isCDA); + } + + @Override + public int hashCode() { + return Objects.hash(id, userID, username, isCDA); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" isCDA: ").append(toIndentedString(isCDA)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("userID"); + openapiFields.add("username"); + openapiFields.add("isCDA"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("isCDA"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyData is not found in the empty JSON string", PasskeyData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyData given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyData + * @throws IOException if the JSON string is invalid with respect to PasskeyData + */ + public static PasskeyData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyData.class); + } + + /** + * Convert an instance of PasskeyData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyEvent.java b/src/main/java/com/corbado/generated/model/PasskeyEvent.java new file mode 100644 index 0000000..c7deb31 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyEvent.java @@ -0,0 +1,417 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.PasskeyEventType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyEvent + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyEvent { + public static final String SERIALIZED_NAME_PASSKEY_EVENT_I_D = "passkeyEventID"; + @SerializedName(SERIALIZED_NAME_PASSKEY_EVENT_I_D) + private String passkeyEventID; + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; + @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + private PasskeyEventType eventType; + + public static final String SERIALIZED_NAME_CLIENT_ENV_I_D = "clientEnvID"; + @SerializedName(SERIALIZED_NAME_CLIENT_ENV_I_D) + private String clientEnvID; + + public static final String SERIALIZED_NAME_PROCESS_I_D = "processID"; + @SerializedName(SERIALIZED_NAME_PROCESS_I_D) + private String processID; + + public static final String SERIALIZED_NAME_CREDENTIAL_I_D = "credentialID"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_I_D) + private String credentialID; + + public static final String SERIALIZED_NAME_EXPIRES = "expires"; + @SerializedName(SERIALIZED_NAME_EXPIRES) + private Integer expires; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private String created; + + public PasskeyEvent() { + } + + public PasskeyEvent passkeyEventID(String passkeyEventID) { + this.passkeyEventID = passkeyEventID; + return this; + } + + /** + * Get passkeyEventID + * @return passkeyEventID + */ + @javax.annotation.Nonnull + public String getPasskeyEventID() { + return passkeyEventID; + } + + public void setPasskeyEventID(String passkeyEventID) { + this.passkeyEventID = passkeyEventID; + } + + + public PasskeyEvent userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + */ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public PasskeyEvent eventType(PasskeyEventType eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + */ + @javax.annotation.Nonnull + public PasskeyEventType getEventType() { + return eventType; + } + + public void setEventType(PasskeyEventType eventType) { + this.eventType = eventType; + } + + + public PasskeyEvent clientEnvID(String clientEnvID) { + this.clientEnvID = clientEnvID; + return this; + } + + /** + * Get clientEnvID + * @return clientEnvID + */ + @javax.annotation.Nullable + public String getClientEnvID() { + return clientEnvID; + } + + public void setClientEnvID(String clientEnvID) { + this.clientEnvID = clientEnvID; + } + + + public PasskeyEvent processID(String processID) { + this.processID = processID; + return this; + } + + /** + * Get processID + * @return processID + */ + @javax.annotation.Nullable + public String getProcessID() { + return processID; + } + + public void setProcessID(String processID) { + this.processID = processID; + } + + + public PasskeyEvent credentialID(String credentialID) { + this.credentialID = credentialID; + return this; + } + + /** + * Get credentialID + * @return credentialID + */ + @javax.annotation.Nullable + public String getCredentialID() { + return credentialID; + } + + public void setCredentialID(String credentialID) { + this.credentialID = credentialID; + } + + + public PasskeyEvent expires(Integer expires) { + this.expires = expires; + return this; + } + + /** + * Get expires + * @return expires + */ + @javax.annotation.Nullable + public Integer getExpires() { + return expires; + } + + public void setExpires(Integer expires) { + this.expires = expires; + } + + + public PasskeyEvent created(String created) { + this.created = created; + return this; + } + + /** + * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format + * @return created + */ + @javax.annotation.Nonnull + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyEvent passkeyEvent = (PasskeyEvent) o; + return Objects.equals(this.passkeyEventID, passkeyEvent.passkeyEventID) && + Objects.equals(this.userID, passkeyEvent.userID) && + Objects.equals(this.eventType, passkeyEvent.eventType) && + Objects.equals(this.clientEnvID, passkeyEvent.clientEnvID) && + Objects.equals(this.processID, passkeyEvent.processID) && + Objects.equals(this.credentialID, passkeyEvent.credentialID) && + Objects.equals(this.expires, passkeyEvent.expires) && + Objects.equals(this.created, passkeyEvent.created); + } + + @Override + public int hashCode() { + return Objects.hash(passkeyEventID, userID, eventType, clientEnvID, processID, credentialID, expires, created); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyEvent {\n"); + sb.append(" passkeyEventID: ").append(toIndentedString(passkeyEventID)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" clientEnvID: ").append(toIndentedString(clientEnvID)).append("\n"); + sb.append(" processID: ").append(toIndentedString(processID)).append("\n"); + sb.append(" credentialID: ").append(toIndentedString(credentialID)).append("\n"); + sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("passkeyEventID"); + openapiFields.add("userID"); + openapiFields.add("eventType"); + openapiFields.add("clientEnvID"); + openapiFields.add("processID"); + openapiFields.add("credentialID"); + openapiFields.add("expires"); + openapiFields.add("created"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("passkeyEventID"); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("eventType"); + openapiRequiredFields.add("created"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyEvent + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyEvent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyEvent is not found in the empty JSON string", PasskeyEvent.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyEvent.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyEvent` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyEvent.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("passkeyEventID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `passkeyEventID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passkeyEventID").toString())); + } + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + // validate the required field `eventType` + PasskeyEventType.validateJsonElement(jsonObj.get("eventType")); + if ((jsonObj.get("clientEnvID") != null && !jsonObj.get("clientEnvID").isJsonNull()) && !jsonObj.get("clientEnvID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientEnvID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientEnvID").toString())); + } + if ((jsonObj.get("processID") != null && !jsonObj.get("processID").isJsonNull()) && !jsonObj.get("processID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `processID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processID").toString())); + } + if ((jsonObj.get("credentialID") != null && !jsonObj.get("credentialID").isJsonNull()) && !jsonObj.get("credentialID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `credentialID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialID").toString())); + } + if (!jsonObj.get("created").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyEvent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyEvent' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyEvent.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyEvent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyEvent read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyEvent + * @throws IOException if the JSON string is invalid with respect to PasskeyEvent + */ + public static PasskeyEvent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyEvent.class); + } + + /** + * Convert an instance of PasskeyEvent to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java b/src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java new file mode 100644 index 0000000..e9c273e --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java @@ -0,0 +1,240 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.PasskeyEventType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyEventCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyEventCreateReq { + public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; + @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + private PasskeyEventType eventType; + + public static final String SERIALIZED_NAME_EXPIRES = "expires"; + @SerializedName(SERIALIZED_NAME_EXPIRES) + private Integer expires; + + public PasskeyEventCreateReq() { + } + + public PasskeyEventCreateReq eventType(PasskeyEventType eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + */ + @javax.annotation.Nonnull + public PasskeyEventType getEventType() { + return eventType; + } + + public void setEventType(PasskeyEventType eventType) { + this.eventType = eventType; + } + + + public PasskeyEventCreateReq expires(Integer expires) { + this.expires = expires; + return this; + } + + /** + * Get expires + * @return expires + */ + @javax.annotation.Nullable + public Integer getExpires() { + return expires; + } + + public void setExpires(Integer expires) { + this.expires = expires; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyEventCreateReq passkeyEventCreateReq = (PasskeyEventCreateReq) o; + return Objects.equals(this.eventType, passkeyEventCreateReq.eventType) && + Objects.equals(this.expires, passkeyEventCreateReq.expires); + } + + @Override + public int hashCode() { + return Objects.hash(eventType, expires); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyEventCreateReq {\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("eventType"); + openapiFields.add("expires"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("eventType"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyEventCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyEventCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyEventCreateReq is not found in the empty JSON string", PasskeyEventCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyEventCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyEventCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyEventCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `eventType` + PasskeyEventType.validateJsonElement(jsonObj.get("eventType")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyEventCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyEventCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyEventCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyEventCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyEventCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyEventCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyEventCreateReq + * @throws IOException if the JSON string is invalid with respect to PasskeyEventCreateReq + */ + public static PasskeyEventCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyEventCreateReq.class); + } + + /** + * Convert an instance of PasskeyEventCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyEventList.java b/src/main/java/com/corbado/generated/model/PasskeyEventList.java new file mode 100644 index 0000000..92f56cd --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyEventList.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.PasskeyEvent; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyEventList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyEventList { + public static final String SERIALIZED_NAME_PASSKEY_EVENTS = "passkeyEvents"; + @SerializedName(SERIALIZED_NAME_PASSKEY_EVENTS) + private List passkeyEvents = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public PasskeyEventList() { + } + + public PasskeyEventList passkeyEvents(List passkeyEvents) { + this.passkeyEvents = passkeyEvents; + return this; + } + + public PasskeyEventList addPasskeyEventsItem(PasskeyEvent passkeyEventsItem) { + if (this.passkeyEvents == null) { + this.passkeyEvents = new ArrayList<>(); + } + this.passkeyEvents.add(passkeyEventsItem); + return this; + } + + /** + * Get passkeyEvents + * @return passkeyEvents + */ + @javax.annotation.Nonnull + public List getPasskeyEvents() { + return passkeyEvents; + } + + public void setPasskeyEvents(List passkeyEvents) { + this.passkeyEvents = passkeyEvents; + } + + + public PasskeyEventList paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + */ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyEventList passkeyEventList = (PasskeyEventList) o; + return Objects.equals(this.passkeyEvents, passkeyEventList.passkeyEvents) && + Objects.equals(this.paging, passkeyEventList.paging); + } + + @Override + public int hashCode() { + return Objects.hash(passkeyEvents, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyEventList {\n"); + sb.append(" passkeyEvents: ").append(toIndentedString(passkeyEvents)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("passkeyEvents"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("passkeyEvents"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyEventList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyEventList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyEventList is not found in the empty JSON string", PasskeyEventList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyEventList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyEventList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyEventList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("passkeyEvents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `passkeyEvents` to be an array in the JSON string but got `%s`", jsonObj.get("passkeyEvents").toString())); + } + + JsonArray jsonArraypasskeyEvents = jsonObj.getAsJsonArray("passkeyEvents"); + // validate the required field `passkeyEvents` (array) + for (int i = 0; i < jsonArraypasskeyEvents.size(); i++) { + PasskeyEvent.validateJsonElement(jsonArraypasskeyEvents.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyEventList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyEventList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyEventList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyEventList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyEventList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyEventList given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyEventList + * @throws IOException if the JSON string is invalid with respect to PasskeyEventList + */ + public static PasskeyEventList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyEventList.class); + } + + /** + * Convert an instance of PasskeyEventList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyEventType.java b/src/main/java/com/corbado/generated/model/PasskeyEventType.java new file mode 100644 index 0000000..4dbb902 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyEventType.java @@ -0,0 +1,76 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets passkeyEventType + */ +@JsonAdapter(PasskeyEventType.Adapter.class) +public enum PasskeyEventType { + + USER_LOGIN_BLACKLISTED("user-login-blacklisted"); + + private String value; + + PasskeyEventType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PasskeyEventType fromValue(String value) { + for (PasskeyEventType b : PasskeyEventType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PasskeyEventType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PasskeyEventType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PasskeyEventType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PasskeyEventType.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java b/src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java new file mode 100644 index 0000000..2c317d7 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java @@ -0,0 +1,211 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyIntelFlags + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyIntelFlags { + public static final String SERIALIZED_NAME_FORCE_PASSKEY_APPEND = "forcePasskeyAppend"; + @SerializedName(SERIALIZED_NAME_FORCE_PASSKEY_APPEND) + private Boolean forcePasskeyAppend; + + public PasskeyIntelFlags() { + } + + public PasskeyIntelFlags forcePasskeyAppend(Boolean forcePasskeyAppend) { + this.forcePasskeyAppend = forcePasskeyAppend; + return this; + } + + /** + * Get forcePasskeyAppend + * @return forcePasskeyAppend + */ + @javax.annotation.Nonnull + public Boolean getForcePasskeyAppend() { + return forcePasskeyAppend; + } + + public void setForcePasskeyAppend(Boolean forcePasskeyAppend) { + this.forcePasskeyAppend = forcePasskeyAppend; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyIntelFlags passkeyIntelFlags = (PasskeyIntelFlags) o; + return Objects.equals(this.forcePasskeyAppend, passkeyIntelFlags.forcePasskeyAppend); + } + + @Override + public int hashCode() { + return Objects.hash(forcePasskeyAppend); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyIntelFlags {\n"); + sb.append(" forcePasskeyAppend: ").append(toIndentedString(forcePasskeyAppend)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("forcePasskeyAppend"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("forcePasskeyAppend"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyIntelFlags + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyIntelFlags.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyIntelFlags is not found in the empty JSON string", PasskeyIntelFlags.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyIntelFlags.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyIntelFlags` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyIntelFlags.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyIntelFlags.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyIntelFlags' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyIntelFlags.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyIntelFlags value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyIntelFlags read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyIntelFlags given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyIntelFlags + * @throws IOException if the JSON string is invalid with respect to PasskeyIntelFlags + */ + public static PasskeyIntelFlags fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyIntelFlags.class); + } + + /** + * Convert an instance of PasskeyIntelFlags to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java new file mode 100644 index 0000000..e7b9a86 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java @@ -0,0 +1,304 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInformation; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyLoginFinishReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyLoginFinishReq { + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_ASSERTION_RESPONSE = "assertionResponse"; + @SerializedName(SERIALIZED_NAME_ASSERTION_RESPONSE) + private String assertionResponse; + + public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + private ClientInformation clientInformation; + + public static final String SERIALIZED_NAME_PROCESS_I_D = "processID"; + @SerializedName(SERIALIZED_NAME_PROCESS_I_D) + private String processID; + + public PasskeyLoginFinishReq() { + } + + public PasskeyLoginFinishReq userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + */ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public PasskeyLoginFinishReq assertionResponse(String assertionResponse) { + this.assertionResponse = assertionResponse; + return this; + } + + /** + * Get assertionResponse + * @return assertionResponse + */ + @javax.annotation.Nonnull + public String getAssertionResponse() { + return assertionResponse; + } + + public void setAssertionResponse(String assertionResponse) { + this.assertionResponse = assertionResponse; + } + + + public PasskeyLoginFinishReq clientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + return this; + } + + /** + * Get clientInformation + * @return clientInformation + */ + @javax.annotation.Nonnull + public ClientInformation getClientInformation() { + return clientInformation; + } + + public void setClientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + } + + + public PasskeyLoginFinishReq processID(String processID) { + this.processID = processID; + return this; + } + + /** + * Get processID + * @return processID + */ + @javax.annotation.Nonnull + public String getProcessID() { + return processID; + } + + public void setProcessID(String processID) { + this.processID = processID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyLoginFinishReq passkeyLoginFinishReq = (PasskeyLoginFinishReq) o; + return Objects.equals(this.userID, passkeyLoginFinishReq.userID) && + Objects.equals(this.assertionResponse, passkeyLoginFinishReq.assertionResponse) && + Objects.equals(this.clientInformation, passkeyLoginFinishReq.clientInformation) && + Objects.equals(this.processID, passkeyLoginFinishReq.processID); + } + + @Override + public int hashCode() { + return Objects.hash(userID, assertionResponse, clientInformation, processID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyLoginFinishReq {\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" assertionResponse: ").append(toIndentedString(assertionResponse)).append("\n"); + sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); + sb.append(" processID: ").append(toIndentedString(processID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userID"); + openapiFields.add("assertionResponse"); + openapiFields.add("clientInformation"); + openapiFields.add("processID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("assertionResponse"); + openapiRequiredFields.add("clientInformation"); + openapiRequiredFields.add("processID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyLoginFinishReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyLoginFinishReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyLoginFinishReq is not found in the empty JSON string", PasskeyLoginFinishReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyLoginFinishReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyLoginFinishReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyLoginFinishReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("assertionResponse").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assertionResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assertionResponse").toString())); + } + // validate the required field `clientInformation` + ClientInformation.validateJsonElement(jsonObj.get("clientInformation")); + if (!jsonObj.get("processID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `processID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyLoginFinishReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyLoginFinishReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyLoginFinishReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyLoginFinishReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyLoginFinishReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyLoginFinishReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyLoginFinishReq + * @throws IOException if the JSON string is invalid with respect to PasskeyLoginFinishReq + */ + public static PasskeyLoginFinishReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyLoginFinishReq.class); + } + + /** + * Convert an instance of PasskeyLoginFinishReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java new file mode 100644 index 0000000..effd8ed --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.PasskeyData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyLoginFinishRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyLoginFinishRsp { + public static final String SERIALIZED_NAME_PASSKEY_DATA = "passkeyData"; + @SerializedName(SERIALIZED_NAME_PASSKEY_DATA) + private PasskeyData passkeyData; + + public PasskeyLoginFinishRsp() { + } + + public PasskeyLoginFinishRsp passkeyData(PasskeyData passkeyData) { + this.passkeyData = passkeyData; + return this; + } + + /** + * Get passkeyData + * @return passkeyData + */ + @javax.annotation.Nonnull + public PasskeyData getPasskeyData() { + return passkeyData; + } + + public void setPasskeyData(PasskeyData passkeyData) { + this.passkeyData = passkeyData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyLoginFinishRsp passkeyLoginFinishRsp = (PasskeyLoginFinishRsp) o; + return Objects.equals(this.passkeyData, passkeyLoginFinishRsp.passkeyData); + } + + @Override + public int hashCode() { + return Objects.hash(passkeyData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyLoginFinishRsp {\n"); + sb.append(" passkeyData: ").append(toIndentedString(passkeyData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("passkeyData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("passkeyData"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyLoginFinishRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyLoginFinishRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyLoginFinishRsp is not found in the empty JSON string", PasskeyLoginFinishRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyLoginFinishRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyLoginFinishRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyLoginFinishRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `passkeyData` + PasskeyData.validateJsonElement(jsonObj.get("passkeyData")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyLoginFinishRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyLoginFinishRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyLoginFinishRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyLoginFinishRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyLoginFinishRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyLoginFinishRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyLoginFinishRsp + * @throws IOException if the JSON string is invalid with respect to PasskeyLoginFinishRsp + */ + public static PasskeyLoginFinishRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyLoginFinishRsp.class); + } + + /** + * Convert an instance of PasskeyLoginFinishRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java b/src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java new file mode 100644 index 0000000..f5cadfc --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java @@ -0,0 +1,304 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInformation; +import com.corbado.generated.model.CrossDeviceAuthenticationStrategy; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyLoginStartReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyLoginStartReq { + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + private ClientInformation clientInformation; + + public static final String SERIALIZED_NAME_CROSS_DEVICE_AUTHENTICATION_STRATEGY = "crossDeviceAuthenticationStrategy"; + @SerializedName(SERIALIZED_NAME_CROSS_DEVICE_AUTHENTICATION_STRATEGY) + private CrossDeviceAuthenticationStrategy crossDeviceAuthenticationStrategy; + + public static final String SERIALIZED_NAME_PROCESS_I_D = "processID"; + @SerializedName(SERIALIZED_NAME_PROCESS_I_D) + private String processID; + + public PasskeyLoginStartReq() { + } + + public PasskeyLoginStartReq userID(String userID) { + this.userID = userID; + return this; + } + + /** + * ID of the user + * @return userID + */ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public PasskeyLoginStartReq clientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + return this; + } + + /** + * Get clientInformation + * @return clientInformation + */ + @javax.annotation.Nonnull + public ClientInformation getClientInformation() { + return clientInformation; + } + + public void setClientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + } + + + public PasskeyLoginStartReq crossDeviceAuthenticationStrategy(CrossDeviceAuthenticationStrategy crossDeviceAuthenticationStrategy) { + this.crossDeviceAuthenticationStrategy = crossDeviceAuthenticationStrategy; + return this; + } + + /** + * Get crossDeviceAuthenticationStrategy + * @return crossDeviceAuthenticationStrategy + */ + @javax.annotation.Nonnull + public CrossDeviceAuthenticationStrategy getCrossDeviceAuthenticationStrategy() { + return crossDeviceAuthenticationStrategy; + } + + public void setCrossDeviceAuthenticationStrategy(CrossDeviceAuthenticationStrategy crossDeviceAuthenticationStrategy) { + this.crossDeviceAuthenticationStrategy = crossDeviceAuthenticationStrategy; + } + + + public PasskeyLoginStartReq processID(String processID) { + this.processID = processID; + return this; + } + + /** + * Get processID + * @return processID + */ + @javax.annotation.Nonnull + public String getProcessID() { + return processID; + } + + public void setProcessID(String processID) { + this.processID = processID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyLoginStartReq passkeyLoginStartReq = (PasskeyLoginStartReq) o; + return Objects.equals(this.userID, passkeyLoginStartReq.userID) && + Objects.equals(this.clientInformation, passkeyLoginStartReq.clientInformation) && + Objects.equals(this.crossDeviceAuthenticationStrategy, passkeyLoginStartReq.crossDeviceAuthenticationStrategy) && + Objects.equals(this.processID, passkeyLoginStartReq.processID); + } + + @Override + public int hashCode() { + return Objects.hash(userID, clientInformation, crossDeviceAuthenticationStrategy, processID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyLoginStartReq {\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); + sb.append(" crossDeviceAuthenticationStrategy: ").append(toIndentedString(crossDeviceAuthenticationStrategy)).append("\n"); + sb.append(" processID: ").append(toIndentedString(processID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("userID"); + openapiFields.add("clientInformation"); + openapiFields.add("crossDeviceAuthenticationStrategy"); + openapiFields.add("processID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("clientInformation"); + openapiRequiredFields.add("crossDeviceAuthenticationStrategy"); + openapiRequiredFields.add("processID"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyLoginStartReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyLoginStartReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyLoginStartReq is not found in the empty JSON string", PasskeyLoginStartReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyLoginStartReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyLoginStartReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyLoginStartReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + // validate the required field `clientInformation` + ClientInformation.validateJsonElement(jsonObj.get("clientInformation")); + // validate the required field `crossDeviceAuthenticationStrategy` + CrossDeviceAuthenticationStrategy.validateJsonElement(jsonObj.get("crossDeviceAuthenticationStrategy")); + if (!jsonObj.get("processID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `processID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyLoginStartReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyLoginStartReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyLoginStartReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyLoginStartReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyLoginStartReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyLoginStartReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyLoginStartReq + * @throws IOException if the JSON string is invalid with respect to PasskeyLoginStartReq + */ + public static PasskeyLoginStartReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyLoginStartReq.class); + } + + /** + * Convert an instance of PasskeyLoginStartReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java b/src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java new file mode 100644 index 0000000..61539a2 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java @@ -0,0 +1,319 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.DecisionTag; +import com.corbado.generated.model.DetectionTag; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyLoginStartRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyLoginStartRsp { + public static final String SERIALIZED_NAME_LOGIN_ALLOW = "loginAllow"; + @SerializedName(SERIALIZED_NAME_LOGIN_ALLOW) + private Boolean loginAllow; + + public static final String SERIALIZED_NAME_DETECTION_TAGS = "detectionTags"; + @SerializedName(SERIALIZED_NAME_DETECTION_TAGS) + private List detectionTags = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DECISION_TAG = "decisionTag"; + @SerializedName(SERIALIZED_NAME_DECISION_TAG) + private DecisionTag decisionTag; + + public static final String SERIALIZED_NAME_ASSERTION_OPTIONS = "assertionOptions"; + @SerializedName(SERIALIZED_NAME_ASSERTION_OPTIONS) + private String assertionOptions; + + public PasskeyLoginStartRsp() { + } + + public PasskeyLoginStartRsp loginAllow(Boolean loginAllow) { + this.loginAllow = loginAllow; + return this; + } + + /** + * Get loginAllow + * @return loginAllow + */ + @javax.annotation.Nonnull + public Boolean getLoginAllow() { + return loginAllow; + } + + public void setLoginAllow(Boolean loginAllow) { + this.loginAllow = loginAllow; + } + + + public PasskeyLoginStartRsp detectionTags(List detectionTags) { + this.detectionTags = detectionTags; + return this; + } + + public PasskeyLoginStartRsp addDetectionTagsItem(DetectionTag detectionTagsItem) { + if (this.detectionTags == null) { + this.detectionTags = new ArrayList<>(); + } + this.detectionTags.add(detectionTagsItem); + return this; + } + + /** + * Get detectionTags + * @return detectionTags + */ + @javax.annotation.Nonnull + public List getDetectionTags() { + return detectionTags; + } + + public void setDetectionTags(List detectionTags) { + this.detectionTags = detectionTags; + } + + + public PasskeyLoginStartRsp decisionTag(DecisionTag decisionTag) { + this.decisionTag = decisionTag; + return this; + } + + /** + * Get decisionTag + * @return decisionTag + */ + @javax.annotation.Nonnull + public DecisionTag getDecisionTag() { + return decisionTag; + } + + public void setDecisionTag(DecisionTag decisionTag) { + this.decisionTag = decisionTag; + } + + + public PasskeyLoginStartRsp assertionOptions(String assertionOptions) { + this.assertionOptions = assertionOptions; + return this; + } + + /** + * Get assertionOptions + * @return assertionOptions + */ + @javax.annotation.Nonnull + public String getAssertionOptions() { + return assertionOptions; + } + + public void setAssertionOptions(String assertionOptions) { + this.assertionOptions = assertionOptions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyLoginStartRsp passkeyLoginStartRsp = (PasskeyLoginStartRsp) o; + return Objects.equals(this.loginAllow, passkeyLoginStartRsp.loginAllow) && + Objects.equals(this.detectionTags, passkeyLoginStartRsp.detectionTags) && + Objects.equals(this.decisionTag, passkeyLoginStartRsp.decisionTag) && + Objects.equals(this.assertionOptions, passkeyLoginStartRsp.assertionOptions); + } + + @Override + public int hashCode() { + return Objects.hash(loginAllow, detectionTags, decisionTag, assertionOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyLoginStartRsp {\n"); + sb.append(" loginAllow: ").append(toIndentedString(loginAllow)).append("\n"); + sb.append(" detectionTags: ").append(toIndentedString(detectionTags)).append("\n"); + sb.append(" decisionTag: ").append(toIndentedString(decisionTag)).append("\n"); + sb.append(" assertionOptions: ").append(toIndentedString(assertionOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("loginAllow"); + openapiFields.add("detectionTags"); + openapiFields.add("decisionTag"); + openapiFields.add("assertionOptions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("loginAllow"); + openapiRequiredFields.add("detectionTags"); + openapiRequiredFields.add("decisionTag"); + openapiRequiredFields.add("assertionOptions"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyLoginStartRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyLoginStartRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyLoginStartRsp is not found in the empty JSON string", PasskeyLoginStartRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyLoginStartRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyLoginStartRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyLoginStartRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("detectionTags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `detectionTags` to be an array in the JSON string but got `%s`", jsonObj.get("detectionTags").toString())); + } + + JsonArray jsonArraydetectionTags = jsonObj.getAsJsonArray("detectionTags"); + // validate the required field `detectionTags` (array) + for (int i = 0; i < jsonArraydetectionTags.size(); i++) { + DetectionTag.validateJsonElement(jsonArraydetectionTags.get(i)); + }; + // validate the required field `decisionTag` + DecisionTag.validateJsonElement(jsonObj.get("decisionTag")); + if (!jsonObj.get("assertionOptions").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assertionOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assertionOptions").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyLoginStartRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyLoginStartRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyLoginStartRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyLoginStartRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyLoginStartRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyLoginStartRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyLoginStartRsp + * @throws IOException if the JSON string is invalid with respect to PasskeyLoginStartRsp + */ + public static PasskeyLoginStartRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyLoginStartRsp.class); + } + + /** + * Convert an instance of PasskeyLoginStartRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java new file mode 100644 index 0000000..5df7e56 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java @@ -0,0 +1,244 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInformation; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyMediationFinishReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyMediationFinishReq { + public static final String SERIALIZED_NAME_ASSERTION_RESPONSE = "assertionResponse"; + @SerializedName(SERIALIZED_NAME_ASSERTION_RESPONSE) + private String assertionResponse; + + public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + private ClientInformation clientInformation; + + public PasskeyMediationFinishReq() { + } + + public PasskeyMediationFinishReq assertionResponse(String assertionResponse) { + this.assertionResponse = assertionResponse; + return this; + } + + /** + * Get assertionResponse + * @return assertionResponse + */ + @javax.annotation.Nonnull + public String getAssertionResponse() { + return assertionResponse; + } + + public void setAssertionResponse(String assertionResponse) { + this.assertionResponse = assertionResponse; + } + + + public PasskeyMediationFinishReq clientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + return this; + } + + /** + * Get clientInformation + * @return clientInformation + */ + @javax.annotation.Nonnull + public ClientInformation getClientInformation() { + return clientInformation; + } + + public void setClientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyMediationFinishReq passkeyMediationFinishReq = (PasskeyMediationFinishReq) o; + return Objects.equals(this.assertionResponse, passkeyMediationFinishReq.assertionResponse) && + Objects.equals(this.clientInformation, passkeyMediationFinishReq.clientInformation); + } + + @Override + public int hashCode() { + return Objects.hash(assertionResponse, clientInformation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyMediationFinishReq {\n"); + sb.append(" assertionResponse: ").append(toIndentedString(assertionResponse)).append("\n"); + sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("assertionResponse"); + openapiFields.add("clientInformation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("assertionResponse"); + openapiRequiredFields.add("clientInformation"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyMediationFinishReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyMediationFinishReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyMediationFinishReq is not found in the empty JSON string", PasskeyMediationFinishReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyMediationFinishReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyMediationFinishReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyMediationFinishReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("assertionResponse").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assertionResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assertionResponse").toString())); + } + // validate the required field `clientInformation` + ClientInformation.validateJsonElement(jsonObj.get("clientInformation")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyMediationFinishReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyMediationFinishReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyMediationFinishReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyMediationFinishReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyMediationFinishReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyMediationFinishReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyMediationFinishReq + * @throws IOException if the JSON string is invalid with respect to PasskeyMediationFinishReq + */ + public static PasskeyMediationFinishReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyMediationFinishReq.class); + } + + /** + * Convert an instance of PasskeyMediationFinishReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java new file mode 100644 index 0000000..9ae7845 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.PasskeyData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyMediationFinishRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyMediationFinishRsp { + public static final String SERIALIZED_NAME_PASSKEY_DATA = "passkeyData"; + @SerializedName(SERIALIZED_NAME_PASSKEY_DATA) + private PasskeyData passkeyData; + + public PasskeyMediationFinishRsp() { + } + + public PasskeyMediationFinishRsp passkeyData(PasskeyData passkeyData) { + this.passkeyData = passkeyData; + return this; + } + + /** + * Get passkeyData + * @return passkeyData + */ + @javax.annotation.Nonnull + public PasskeyData getPasskeyData() { + return passkeyData; + } + + public void setPasskeyData(PasskeyData passkeyData) { + this.passkeyData = passkeyData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyMediationFinishRsp passkeyMediationFinishRsp = (PasskeyMediationFinishRsp) o; + return Objects.equals(this.passkeyData, passkeyMediationFinishRsp.passkeyData); + } + + @Override + public int hashCode() { + return Objects.hash(passkeyData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyMediationFinishRsp {\n"); + sb.append(" passkeyData: ").append(toIndentedString(passkeyData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("passkeyData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("passkeyData"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyMediationFinishRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyMediationFinishRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyMediationFinishRsp is not found in the empty JSON string", PasskeyMediationFinishRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyMediationFinishRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyMediationFinishRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyMediationFinishRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `passkeyData` + PasskeyData.validateJsonElement(jsonObj.get("passkeyData")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyMediationFinishRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyMediationFinishRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyMediationFinishRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyMediationFinishRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyMediationFinishRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyMediationFinishRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyMediationFinishRsp + * @throws IOException if the JSON string is invalid with respect to PasskeyMediationFinishRsp + */ + public static PasskeyMediationFinishRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyMediationFinishRsp.class); + } + + /** + * Convert an instance of PasskeyMediationFinishRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java b/src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java new file mode 100644 index 0000000..60f2f41 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.ClientInformation; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyMediationStartReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyMediationStartReq { + public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; + @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) + private ClientInformation clientInformation; + + public PasskeyMediationStartReq() { + } + + public PasskeyMediationStartReq clientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + return this; + } + + /** + * Get clientInformation + * @return clientInformation + */ + @javax.annotation.Nonnull + public ClientInformation getClientInformation() { + return clientInformation; + } + + public void setClientInformation(ClientInformation clientInformation) { + this.clientInformation = clientInformation; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyMediationStartReq passkeyMediationStartReq = (PasskeyMediationStartReq) o; + return Objects.equals(this.clientInformation, passkeyMediationStartReq.clientInformation); + } + + @Override + public int hashCode() { + return Objects.hash(clientInformation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyMediationStartReq {\n"); + sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("clientInformation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("clientInformation"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyMediationStartReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyMediationStartReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyMediationStartReq is not found in the empty JSON string", PasskeyMediationStartReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyMediationStartReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyMediationStartReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyMediationStartReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `clientInformation` + ClientInformation.validateJsonElement(jsonObj.get("clientInformation")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyMediationStartReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyMediationStartReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyMediationStartReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyMediationStartReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyMediationStartReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyMediationStartReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyMediationStartReq + * @throws IOException if the JSON string is invalid with respect to PasskeyMediationStartReq + */ + public static PasskeyMediationStartReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyMediationStartReq.class); + } + + /** + * Convert an instance of PasskeyMediationStartReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java b/src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java new file mode 100644 index 0000000..cc3d42c --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java @@ -0,0 +1,241 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyMediationStartRsp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyMediationStartRsp { + public static final String SERIALIZED_NAME_LOGIN_ALLOW = "loginAllow"; + @SerializedName(SERIALIZED_NAME_LOGIN_ALLOW) + private Boolean loginAllow; + + public static final String SERIALIZED_NAME_ASSERTION_OPTIONS = "assertionOptions"; + @SerializedName(SERIALIZED_NAME_ASSERTION_OPTIONS) + private String assertionOptions; + + public PasskeyMediationStartRsp() { + } + + public PasskeyMediationStartRsp loginAllow(Boolean loginAllow) { + this.loginAllow = loginAllow; + return this; + } + + /** + * Get loginAllow + * @return loginAllow + */ + @javax.annotation.Nonnull + public Boolean getLoginAllow() { + return loginAllow; + } + + public void setLoginAllow(Boolean loginAllow) { + this.loginAllow = loginAllow; + } + + + public PasskeyMediationStartRsp assertionOptions(String assertionOptions) { + this.assertionOptions = assertionOptions; + return this; + } + + /** + * Get assertionOptions + * @return assertionOptions + */ + @javax.annotation.Nonnull + public String getAssertionOptions() { + return assertionOptions; + } + + public void setAssertionOptions(String assertionOptions) { + this.assertionOptions = assertionOptions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyMediationStartRsp passkeyMediationStartRsp = (PasskeyMediationStartRsp) o; + return Objects.equals(this.loginAllow, passkeyMediationStartRsp.loginAllow) && + Objects.equals(this.assertionOptions, passkeyMediationStartRsp.assertionOptions); + } + + @Override + public int hashCode() { + return Objects.hash(loginAllow, assertionOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyMediationStartRsp {\n"); + sb.append(" loginAllow: ").append(toIndentedString(loginAllow)).append("\n"); + sb.append(" assertionOptions: ").append(toIndentedString(assertionOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("loginAllow"); + openapiFields.add("assertionOptions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("loginAllow"); + openapiRequiredFields.add("assertionOptions"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyMediationStartRsp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyMediationStartRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyMediationStartRsp is not found in the empty JSON string", PasskeyMediationStartRsp.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyMediationStartRsp.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyMediationStartRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyMediationStartRsp.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("assertionOptions").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assertionOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assertionOptions").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyMediationStartRsp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyMediationStartRsp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyMediationStartRsp.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyMediationStartRsp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyMediationStartRsp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyMediationStartRsp given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyMediationStartRsp + * @throws IOException if the JSON string is invalid with respect to PasskeyMediationStartRsp + */ + public static PasskeyMediationStartRsp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyMediationStartRsp.class); + } + + /** + * Convert an instance of PasskeyMediationStartRsp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PhoneNumber.java b/src/main/java/com/corbado/generated/model/PhoneNumber.java deleted file mode 100644 index 88310e4..0000000 --- a/src/main/java/com/corbado/generated/model/PhoneNumber.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Status; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * PhoneNumber - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class PhoneNumber { - public static final String SERIALIZED_NAME_I_D = "ID"; - @SerializedName(SERIALIZED_NAME_I_D) - private String ID; - - public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; - @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) - private String phoneNumber; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private Status status; - - public PhoneNumber() { - } - - public PhoneNumber ID(String ID) { - this.ID = ID; - return this; - } - - /** - * ID of the phone number - * @return ID - **/ - @javax.annotation.Nonnull - public String getID() { - return ID; - } - - public void setID(String ID) { - this.ID = ID; - } - - - public PhoneNumber phoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - /** - * Get phoneNumber - * @return phoneNumber - **/ - @javax.annotation.Nonnull - public String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - - - public PhoneNumber created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public PhoneNumber updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - public PhoneNumber status(Status status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - **/ - @javax.annotation.Nonnull - public Status getStatus() { - return status; - } - - public void setStatus(Status status) { - this.status = status; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PhoneNumber phoneNumber = (PhoneNumber) o; - return Objects.equals(this.ID, phoneNumber.ID) && - Objects.equals(this.phoneNumber, phoneNumber.phoneNumber) && - Objects.equals(this.created, phoneNumber.created) && - Objects.equals(this.updated, phoneNumber.updated) && - Objects.equals(this.status, phoneNumber.status); - } - - @Override - public int hashCode() { - return Objects.hash(ID, phoneNumber, created, updated, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PhoneNumber {\n"); - sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); - sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ID"); - openapiFields.add("phoneNumber"); - openapiFields.add("created"); - openapiFields.add("updated"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("ID"); - openapiRequiredFields.add("phoneNumber"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PhoneNumber - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PhoneNumber.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in PhoneNumber is not found in the empty JSON string", PhoneNumber.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PhoneNumber.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PhoneNumber` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PhoneNumber.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("ID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); - } - if (!jsonObj.get("phoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - // validate the required field `status` - Status.validateJsonElement(jsonObj.get("status")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PhoneNumber.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PhoneNumber' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(PhoneNumber.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, PhoneNumber value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public PhoneNumber read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of PhoneNumber given an JSON string - * - * @param jsonString JSON string - * @return An instance of PhoneNumber - * @throws IOException if the JSON string is invalid with respect to PhoneNumber - */ - public static PhoneNumber fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PhoneNumber.class); - } - - /** - * Convert an instance of PhoneNumber to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/PhoneNumberValidationResult.java b/src/main/java/com/corbado/generated/model/PhoneNumberValidationResult.java deleted file mode 100644 index 5e65653..0000000 --- a/src/main/java/com/corbado/generated/model/PhoneNumberValidationResult.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ValidationPhoneNumber; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * PhoneNumberValidationResult - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class PhoneNumberValidationResult { - public static final String SERIALIZED_NAME_IS_VALID = "isValid"; - @SerializedName(SERIALIZED_NAME_IS_VALID) - private Boolean isValid; - - /** - * Gets or Sets validationCode - */ - @JsonAdapter(ValidationCodeEnum.Adapter.class) - public enum ValidationCodeEnum { - VALID("valid"), - - INVALID_COUNTRY_CODE("invalid_country_code"), - - INVALID_NUMBER("invalid_number"), - - TOO_LONG("too_long"); - - private String value; - - ValidationCodeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ValidationCodeEnum fromValue(String value) { - for (ValidationCodeEnum b : ValidationCodeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ValidationCodeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ValidationCodeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ValidationCodeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ValidationCodeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_VALIDATION_CODE = "validationCode"; - @SerializedName(SERIALIZED_NAME_VALIDATION_CODE) - private ValidationCodeEnum validationCode; - - public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; - @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) - private ValidationPhoneNumber phoneNumber; - - public PhoneNumberValidationResult() { - } - - public PhoneNumberValidationResult isValid(Boolean isValid) { - this.isValid = isValid; - return this; - } - - /** - * Get isValid - * @return isValid - **/ - @javax.annotation.Nonnull - public Boolean getIsValid() { - return isValid; - } - - public void setIsValid(Boolean isValid) { - this.isValid = isValid; - } - - - public PhoneNumberValidationResult validationCode(ValidationCodeEnum validationCode) { - this.validationCode = validationCode; - return this; - } - - /** - * Get validationCode - * @return validationCode - **/ - @javax.annotation.Nonnull - public ValidationCodeEnum getValidationCode() { - return validationCode; - } - - public void setValidationCode(ValidationCodeEnum validationCode) { - this.validationCode = validationCode; - } - - - public PhoneNumberValidationResult phoneNumber(ValidationPhoneNumber phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - /** - * Get phoneNumber - * @return phoneNumber - **/ - @javax.annotation.Nullable - public ValidationPhoneNumber getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(ValidationPhoneNumber phoneNumber) { - this.phoneNumber = phoneNumber; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PhoneNumberValidationResult phoneNumberValidationResult = (PhoneNumberValidationResult) o; - return Objects.equals(this.isValid, phoneNumberValidationResult.isValid) && - Objects.equals(this.validationCode, phoneNumberValidationResult.validationCode) && - Objects.equals(this.phoneNumber, phoneNumberValidationResult.phoneNumber); - } - - @Override - public int hashCode() { - return Objects.hash(isValid, validationCode, phoneNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class PhoneNumberValidationResult {\n"); - sb.append(" isValid: ").append(toIndentedString(isValid)).append("\n"); - sb.append(" validationCode: ").append(toIndentedString(validationCode)).append("\n"); - sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("isValid"); - openapiFields.add("validationCode"); - openapiFields.add("phoneNumber"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("isValid"); - openapiRequiredFields.add("validationCode"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PhoneNumberValidationResult - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!PhoneNumberValidationResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in PhoneNumberValidationResult is not found in the empty JSON string", PhoneNumberValidationResult.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!PhoneNumberValidationResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PhoneNumberValidationResult` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PhoneNumberValidationResult.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("validationCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `validationCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("validationCode").toString())); - } - // validate the required field `validationCode` - ValidationCodeEnum.validateJsonElement(jsonObj.get("validationCode")); - // validate the optional field `phoneNumber` - if (jsonObj.get("phoneNumber") != null && !jsonObj.get("phoneNumber").isJsonNull()) { - ValidationPhoneNumber.validateJsonElement(jsonObj.get("phoneNumber")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!PhoneNumberValidationResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PhoneNumberValidationResult' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(PhoneNumberValidationResult.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, PhoneNumberValidationResult value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public PhoneNumberValidationResult read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of PhoneNumberValidationResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of PhoneNumberValidationResult - * @throws IOException if the JSON string is invalid with respect to PhoneNumberValidationResult - */ - public static PhoneNumberValidationResult fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PhoneNumberValidationResult.class); - } - - /** - * Convert an instance of PhoneNumberValidationResult to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ProjectConfig.java b/src/main/java/com/corbado/generated/model/ProjectConfig.java deleted file mode 100644 index 2b072d1..0000000 --- a/src/main/java/com/corbado/generated/model/ProjectConfig.java +++ /dev/null @@ -1,2294 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.AppType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ProjectConfig - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ProjectConfig { - public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; - @SerializedName(SERIALIZED_NAME_PROJECT_I_D) - private String projectID; - - public static final String SERIALIZED_NAME_EXTERNAL_NAME = "externalName"; - @SerializedName(SERIALIZED_NAME_EXTERNAL_NAME) - private String externalName; - - public static final String SERIALIZED_NAME_APP_TYPE = "appType"; - @SerializedName(SERIALIZED_NAME_APP_TYPE) - private AppType appType; - - public static final String SERIALIZED_NAME_PRODUCT_KEY = "productKey"; - @SerializedName(SERIALIZED_NAME_PRODUCT_KEY) - private String productKey; - - public static final String SERIALIZED_NAME_PROJECT_SUBSCRIPTION_I_D = "projectSubscriptionID"; - @SerializedName(SERIALIZED_NAME_PROJECT_SUBSCRIPTION_I_D) - private String projectSubscriptionID; - - public static final String SERIALIZED_NAME_EMAIL_FROM = "emailFrom"; - @SerializedName(SERIALIZED_NAME_EMAIL_FROM) - private String emailFrom; - - public static final String SERIALIZED_NAME_SMS_FROM = "smsFrom"; - @SerializedName(SERIALIZED_NAME_SMS_FROM) - private String smsFrom; - - public static final String SERIALIZED_NAME_EXTERNAL_APPLICATION_PROTOCOL_VERSION = "externalApplicationProtocolVersion"; - @SerializedName(SERIALIZED_NAME_EXTERNAL_APPLICATION_PROTOCOL_VERSION) - private String externalApplicationProtocolVersion; - - public static final String SERIALIZED_NAME_WEBHOOK_U_R_L = "webhookURL"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_U_R_L) - private String webhookURL; - - public static final String SERIALIZED_NAME_WEBHOOK_USERNAME = "webhookUsername"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_USERNAME) - private String webhookUsername; - - public static final String SERIALIZED_NAME_WEBHOOK_PASSWORD = "webhookPassword"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_PASSWORD) - private String webhookPassword; - - public static final String SERIALIZED_NAME_WEBHOOK_TEST_INVALID_USERNAME = "webhookTestInvalidUsername"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_TEST_INVALID_USERNAME) - private String webhookTestInvalidUsername; - - public static final String SERIALIZED_NAME_WEBHOOK_TEST_VALID_USERNAME = "webhookTestValidUsername"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_TEST_VALID_USERNAME) - private String webhookTestValidUsername; - - public static final String SERIALIZED_NAME_WEBHOOK_TEST_VALID_PASSWORD = "webhookTestValidPassword"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_TEST_VALID_PASSWORD) - private String webhookTestValidPassword; - - public static final String SERIALIZED_NAME_EXTERNAL_APPLICATION_USERNAME = "externalApplicationUsername"; - @SerializedName(SERIALIZED_NAME_EXTERNAL_APPLICATION_USERNAME) - private String externalApplicationUsername; - - public static final String SERIALIZED_NAME_EXTERNAL_APPLICATION_PASSWORD = "externalApplicationPassword"; - @SerializedName(SERIALIZED_NAME_EXTERNAL_APPLICATION_PASSWORD) - private String externalApplicationPassword; - - public static final String SERIALIZED_NAME_LEGACY_AUTH_METHODS_URL = "legacyAuthMethodsUrl"; - @SerializedName(SERIALIZED_NAME_LEGACY_AUTH_METHODS_URL) - private String legacyAuthMethodsUrl; - - public static final String SERIALIZED_NAME_PASSWORD_VERIFY_URL = "passwordVerifyUrl"; - @SerializedName(SERIALIZED_NAME_PASSWORD_VERIFY_URL) - private String passwordVerifyUrl; - - public static final String SERIALIZED_NAME_AUTH_SUCCESS_REDIRECT_URL = "authSuccessRedirectUrl"; - @SerializedName(SERIALIZED_NAME_AUTH_SUCCESS_REDIRECT_URL) - private String authSuccessRedirectUrl; - - public static final String SERIALIZED_NAME_PASSWORD_RESET_URL = "passwordResetUrl"; - @SerializedName(SERIALIZED_NAME_PASSWORD_RESET_URL) - private String passwordResetUrl; - - public static final String SERIALIZED_NAME_ALLOW_USER_REGISTRATION = "allowUserRegistration"; - @SerializedName(SERIALIZED_NAME_ALLOW_USER_REGISTRATION) - private Boolean allowUserRegistration; - - public static final String SERIALIZED_NAME_ALLOW_I_P_STICKINESS = "allowIPStickiness"; - @SerializedName(SERIALIZED_NAME_ALLOW_I_P_STICKINESS) - private Boolean allowIPStickiness; - - /** - * Gets or Sets passkeyAppendInterval - */ - @JsonAdapter(PasskeyAppendIntervalEnum.Adapter.class) - public enum PasskeyAppendIntervalEnum { - NOT_SPECIFIED("not_specified"), - - _0D("0d"), - - _1D("1d"), - - _3D("3d"), - - _1W("1w"), - - _3W("3w"), - - _1M("1m"), - - _3M("3m"); - - private String value; - - PasskeyAppendIntervalEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static PasskeyAppendIntervalEnum fromValue(String value) { - for (PasskeyAppendIntervalEnum b : PasskeyAppendIntervalEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final PasskeyAppendIntervalEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public PasskeyAppendIntervalEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return PasskeyAppendIntervalEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - PasskeyAppendIntervalEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_PASSKEY_APPEND_INTERVAL = "passkeyAppendInterval"; - @SerializedName(SERIALIZED_NAME_PASSKEY_APPEND_INTERVAL) - private PasskeyAppendIntervalEnum passkeyAppendInterval; - - public static final String SERIALIZED_NAME_CLI_SECRET = "cliSecret"; - @SerializedName(SERIALIZED_NAME_CLI_SECRET) - private String cliSecret; - - public static final String SERIALIZED_NAME_FALLBACK_LANGUAGE = "fallbackLanguage"; - @SerializedName(SERIALIZED_NAME_FALLBACK_LANGUAGE) - private String fallbackLanguage; - - public static final String SERIALIZED_NAME_AUTO_DETECT_LANGUAGE = "autoDetectLanguage"; - @SerializedName(SERIALIZED_NAME_AUTO_DETECT_LANGUAGE) - private Boolean autoDetectLanguage; - - public static final String SERIALIZED_NAME_HAS_EXISTING_USERS = "hasExistingUsers"; - @SerializedName(SERIALIZED_NAME_HAS_EXISTING_USERS) - private Boolean hasExistingUsers; - - public static final String SERIALIZED_NAME_HAS_VERIFIED_SESSION = "hasVerifiedSession"; - @SerializedName(SERIALIZED_NAME_HAS_VERIFIED_SESSION) - private Boolean hasVerifiedSession; - - public static final String SERIALIZED_NAME_HAS_GENERATED_SESSION = "hasGeneratedSession"; - @SerializedName(SERIALIZED_NAME_HAS_GENERATED_SESSION) - private Boolean hasGeneratedSession; - - public static final String SERIALIZED_NAME_HAS_STARTED_USING_PASSKEYS = "hasStartedUsingPasskeys"; - @SerializedName(SERIALIZED_NAME_HAS_STARTED_USING_PASSKEYS) - private Boolean hasStartedUsingPasskeys; - - public static final String SERIALIZED_NAME_HAS_STARTED_USING_SESSIONS = "hasStartedUsingSessions"; - @SerializedName(SERIALIZED_NAME_HAS_STARTED_USING_SESSIONS) - private Boolean hasStartedUsingSessions; - - /** - * Gets or Sets environment - */ - @JsonAdapter(EnvironmentEnum.Adapter.class) - public enum EnvironmentEnum { - DEV("dev"), - - PROD("prod"); - - private String value; - - EnvironmentEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static EnvironmentEnum fromValue(String value) { - for (EnvironmentEnum b : EnvironmentEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EnvironmentEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public EnvironmentEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return EnvironmentEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - EnvironmentEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT) - private EnvironmentEnum environment; - - /** - * Gets or Sets frontendFramework - */ - @JsonAdapter(FrontendFrameworkEnum.Adapter.class) - public enum FrontendFrameworkEnum { - NOT_SPECIFIED("not_specified"), - - REACT("react"), - - VUEJS("vuejs"), - - VANILLAJS("vanillajs"), - - ANGULAR("angular"), - - SVELTE("svelte"), - - NEXTJS("nextjs"), - - NUXTJS("nuxtjs"), - - FLUTTER("flutter"); - - private String value; - - FrontendFrameworkEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static FrontendFrameworkEnum fromValue(String value) { - for (FrontendFrameworkEnum b : FrontendFrameworkEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final FrontendFrameworkEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public FrontendFrameworkEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return FrontendFrameworkEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - FrontendFrameworkEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_FRONTEND_FRAMEWORK = "frontendFramework"; - @SerializedName(SERIALIZED_NAME_FRONTEND_FRAMEWORK) - private FrontendFrameworkEnum frontendFramework; - - /** - * Gets or Sets backendLanguage - */ - @JsonAdapter(BackendLanguageEnum.Adapter.class) - public enum BackendLanguageEnum { - NOT_SPECIFIED("not_specified"), - - JAVASCRIPT("javascript"), - - PHP("php"), - - GO("go"), - - OTHER("other"); - - private String value; - - BackendLanguageEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static BackendLanguageEnum fromValue(String value) { - for (BackendLanguageEnum b : BackendLanguageEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final BackendLanguageEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public BackendLanguageEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return BackendLanguageEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - BackendLanguageEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_BACKEND_LANGUAGE = "backendLanguage"; - @SerializedName(SERIALIZED_NAME_BACKEND_LANGUAGE) - private BackendLanguageEnum backendLanguage; - - public static final String SERIALIZED_NAME_BACKEND_A_P_I_URL = "backendAPIUrl"; - @SerializedName(SERIALIZED_NAME_BACKEND_A_P_I_URL) - private String backendAPIUrl; - - public static final String SERIALIZED_NAME_FRONTEND_A_P_I_URL = "frontendAPIUrl"; - @SerializedName(SERIALIZED_NAME_FRONTEND_A_P_I_URL) - private String frontendAPIUrl; - - public static final String SERIALIZED_NAME_APPLICATION_URL = "applicationUrl"; - @SerializedName(SERIALIZED_NAME_APPLICATION_URL) - private String applicationUrl; - - public static final String SERIALIZED_NAME_USE_CLI = "useCli"; - @SerializedName(SERIALIZED_NAME_USE_CLI) - private Boolean useCli; - - public static final String SERIALIZED_NAME_DOUBLE_OPT_IN = "doubleOptIn"; - @SerializedName(SERIALIZED_NAME_DOUBLE_OPT_IN) - private Boolean doubleOptIn; - - public static final String SERIALIZED_NAME_USER_FULL_NAME_REQUIRED = "userFullNameRequired"; - @SerializedName(SERIALIZED_NAME_USER_FULL_NAME_REQUIRED) - private Boolean userFullNameRequired; - - public static final String SERIALIZED_NAME_WEBAUTHN_R_P_I_D = "webauthnRPID"; - @SerializedName(SERIALIZED_NAME_WEBAUTHN_R_P_I_D) - private String webauthnRPID; - - public static final String SERIALIZED_NAME_CNAME = "cname"; - @SerializedName(SERIALIZED_NAME_CNAME) - private String cname; - - public static final String SERIALIZED_NAME_WEB_COMPONENT_DEBUG = "webComponentDebug"; - @SerializedName(SERIALIZED_NAME_WEB_COMPONENT_DEBUG) - private Boolean webComponentDebug; - - public static final String SERIALIZED_NAME_SMTP_USE_CUSTOM = "smtpUseCustom"; - @SerializedName(SERIALIZED_NAME_SMTP_USE_CUSTOM) - private Boolean smtpUseCustom; - - public static final String SERIALIZED_NAME_SMTP_HOST = "smtpHost"; - @SerializedName(SERIALIZED_NAME_SMTP_HOST) - private String smtpHost; - - public static final String SERIALIZED_NAME_SMTP_PORT = "smtpPort"; - @SerializedName(SERIALIZED_NAME_SMTP_PORT) - private Integer smtpPort; - - public static final String SERIALIZED_NAME_SMTP_USERNAME = "smtpUsername"; - @SerializedName(SERIALIZED_NAME_SMTP_USERNAME) - private String smtpUsername; - - public static final String SERIALIZED_NAME_SMTP_PASSWORD = "smtpPassword"; - @SerializedName(SERIALIZED_NAME_SMTP_PASSWORD) - private String smtpPassword; - - public static final String SERIALIZED_NAME_SUPPORT_EMAIL = "supportEmail"; - @SerializedName(SERIALIZED_NAME_SUPPORT_EMAIL) - private String supportEmail; - - public static final String SERIALIZED_NAME_WEBHOOK_ACTIONS = "webhookActions"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_ACTIONS) - private List webhookActions = new ArrayList<>(); - - /** - * Gets or Sets signupFlow - */ - @JsonAdapter(SignupFlowEnum.Adapter.class) - public enum SignupFlowEnum { - PASSKEY_WITH_EMAIL_OTP_FALLBACK("PasskeyWithEmailOTPFallback"), - - EMAIL_OTP_SIGNUP("EmailOTPSignup"); - - private String value; - - SignupFlowEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SignupFlowEnum fromValue(String value) { - for (SignupFlowEnum b : SignupFlowEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SignupFlowEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SignupFlowEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SignupFlowEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - SignupFlowEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_SIGNUP_FLOW = "signupFlow"; - @SerializedName(SERIALIZED_NAME_SIGNUP_FLOW) - private SignupFlowEnum signupFlow; - - public static final String SERIALIZED_NAME_SIGNUP_FLOW_OPTIONS = "signupFlowOptions"; - @SerializedName(SERIALIZED_NAME_SIGNUP_FLOW_OPTIONS) - private Object signupFlowOptions; - - /** - * Gets or Sets loginFlow - */ - @JsonAdapter(LoginFlowEnum.Adapter.class) - public enum LoginFlowEnum { - PASSKEY_WITH_EMAIL_OTP_FALLBACK("PasskeyWithEmailOTPFallback"); - - private String value; - - LoginFlowEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LoginFlowEnum fromValue(String value) { - for (LoginFlowEnum b : LoginFlowEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LoginFlowEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LoginFlowEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LoginFlowEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - LoginFlowEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_LOGIN_FLOW = "loginFlow"; - @SerializedName(SERIALIZED_NAME_LOGIN_FLOW) - private LoginFlowEnum loginFlow; - - public static final String SERIALIZED_NAME_LOGIN_FLOW_OPTIONS = "loginFlowOptions"; - @SerializedName(SERIALIZED_NAME_LOGIN_FLOW_OPTIONS) - private Object loginFlowOptions; - - public static final String SERIALIZED_NAME_ALLOW_STATIC_CHALLENGES = "allowStaticChallenges"; - @SerializedName(SERIALIZED_NAME_ALLOW_STATIC_CHALLENGES) - private Boolean allowStaticChallenges; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - /** - * Gets or Sets status - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - ACTIVE("active"), - - CONFIGURING("configuring"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StatusEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public ProjectConfig() { - } - - public ProjectConfig projectID(String projectID) { - this.projectID = projectID; - return this; - } - - /** - * ID of project - * @return projectID - **/ - @javax.annotation.Nonnull - public String getProjectID() { - return projectID; - } - - public void setProjectID(String projectID) { - this.projectID = projectID; - } - - - public ProjectConfig externalName(String externalName) { - this.externalName = externalName; - return this; - } - - /** - * Get externalName - * @return externalName - **/ - @javax.annotation.Nonnull - public String getExternalName() { - return externalName; - } - - public void setExternalName(String externalName) { - this.externalName = externalName; - } - - - public ProjectConfig appType(AppType appType) { - this.appType = appType; - return this; - } - - /** - * Get appType - * @return appType - **/ - @javax.annotation.Nonnull - public AppType getAppType() { - return appType; - } - - public void setAppType(AppType appType) { - this.appType = appType; - } - - - public ProjectConfig productKey(String productKey) { - this.productKey = productKey; - return this; - } - - /** - * Get productKey - * @return productKey - **/ - @javax.annotation.Nonnull - public String getProductKey() { - return productKey; - } - - public void setProductKey(String productKey) { - this.productKey = productKey; - } - - - public ProjectConfig projectSubscriptionID(String projectSubscriptionID) { - this.projectSubscriptionID = projectSubscriptionID; - return this; - } - - /** - * Get projectSubscriptionID - * @return projectSubscriptionID - **/ - @javax.annotation.Nonnull - public String getProjectSubscriptionID() { - return projectSubscriptionID; - } - - public void setProjectSubscriptionID(String projectSubscriptionID) { - this.projectSubscriptionID = projectSubscriptionID; - } - - - public ProjectConfig emailFrom(String emailFrom) { - this.emailFrom = emailFrom; - return this; - } - - /** - * Get emailFrom - * @return emailFrom - **/ - @javax.annotation.Nonnull - public String getEmailFrom() { - return emailFrom; - } - - public void setEmailFrom(String emailFrom) { - this.emailFrom = emailFrom; - } - - - public ProjectConfig smsFrom(String smsFrom) { - this.smsFrom = smsFrom; - return this; - } - - /** - * Get smsFrom - * @return smsFrom - **/ - @javax.annotation.Nonnull - public String getSmsFrom() { - return smsFrom; - } - - public void setSmsFrom(String smsFrom) { - this.smsFrom = smsFrom; - } - - - public ProjectConfig externalApplicationProtocolVersion(String externalApplicationProtocolVersion) { - this.externalApplicationProtocolVersion = externalApplicationProtocolVersion; - return this; - } - - /** - * Get externalApplicationProtocolVersion - * @return externalApplicationProtocolVersion - **/ - @javax.annotation.Nonnull - public String getExternalApplicationProtocolVersion() { - return externalApplicationProtocolVersion; - } - - public void setExternalApplicationProtocolVersion(String externalApplicationProtocolVersion) { - this.externalApplicationProtocolVersion = externalApplicationProtocolVersion; - } - - - public ProjectConfig webhookURL(String webhookURL) { - this.webhookURL = webhookURL; - return this; - } - - /** - * Get webhookURL - * @return webhookURL - **/ - @javax.annotation.Nonnull - public String getWebhookURL() { - return webhookURL; - } - - public void setWebhookURL(String webhookURL) { - this.webhookURL = webhookURL; - } - - - public ProjectConfig webhookUsername(String webhookUsername) { - this.webhookUsername = webhookUsername; - return this; - } - - /** - * Get webhookUsername - * @return webhookUsername - **/ - @javax.annotation.Nonnull - public String getWebhookUsername() { - return webhookUsername; - } - - public void setWebhookUsername(String webhookUsername) { - this.webhookUsername = webhookUsername; - } - - - public ProjectConfig webhookPassword(String webhookPassword) { - this.webhookPassword = webhookPassword; - return this; - } - - /** - * Get webhookPassword - * @return webhookPassword - **/ - @javax.annotation.Nonnull - public String getWebhookPassword() { - return webhookPassword; - } - - public void setWebhookPassword(String webhookPassword) { - this.webhookPassword = webhookPassword; - } - - - public ProjectConfig webhookTestInvalidUsername(String webhookTestInvalidUsername) { - this.webhookTestInvalidUsername = webhookTestInvalidUsername; - return this; - } - - /** - * Get webhookTestInvalidUsername - * @return webhookTestInvalidUsername - **/ - @javax.annotation.Nonnull - public String getWebhookTestInvalidUsername() { - return webhookTestInvalidUsername; - } - - public void setWebhookTestInvalidUsername(String webhookTestInvalidUsername) { - this.webhookTestInvalidUsername = webhookTestInvalidUsername; - } - - - public ProjectConfig webhookTestValidUsername(String webhookTestValidUsername) { - this.webhookTestValidUsername = webhookTestValidUsername; - return this; - } - - /** - * Get webhookTestValidUsername - * @return webhookTestValidUsername - **/ - @javax.annotation.Nonnull - public String getWebhookTestValidUsername() { - return webhookTestValidUsername; - } - - public void setWebhookTestValidUsername(String webhookTestValidUsername) { - this.webhookTestValidUsername = webhookTestValidUsername; - } - - - public ProjectConfig webhookTestValidPassword(String webhookTestValidPassword) { - this.webhookTestValidPassword = webhookTestValidPassword; - return this; - } - - /** - * Get webhookTestValidPassword - * @return webhookTestValidPassword - **/ - @javax.annotation.Nonnull - public String getWebhookTestValidPassword() { - return webhookTestValidPassword; - } - - public void setWebhookTestValidPassword(String webhookTestValidPassword) { - this.webhookTestValidPassword = webhookTestValidPassword; - } - - - public ProjectConfig externalApplicationUsername(String externalApplicationUsername) { - this.externalApplicationUsername = externalApplicationUsername; - return this; - } - - /** - * Get externalApplicationUsername - * @return externalApplicationUsername - **/ - @javax.annotation.Nonnull - public String getExternalApplicationUsername() { - return externalApplicationUsername; - } - - public void setExternalApplicationUsername(String externalApplicationUsername) { - this.externalApplicationUsername = externalApplicationUsername; - } - - - public ProjectConfig externalApplicationPassword(String externalApplicationPassword) { - this.externalApplicationPassword = externalApplicationPassword; - return this; - } - - /** - * Get externalApplicationPassword - * @return externalApplicationPassword - **/ - @javax.annotation.Nonnull - public String getExternalApplicationPassword() { - return externalApplicationPassword; - } - - public void setExternalApplicationPassword(String externalApplicationPassword) { - this.externalApplicationPassword = externalApplicationPassword; - } - - - public ProjectConfig legacyAuthMethodsUrl(String legacyAuthMethodsUrl) { - this.legacyAuthMethodsUrl = legacyAuthMethodsUrl; - return this; - } - - /** - * Get legacyAuthMethodsUrl - * @return legacyAuthMethodsUrl - **/ - @javax.annotation.Nonnull - public String getLegacyAuthMethodsUrl() { - return legacyAuthMethodsUrl; - } - - public void setLegacyAuthMethodsUrl(String legacyAuthMethodsUrl) { - this.legacyAuthMethodsUrl = legacyAuthMethodsUrl; - } - - - public ProjectConfig passwordVerifyUrl(String passwordVerifyUrl) { - this.passwordVerifyUrl = passwordVerifyUrl; - return this; - } - - /** - * Get passwordVerifyUrl - * @return passwordVerifyUrl - **/ - @javax.annotation.Nonnull - public String getPasswordVerifyUrl() { - return passwordVerifyUrl; - } - - public void setPasswordVerifyUrl(String passwordVerifyUrl) { - this.passwordVerifyUrl = passwordVerifyUrl; - } - - - public ProjectConfig authSuccessRedirectUrl(String authSuccessRedirectUrl) { - this.authSuccessRedirectUrl = authSuccessRedirectUrl; - return this; - } - - /** - * Get authSuccessRedirectUrl - * @return authSuccessRedirectUrl - **/ - @javax.annotation.Nonnull - public String getAuthSuccessRedirectUrl() { - return authSuccessRedirectUrl; - } - - public void setAuthSuccessRedirectUrl(String authSuccessRedirectUrl) { - this.authSuccessRedirectUrl = authSuccessRedirectUrl; - } - - - public ProjectConfig passwordResetUrl(String passwordResetUrl) { - this.passwordResetUrl = passwordResetUrl; - return this; - } - - /** - * Get passwordResetUrl - * @return passwordResetUrl - **/ - @javax.annotation.Nonnull - public String getPasswordResetUrl() { - return passwordResetUrl; - } - - public void setPasswordResetUrl(String passwordResetUrl) { - this.passwordResetUrl = passwordResetUrl; - } - - - public ProjectConfig allowUserRegistration(Boolean allowUserRegistration) { - this.allowUserRegistration = allowUserRegistration; - return this; - } - - /** - * Get allowUserRegistration - * @return allowUserRegistration - **/ - @javax.annotation.Nonnull - public Boolean getAllowUserRegistration() { - return allowUserRegistration; - } - - public void setAllowUserRegistration(Boolean allowUserRegistration) { - this.allowUserRegistration = allowUserRegistration; - } - - - public ProjectConfig allowIPStickiness(Boolean allowIPStickiness) { - this.allowIPStickiness = allowIPStickiness; - return this; - } - - /** - * Get allowIPStickiness - * @return allowIPStickiness - **/ - @javax.annotation.Nonnull - public Boolean getAllowIPStickiness() { - return allowIPStickiness; - } - - public void setAllowIPStickiness(Boolean allowIPStickiness) { - this.allowIPStickiness = allowIPStickiness; - } - - - public ProjectConfig passkeyAppendInterval(PasskeyAppendIntervalEnum passkeyAppendInterval) { - this.passkeyAppendInterval = passkeyAppendInterval; - return this; - } - - /** - * Get passkeyAppendInterval - * @return passkeyAppendInterval - **/ - @javax.annotation.Nonnull - public PasskeyAppendIntervalEnum getPasskeyAppendInterval() { - return passkeyAppendInterval; - } - - public void setPasskeyAppendInterval(PasskeyAppendIntervalEnum passkeyAppendInterval) { - this.passkeyAppendInterval = passkeyAppendInterval; - } - - - public ProjectConfig cliSecret(String cliSecret) { - this.cliSecret = cliSecret; - return this; - } - - /** - * Get cliSecret - * @return cliSecret - **/ - @javax.annotation.Nonnull - public String getCliSecret() { - return cliSecret; - } - - public void setCliSecret(String cliSecret) { - this.cliSecret = cliSecret; - } - - - public ProjectConfig fallbackLanguage(String fallbackLanguage) { - this.fallbackLanguage = fallbackLanguage; - return this; - } - - /** - * Get fallbackLanguage - * @return fallbackLanguage - **/ - @javax.annotation.Nonnull - public String getFallbackLanguage() { - return fallbackLanguage; - } - - public void setFallbackLanguage(String fallbackLanguage) { - this.fallbackLanguage = fallbackLanguage; - } - - - public ProjectConfig autoDetectLanguage(Boolean autoDetectLanguage) { - this.autoDetectLanguage = autoDetectLanguage; - return this; - } - - /** - * Get autoDetectLanguage - * @return autoDetectLanguage - **/ - @javax.annotation.Nonnull - public Boolean getAutoDetectLanguage() { - return autoDetectLanguage; - } - - public void setAutoDetectLanguage(Boolean autoDetectLanguage) { - this.autoDetectLanguage = autoDetectLanguage; - } - - - public ProjectConfig hasExistingUsers(Boolean hasExistingUsers) { - this.hasExistingUsers = hasExistingUsers; - return this; - } - - /** - * Get hasExistingUsers - * @return hasExistingUsers - **/ - @javax.annotation.Nonnull - public Boolean getHasExistingUsers() { - return hasExistingUsers; - } - - public void setHasExistingUsers(Boolean hasExistingUsers) { - this.hasExistingUsers = hasExistingUsers; - } - - - public ProjectConfig hasVerifiedSession(Boolean hasVerifiedSession) { - this.hasVerifiedSession = hasVerifiedSession; - return this; - } - - /** - * Get hasVerifiedSession - * @return hasVerifiedSession - **/ - @javax.annotation.Nonnull - public Boolean getHasVerifiedSession() { - return hasVerifiedSession; - } - - public void setHasVerifiedSession(Boolean hasVerifiedSession) { - this.hasVerifiedSession = hasVerifiedSession; - } - - - public ProjectConfig hasGeneratedSession(Boolean hasGeneratedSession) { - this.hasGeneratedSession = hasGeneratedSession; - return this; - } - - /** - * Get hasGeneratedSession - * @return hasGeneratedSession - **/ - @javax.annotation.Nonnull - public Boolean getHasGeneratedSession() { - return hasGeneratedSession; - } - - public void setHasGeneratedSession(Boolean hasGeneratedSession) { - this.hasGeneratedSession = hasGeneratedSession; - } - - - public ProjectConfig hasStartedUsingPasskeys(Boolean hasStartedUsingPasskeys) { - this.hasStartedUsingPasskeys = hasStartedUsingPasskeys; - return this; - } - - /** - * Get hasStartedUsingPasskeys - * @return hasStartedUsingPasskeys - **/ - @javax.annotation.Nonnull - public Boolean getHasStartedUsingPasskeys() { - return hasStartedUsingPasskeys; - } - - public void setHasStartedUsingPasskeys(Boolean hasStartedUsingPasskeys) { - this.hasStartedUsingPasskeys = hasStartedUsingPasskeys; - } - - - public ProjectConfig hasStartedUsingSessions(Boolean hasStartedUsingSessions) { - this.hasStartedUsingSessions = hasStartedUsingSessions; - return this; - } - - /** - * Get hasStartedUsingSessions - * @return hasStartedUsingSessions - **/ - @javax.annotation.Nonnull - public Boolean getHasStartedUsingSessions() { - return hasStartedUsingSessions; - } - - public void setHasStartedUsingSessions(Boolean hasStartedUsingSessions) { - this.hasStartedUsingSessions = hasStartedUsingSessions; - } - - - public ProjectConfig environment(EnvironmentEnum environment) { - this.environment = environment; - return this; - } - - /** - * Get environment - * @return environment - **/ - @javax.annotation.Nonnull - public EnvironmentEnum getEnvironment() { - return environment; - } - - public void setEnvironment(EnvironmentEnum environment) { - this.environment = environment; - } - - - public ProjectConfig frontendFramework(FrontendFrameworkEnum frontendFramework) { - this.frontendFramework = frontendFramework; - return this; - } - - /** - * Get frontendFramework - * @return frontendFramework - **/ - @javax.annotation.Nonnull - public FrontendFrameworkEnum getFrontendFramework() { - return frontendFramework; - } - - public void setFrontendFramework(FrontendFrameworkEnum frontendFramework) { - this.frontendFramework = frontendFramework; - } - - - public ProjectConfig backendLanguage(BackendLanguageEnum backendLanguage) { - this.backendLanguage = backendLanguage; - return this; - } - - /** - * Get backendLanguage - * @return backendLanguage - **/ - @javax.annotation.Nonnull - public BackendLanguageEnum getBackendLanguage() { - return backendLanguage; - } - - public void setBackendLanguage(BackendLanguageEnum backendLanguage) { - this.backendLanguage = backendLanguage; - } - - - public ProjectConfig backendAPIUrl(String backendAPIUrl) { - this.backendAPIUrl = backendAPIUrl; - return this; - } - - /** - * Get backendAPIUrl - * @return backendAPIUrl - **/ - @javax.annotation.Nonnull - public String getBackendAPIUrl() { - return backendAPIUrl; - } - - public void setBackendAPIUrl(String backendAPIUrl) { - this.backendAPIUrl = backendAPIUrl; - } - - - public ProjectConfig frontendAPIUrl(String frontendAPIUrl) { - this.frontendAPIUrl = frontendAPIUrl; - return this; - } - - /** - * Get frontendAPIUrl - * @return frontendAPIUrl - **/ - @javax.annotation.Nonnull - public String getFrontendAPIUrl() { - return frontendAPIUrl; - } - - public void setFrontendAPIUrl(String frontendAPIUrl) { - this.frontendAPIUrl = frontendAPIUrl; - } - - - public ProjectConfig applicationUrl(String applicationUrl) { - this.applicationUrl = applicationUrl; - return this; - } - - /** - * Get applicationUrl - * @return applicationUrl - **/ - @javax.annotation.Nonnull - public String getApplicationUrl() { - return applicationUrl; - } - - public void setApplicationUrl(String applicationUrl) { - this.applicationUrl = applicationUrl; - } - - - public ProjectConfig useCli(Boolean useCli) { - this.useCli = useCli; - return this; - } - - /** - * Get useCli - * @return useCli - **/ - @javax.annotation.Nonnull - public Boolean getUseCli() { - return useCli; - } - - public void setUseCli(Boolean useCli) { - this.useCli = useCli; - } - - - public ProjectConfig doubleOptIn(Boolean doubleOptIn) { - this.doubleOptIn = doubleOptIn; - return this; - } - - /** - * Get doubleOptIn - * @return doubleOptIn - **/ - @javax.annotation.Nonnull - public Boolean getDoubleOptIn() { - return doubleOptIn; - } - - public void setDoubleOptIn(Boolean doubleOptIn) { - this.doubleOptIn = doubleOptIn; - } - - - public ProjectConfig userFullNameRequired(Boolean userFullNameRequired) { - this.userFullNameRequired = userFullNameRequired; - return this; - } - - /** - * Get userFullNameRequired - * @return userFullNameRequired - **/ - @javax.annotation.Nonnull - public Boolean getUserFullNameRequired() { - return userFullNameRequired; - } - - public void setUserFullNameRequired(Boolean userFullNameRequired) { - this.userFullNameRequired = userFullNameRequired; - } - - - public ProjectConfig webauthnRPID(String webauthnRPID) { - this.webauthnRPID = webauthnRPID; - return this; - } - - /** - * Get webauthnRPID - * @return webauthnRPID - **/ - @javax.annotation.Nonnull - public String getWebauthnRPID() { - return webauthnRPID; - } - - public void setWebauthnRPID(String webauthnRPID) { - this.webauthnRPID = webauthnRPID; - } - - - public ProjectConfig cname(String cname) { - this.cname = cname; - return this; - } - - /** - * Get cname - * @return cname - **/ - @javax.annotation.Nonnull - public String getCname() { - return cname; - } - - public void setCname(String cname) { - this.cname = cname; - } - - - public ProjectConfig webComponentDebug(Boolean webComponentDebug) { - this.webComponentDebug = webComponentDebug; - return this; - } - - /** - * Get webComponentDebug - * @return webComponentDebug - **/ - @javax.annotation.Nonnull - public Boolean getWebComponentDebug() { - return webComponentDebug; - } - - public void setWebComponentDebug(Boolean webComponentDebug) { - this.webComponentDebug = webComponentDebug; - } - - - public ProjectConfig smtpUseCustom(Boolean smtpUseCustom) { - this.smtpUseCustom = smtpUseCustom; - return this; - } - - /** - * Get smtpUseCustom - * @return smtpUseCustom - **/ - @javax.annotation.Nonnull - public Boolean getSmtpUseCustom() { - return smtpUseCustom; - } - - public void setSmtpUseCustom(Boolean smtpUseCustom) { - this.smtpUseCustom = smtpUseCustom; - } - - - public ProjectConfig smtpHost(String smtpHost) { - this.smtpHost = smtpHost; - return this; - } - - /** - * Get smtpHost - * @return smtpHost - **/ - @javax.annotation.Nonnull - public String getSmtpHost() { - return smtpHost; - } - - public void setSmtpHost(String smtpHost) { - this.smtpHost = smtpHost; - } - - - public ProjectConfig smtpPort(Integer smtpPort) { - this.smtpPort = smtpPort; - return this; - } - - /** - * Get smtpPort - * @return smtpPort - **/ - @javax.annotation.Nonnull - public Integer getSmtpPort() { - return smtpPort; - } - - public void setSmtpPort(Integer smtpPort) { - this.smtpPort = smtpPort; - } - - - public ProjectConfig smtpUsername(String smtpUsername) { - this.smtpUsername = smtpUsername; - return this; - } - - /** - * Get smtpUsername - * @return smtpUsername - **/ - @javax.annotation.Nonnull - public String getSmtpUsername() { - return smtpUsername; - } - - public void setSmtpUsername(String smtpUsername) { - this.smtpUsername = smtpUsername; - } - - - public ProjectConfig smtpPassword(String smtpPassword) { - this.smtpPassword = smtpPassword; - return this; - } - - /** - * Get smtpPassword - * @return smtpPassword - **/ - @javax.annotation.Nonnull - public String getSmtpPassword() { - return smtpPassword; - } - - public void setSmtpPassword(String smtpPassword) { - this.smtpPassword = smtpPassword; - } - - - public ProjectConfig supportEmail(String supportEmail) { - this.supportEmail = supportEmail; - return this; - } - - /** - * Get supportEmail - * @return supportEmail - **/ - @javax.annotation.Nonnull - public String getSupportEmail() { - return supportEmail; - } - - public void setSupportEmail(String supportEmail) { - this.supportEmail = supportEmail; - } - - - public ProjectConfig webhookActions(List webhookActions) { - this.webhookActions = webhookActions; - return this; - } - - public ProjectConfig addWebhookActionsItem(String webhookActionsItem) { - if (this.webhookActions == null) { - this.webhookActions = new ArrayList<>(); - } - this.webhookActions.add(webhookActionsItem); - return this; - } - - /** - * Get webhookActions - * @return webhookActions - **/ - @javax.annotation.Nonnull - public List getWebhookActions() { - return webhookActions; - } - - public void setWebhookActions(List webhookActions) { - this.webhookActions = webhookActions; - } - - - public ProjectConfig signupFlow(SignupFlowEnum signupFlow) { - this.signupFlow = signupFlow; - return this; - } - - /** - * Get signupFlow - * @return signupFlow - **/ - @javax.annotation.Nonnull - public SignupFlowEnum getSignupFlow() { - return signupFlow; - } - - public void setSignupFlow(SignupFlowEnum signupFlow) { - this.signupFlow = signupFlow; - } - - - public ProjectConfig signupFlowOptions(Object signupFlowOptions) { - this.signupFlowOptions = signupFlowOptions; - return this; - } - - /** - * Get signupFlowOptions - * @return signupFlowOptions - **/ - @javax.annotation.Nonnull - public Object getSignupFlowOptions() { - return signupFlowOptions; - } - - public void setSignupFlowOptions(Object signupFlowOptions) { - this.signupFlowOptions = signupFlowOptions; - } - - - public ProjectConfig loginFlow(LoginFlowEnum loginFlow) { - this.loginFlow = loginFlow; - return this; - } - - /** - * Get loginFlow - * @return loginFlow - **/ - @javax.annotation.Nonnull - public LoginFlowEnum getLoginFlow() { - return loginFlow; - } - - public void setLoginFlow(LoginFlowEnum loginFlow) { - this.loginFlow = loginFlow; - } - - - public ProjectConfig loginFlowOptions(Object loginFlowOptions) { - this.loginFlowOptions = loginFlowOptions; - return this; - } - - /** - * Get loginFlowOptions - * @return loginFlowOptions - **/ - @javax.annotation.Nonnull - public Object getLoginFlowOptions() { - return loginFlowOptions; - } - - public void setLoginFlowOptions(Object loginFlowOptions) { - this.loginFlowOptions = loginFlowOptions; - } - - - public ProjectConfig allowStaticChallenges(Boolean allowStaticChallenges) { - this.allowStaticChallenges = allowStaticChallenges; - return this; - } - - /** - * Get allowStaticChallenges - * @return allowStaticChallenges - **/ - @javax.annotation.Nonnull - public Boolean getAllowStaticChallenges() { - return allowStaticChallenges; - } - - public void setAllowStaticChallenges(Boolean allowStaticChallenges) { - this.allowStaticChallenges = allowStaticChallenges; - } - - - public ProjectConfig created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public ProjectConfig updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - public ProjectConfig status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - **/ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectConfig projectConfig = (ProjectConfig) o; - return Objects.equals(this.projectID, projectConfig.projectID) && - Objects.equals(this.externalName, projectConfig.externalName) && - Objects.equals(this.appType, projectConfig.appType) && - Objects.equals(this.productKey, projectConfig.productKey) && - Objects.equals(this.projectSubscriptionID, projectConfig.projectSubscriptionID) && - Objects.equals(this.emailFrom, projectConfig.emailFrom) && - Objects.equals(this.smsFrom, projectConfig.smsFrom) && - Objects.equals(this.externalApplicationProtocolVersion, projectConfig.externalApplicationProtocolVersion) && - Objects.equals(this.webhookURL, projectConfig.webhookURL) && - Objects.equals(this.webhookUsername, projectConfig.webhookUsername) && - Objects.equals(this.webhookPassword, projectConfig.webhookPassword) && - Objects.equals(this.webhookTestInvalidUsername, projectConfig.webhookTestInvalidUsername) && - Objects.equals(this.webhookTestValidUsername, projectConfig.webhookTestValidUsername) && - Objects.equals(this.webhookTestValidPassword, projectConfig.webhookTestValidPassword) && - Objects.equals(this.externalApplicationUsername, projectConfig.externalApplicationUsername) && - Objects.equals(this.externalApplicationPassword, projectConfig.externalApplicationPassword) && - Objects.equals(this.legacyAuthMethodsUrl, projectConfig.legacyAuthMethodsUrl) && - Objects.equals(this.passwordVerifyUrl, projectConfig.passwordVerifyUrl) && - Objects.equals(this.authSuccessRedirectUrl, projectConfig.authSuccessRedirectUrl) && - Objects.equals(this.passwordResetUrl, projectConfig.passwordResetUrl) && - Objects.equals(this.allowUserRegistration, projectConfig.allowUserRegistration) && - Objects.equals(this.allowIPStickiness, projectConfig.allowIPStickiness) && - Objects.equals(this.passkeyAppendInterval, projectConfig.passkeyAppendInterval) && - Objects.equals(this.cliSecret, projectConfig.cliSecret) && - Objects.equals(this.fallbackLanguage, projectConfig.fallbackLanguage) && - Objects.equals(this.autoDetectLanguage, projectConfig.autoDetectLanguage) && - Objects.equals(this.hasExistingUsers, projectConfig.hasExistingUsers) && - Objects.equals(this.hasVerifiedSession, projectConfig.hasVerifiedSession) && - Objects.equals(this.hasGeneratedSession, projectConfig.hasGeneratedSession) && - Objects.equals(this.hasStartedUsingPasskeys, projectConfig.hasStartedUsingPasskeys) && - Objects.equals(this.hasStartedUsingSessions, projectConfig.hasStartedUsingSessions) && - Objects.equals(this.environment, projectConfig.environment) && - Objects.equals(this.frontendFramework, projectConfig.frontendFramework) && - Objects.equals(this.backendLanguage, projectConfig.backendLanguage) && - Objects.equals(this.backendAPIUrl, projectConfig.backendAPIUrl) && - Objects.equals(this.frontendAPIUrl, projectConfig.frontendAPIUrl) && - Objects.equals(this.applicationUrl, projectConfig.applicationUrl) && - Objects.equals(this.useCli, projectConfig.useCli) && - Objects.equals(this.doubleOptIn, projectConfig.doubleOptIn) && - Objects.equals(this.userFullNameRequired, projectConfig.userFullNameRequired) && - Objects.equals(this.webauthnRPID, projectConfig.webauthnRPID) && - Objects.equals(this.cname, projectConfig.cname) && - Objects.equals(this.webComponentDebug, projectConfig.webComponentDebug) && - Objects.equals(this.smtpUseCustom, projectConfig.smtpUseCustom) && - Objects.equals(this.smtpHost, projectConfig.smtpHost) && - Objects.equals(this.smtpPort, projectConfig.smtpPort) && - Objects.equals(this.smtpUsername, projectConfig.smtpUsername) && - Objects.equals(this.smtpPassword, projectConfig.smtpPassword) && - Objects.equals(this.supportEmail, projectConfig.supportEmail) && - Objects.equals(this.webhookActions, projectConfig.webhookActions) && - Objects.equals(this.signupFlow, projectConfig.signupFlow) && - Objects.equals(this.signupFlowOptions, projectConfig.signupFlowOptions) && - Objects.equals(this.loginFlow, projectConfig.loginFlow) && - Objects.equals(this.loginFlowOptions, projectConfig.loginFlowOptions) && - Objects.equals(this.allowStaticChallenges, projectConfig.allowStaticChallenges) && - Objects.equals(this.created, projectConfig.created) && - Objects.equals(this.updated, projectConfig.updated) && - Objects.equals(this.status, projectConfig.status); - } - - @Override - public int hashCode() { - return Objects.hash(projectID, externalName, appType, productKey, projectSubscriptionID, emailFrom, smsFrom, externalApplicationProtocolVersion, webhookURL, webhookUsername, webhookPassword, webhookTestInvalidUsername, webhookTestValidUsername, webhookTestValidPassword, externalApplicationUsername, externalApplicationPassword, legacyAuthMethodsUrl, passwordVerifyUrl, authSuccessRedirectUrl, passwordResetUrl, allowUserRegistration, allowIPStickiness, passkeyAppendInterval, cliSecret, fallbackLanguage, autoDetectLanguage, hasExistingUsers, hasVerifiedSession, hasGeneratedSession, hasStartedUsingPasskeys, hasStartedUsingSessions, environment, frontendFramework, backendLanguage, backendAPIUrl, frontendAPIUrl, applicationUrl, useCli, doubleOptIn, userFullNameRequired, webauthnRPID, cname, webComponentDebug, smtpUseCustom, smtpHost, smtpPort, smtpUsername, smtpPassword, supportEmail, webhookActions, signupFlow, signupFlowOptions, loginFlow, loginFlowOptions, allowStaticChallenges, created, updated, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProjectConfig {\n"); - sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); - sb.append(" externalName: ").append(toIndentedString(externalName)).append("\n"); - sb.append(" appType: ").append(toIndentedString(appType)).append("\n"); - sb.append(" productKey: ").append(toIndentedString(productKey)).append("\n"); - sb.append(" projectSubscriptionID: ").append(toIndentedString(projectSubscriptionID)).append("\n"); - sb.append(" emailFrom: ").append(toIndentedString(emailFrom)).append("\n"); - sb.append(" smsFrom: ").append(toIndentedString(smsFrom)).append("\n"); - sb.append(" externalApplicationProtocolVersion: ").append(toIndentedString(externalApplicationProtocolVersion)).append("\n"); - sb.append(" webhookURL: ").append(toIndentedString(webhookURL)).append("\n"); - sb.append(" webhookUsername: ").append(toIndentedString(webhookUsername)).append("\n"); - sb.append(" webhookPassword: ").append(toIndentedString(webhookPassword)).append("\n"); - sb.append(" webhookTestInvalidUsername: ").append(toIndentedString(webhookTestInvalidUsername)).append("\n"); - sb.append(" webhookTestValidUsername: ").append(toIndentedString(webhookTestValidUsername)).append("\n"); - sb.append(" webhookTestValidPassword: ").append(toIndentedString(webhookTestValidPassword)).append("\n"); - sb.append(" externalApplicationUsername: ").append(toIndentedString(externalApplicationUsername)).append("\n"); - sb.append(" externalApplicationPassword: ").append(toIndentedString(externalApplicationPassword)).append("\n"); - sb.append(" legacyAuthMethodsUrl: ").append(toIndentedString(legacyAuthMethodsUrl)).append("\n"); - sb.append(" passwordVerifyUrl: ").append(toIndentedString(passwordVerifyUrl)).append("\n"); - sb.append(" authSuccessRedirectUrl: ").append(toIndentedString(authSuccessRedirectUrl)).append("\n"); - sb.append(" passwordResetUrl: ").append(toIndentedString(passwordResetUrl)).append("\n"); - sb.append(" allowUserRegistration: ").append(toIndentedString(allowUserRegistration)).append("\n"); - sb.append(" allowIPStickiness: ").append(toIndentedString(allowIPStickiness)).append("\n"); - sb.append(" passkeyAppendInterval: ").append(toIndentedString(passkeyAppendInterval)).append("\n"); - sb.append(" cliSecret: ").append(toIndentedString(cliSecret)).append("\n"); - sb.append(" fallbackLanguage: ").append(toIndentedString(fallbackLanguage)).append("\n"); - sb.append(" autoDetectLanguage: ").append(toIndentedString(autoDetectLanguage)).append("\n"); - sb.append(" hasExistingUsers: ").append(toIndentedString(hasExistingUsers)).append("\n"); - sb.append(" hasVerifiedSession: ").append(toIndentedString(hasVerifiedSession)).append("\n"); - sb.append(" hasGeneratedSession: ").append(toIndentedString(hasGeneratedSession)).append("\n"); - sb.append(" hasStartedUsingPasskeys: ").append(toIndentedString(hasStartedUsingPasskeys)).append("\n"); - sb.append(" hasStartedUsingSessions: ").append(toIndentedString(hasStartedUsingSessions)).append("\n"); - sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); - sb.append(" frontendFramework: ").append(toIndentedString(frontendFramework)).append("\n"); - sb.append(" backendLanguage: ").append(toIndentedString(backendLanguage)).append("\n"); - sb.append(" backendAPIUrl: ").append(toIndentedString(backendAPIUrl)).append("\n"); - sb.append(" frontendAPIUrl: ").append(toIndentedString(frontendAPIUrl)).append("\n"); - sb.append(" applicationUrl: ").append(toIndentedString(applicationUrl)).append("\n"); - sb.append(" useCli: ").append(toIndentedString(useCli)).append("\n"); - sb.append(" doubleOptIn: ").append(toIndentedString(doubleOptIn)).append("\n"); - sb.append(" userFullNameRequired: ").append(toIndentedString(userFullNameRequired)).append("\n"); - sb.append(" webauthnRPID: ").append(toIndentedString(webauthnRPID)).append("\n"); - sb.append(" cname: ").append(toIndentedString(cname)).append("\n"); - sb.append(" webComponentDebug: ").append(toIndentedString(webComponentDebug)).append("\n"); - sb.append(" smtpUseCustom: ").append(toIndentedString(smtpUseCustom)).append("\n"); - sb.append(" smtpHost: ").append(toIndentedString(smtpHost)).append("\n"); - sb.append(" smtpPort: ").append(toIndentedString(smtpPort)).append("\n"); - sb.append(" smtpUsername: ").append(toIndentedString(smtpUsername)).append("\n"); - sb.append(" smtpPassword: ").append(toIndentedString(smtpPassword)).append("\n"); - sb.append(" supportEmail: ").append(toIndentedString(supportEmail)).append("\n"); - sb.append(" webhookActions: ").append(toIndentedString(webhookActions)).append("\n"); - sb.append(" signupFlow: ").append(toIndentedString(signupFlow)).append("\n"); - sb.append(" signupFlowOptions: ").append(toIndentedString(signupFlowOptions)).append("\n"); - sb.append(" loginFlow: ").append(toIndentedString(loginFlow)).append("\n"); - sb.append(" loginFlowOptions: ").append(toIndentedString(loginFlowOptions)).append("\n"); - sb.append(" allowStaticChallenges: ").append(toIndentedString(allowStaticChallenges)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("projectID"); - openapiFields.add("externalName"); - openapiFields.add("appType"); - openapiFields.add("productKey"); - openapiFields.add("projectSubscriptionID"); - openapiFields.add("emailFrom"); - openapiFields.add("smsFrom"); - openapiFields.add("externalApplicationProtocolVersion"); - openapiFields.add("webhookURL"); - openapiFields.add("webhookUsername"); - openapiFields.add("webhookPassword"); - openapiFields.add("webhookTestInvalidUsername"); - openapiFields.add("webhookTestValidUsername"); - openapiFields.add("webhookTestValidPassword"); - openapiFields.add("externalApplicationUsername"); - openapiFields.add("externalApplicationPassword"); - openapiFields.add("legacyAuthMethodsUrl"); - openapiFields.add("passwordVerifyUrl"); - openapiFields.add("authSuccessRedirectUrl"); - openapiFields.add("passwordResetUrl"); - openapiFields.add("allowUserRegistration"); - openapiFields.add("allowIPStickiness"); - openapiFields.add("passkeyAppendInterval"); - openapiFields.add("cliSecret"); - openapiFields.add("fallbackLanguage"); - openapiFields.add("autoDetectLanguage"); - openapiFields.add("hasExistingUsers"); - openapiFields.add("hasVerifiedSession"); - openapiFields.add("hasGeneratedSession"); - openapiFields.add("hasStartedUsingPasskeys"); - openapiFields.add("hasStartedUsingSessions"); - openapiFields.add("environment"); - openapiFields.add("frontendFramework"); - openapiFields.add("backendLanguage"); - openapiFields.add("backendAPIUrl"); - openapiFields.add("frontendAPIUrl"); - openapiFields.add("applicationUrl"); - openapiFields.add("useCli"); - openapiFields.add("doubleOptIn"); - openapiFields.add("userFullNameRequired"); - openapiFields.add("webauthnRPID"); - openapiFields.add("cname"); - openapiFields.add("webComponentDebug"); - openapiFields.add("smtpUseCustom"); - openapiFields.add("smtpHost"); - openapiFields.add("smtpPort"); - openapiFields.add("smtpUsername"); - openapiFields.add("smtpPassword"); - openapiFields.add("supportEmail"); - openapiFields.add("webhookActions"); - openapiFields.add("signupFlow"); - openapiFields.add("signupFlowOptions"); - openapiFields.add("loginFlow"); - openapiFields.add("loginFlowOptions"); - openapiFields.add("allowStaticChallenges"); - openapiFields.add("created"); - openapiFields.add("updated"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("projectID"); - openapiRequiredFields.add("externalName"); - openapiRequiredFields.add("appType"); - openapiRequiredFields.add("productKey"); - openapiRequiredFields.add("projectSubscriptionID"); - openapiRequiredFields.add("emailFrom"); - openapiRequiredFields.add("smsFrom"); - openapiRequiredFields.add("externalApplicationProtocolVersion"); - openapiRequiredFields.add("webhookURL"); - openapiRequiredFields.add("webhookUsername"); - openapiRequiredFields.add("webhookPassword"); - openapiRequiredFields.add("webhookTestInvalidUsername"); - openapiRequiredFields.add("webhookTestValidUsername"); - openapiRequiredFields.add("webhookTestValidPassword"); - openapiRequiredFields.add("externalApplicationUsername"); - openapiRequiredFields.add("externalApplicationPassword"); - openapiRequiredFields.add("legacyAuthMethodsUrl"); - openapiRequiredFields.add("passwordVerifyUrl"); - openapiRequiredFields.add("authSuccessRedirectUrl"); - openapiRequiredFields.add("passwordResetUrl"); - openapiRequiredFields.add("allowUserRegistration"); - openapiRequiredFields.add("allowIPStickiness"); - openapiRequiredFields.add("passkeyAppendInterval"); - openapiRequiredFields.add("cliSecret"); - openapiRequiredFields.add("fallbackLanguage"); - openapiRequiredFields.add("autoDetectLanguage"); - openapiRequiredFields.add("hasExistingUsers"); - openapiRequiredFields.add("hasVerifiedSession"); - openapiRequiredFields.add("hasGeneratedSession"); - openapiRequiredFields.add("hasStartedUsingPasskeys"); - openapiRequiredFields.add("hasStartedUsingSessions"); - openapiRequiredFields.add("environment"); - openapiRequiredFields.add("frontendFramework"); - openapiRequiredFields.add("backendLanguage"); - openapiRequiredFields.add("backendAPIUrl"); - openapiRequiredFields.add("frontendAPIUrl"); - openapiRequiredFields.add("applicationUrl"); - openapiRequiredFields.add("useCli"); - openapiRequiredFields.add("doubleOptIn"); - openapiRequiredFields.add("userFullNameRequired"); - openapiRequiredFields.add("webauthnRPID"); - openapiRequiredFields.add("cname"); - openapiRequiredFields.add("webComponentDebug"); - openapiRequiredFields.add("smtpUseCustom"); - openapiRequiredFields.add("smtpHost"); - openapiRequiredFields.add("smtpPort"); - openapiRequiredFields.add("smtpUsername"); - openapiRequiredFields.add("smtpPassword"); - openapiRequiredFields.add("supportEmail"); - openapiRequiredFields.add("webhookActions"); - openapiRequiredFields.add("signupFlow"); - openapiRequiredFields.add("signupFlowOptions"); - openapiRequiredFields.add("loginFlow"); - openapiRequiredFields.add("loginFlowOptions"); - openapiRequiredFields.add("allowStaticChallenges"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ProjectConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ProjectConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectConfig is not found in the empty JSON string", ProjectConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ProjectConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectConfig` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ProjectConfig.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("projectID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); - } - if (!jsonObj.get("externalName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalName").toString())); - } - // validate the required field `appType` - AppType.validateJsonElement(jsonObj.get("appType")); - if (!jsonObj.get("productKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `productKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productKey").toString())); - } - if (!jsonObj.get("projectSubscriptionID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `projectSubscriptionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectSubscriptionID").toString())); - } - if (!jsonObj.get("emailFrom").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `emailFrom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailFrom").toString())); - } - if (!jsonObj.get("smsFrom").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `smsFrom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smsFrom").toString())); - } - if (!jsonObj.get("externalApplicationProtocolVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalApplicationProtocolVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalApplicationProtocolVersion").toString())); - } - if (!jsonObj.get("webhookURL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webhookURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookURL").toString())); - } - if (!jsonObj.get("webhookUsername").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webhookUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookUsername").toString())); - } - if (!jsonObj.get("webhookPassword").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webhookPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookPassword").toString())); - } - if (!jsonObj.get("webhookTestInvalidUsername").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webhookTestInvalidUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookTestInvalidUsername").toString())); - } - if (!jsonObj.get("webhookTestValidUsername").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webhookTestValidUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookTestValidUsername").toString())); - } - if (!jsonObj.get("webhookTestValidPassword").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webhookTestValidPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookTestValidPassword").toString())); - } - if (!jsonObj.get("externalApplicationUsername").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalApplicationUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalApplicationUsername").toString())); - } - if (!jsonObj.get("externalApplicationPassword").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalApplicationPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalApplicationPassword").toString())); - } - if (!jsonObj.get("legacyAuthMethodsUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `legacyAuthMethodsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legacyAuthMethodsUrl").toString())); - } - if (!jsonObj.get("passwordVerifyUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `passwordVerifyUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passwordVerifyUrl").toString())); - } - if (!jsonObj.get("authSuccessRedirectUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authSuccessRedirectUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authSuccessRedirectUrl").toString())); - } - if (!jsonObj.get("passwordResetUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `passwordResetUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passwordResetUrl").toString())); - } - if (!jsonObj.get("passkeyAppendInterval").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `passkeyAppendInterval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passkeyAppendInterval").toString())); - } - // validate the required field `passkeyAppendInterval` - PasskeyAppendIntervalEnum.validateJsonElement(jsonObj.get("passkeyAppendInterval")); - if (!jsonObj.get("cliSecret").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cliSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cliSecret").toString())); - } - if (!jsonObj.get("fallbackLanguage").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fallbackLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fallbackLanguage").toString())); - } - if (!jsonObj.get("environment").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `environment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environment").toString())); - } - // validate the required field `environment` - EnvironmentEnum.validateJsonElement(jsonObj.get("environment")); - if (!jsonObj.get("frontendFramework").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `frontendFramework` to be a primitive type in the JSON string but got `%s`", jsonObj.get("frontendFramework").toString())); - } - // validate the required field `frontendFramework` - FrontendFrameworkEnum.validateJsonElement(jsonObj.get("frontendFramework")); - if (!jsonObj.get("backendLanguage").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `backendLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("backendLanguage").toString())); - } - // validate the required field `backendLanguage` - BackendLanguageEnum.validateJsonElement(jsonObj.get("backendLanguage")); - if (!jsonObj.get("backendAPIUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `backendAPIUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("backendAPIUrl").toString())); - } - if (!jsonObj.get("frontendAPIUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `frontendAPIUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("frontendAPIUrl").toString())); - } - if (!jsonObj.get("applicationUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `applicationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applicationUrl").toString())); - } - if (!jsonObj.get("webauthnRPID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webauthnRPID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webauthnRPID").toString())); - } - if (!jsonObj.get("cname").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cname` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cname").toString())); - } - if (!jsonObj.get("smtpHost").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `smtpHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpHost").toString())); - } - if (!jsonObj.get("smtpUsername").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `smtpUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpUsername").toString())); - } - if (!jsonObj.get("smtpPassword").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `smtpPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpPassword").toString())); - } - if (!jsonObj.get("supportEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `supportEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("supportEmail").toString())); - } - // ensure the required json array is present - if (jsonObj.get("webhookActions") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("webhookActions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `webhookActions` to be an array in the JSON string but got `%s`", jsonObj.get("webhookActions").toString())); - } - if (!jsonObj.get("signupFlow").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `signupFlow` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signupFlow").toString())); - } - // validate the required field `signupFlow` - SignupFlowEnum.validateJsonElement(jsonObj.get("signupFlow")); - if (!jsonObj.get("loginFlow").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `loginFlow` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginFlow").toString())); - } - // validate the required field `loginFlow` - LoginFlowEnum.validateJsonElement(jsonObj.get("loginFlow")); - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // validate the required field `status` - StatusEnum.validateJsonElement(jsonObj.get("status")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProjectConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProjectConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProjectConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ProjectConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ProjectConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ProjectConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of ProjectConfig - * @throws IOException if the JSON string is invalid with respect to ProjectConfig - */ - public static ProjectConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProjectConfig.class); - } - - /** - * Convert an instance of ProjectConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ProjectConfigGetRsp.java b/src/main/java/com/corbado/generated/model/ProjectConfigGetRsp.java deleted file mode 100644 index a7a6ef1..0000000 --- a/src/main/java/com/corbado/generated/model/ProjectConfigGetRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ProjectConfig; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ProjectConfigGetRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ProjectConfigGetRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private ProjectConfig data; - - public ProjectConfigGetRsp() { - } - - public ProjectConfigGetRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public ProjectConfigGetRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public ProjectConfigGetRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public ProjectConfigGetRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public ProjectConfigGetRsp data(ProjectConfig data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public ProjectConfig getData() { - return data; - } - - public void setData(ProjectConfig data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectConfigGetRsp projectConfigGetRsp = (ProjectConfigGetRsp) o; - return Objects.equals(this.httpStatusCode, projectConfigGetRsp.httpStatusCode) && - Objects.equals(this.message, projectConfigGetRsp.message) && - Objects.equals(this.requestData, projectConfigGetRsp.requestData) && - Objects.equals(this.runtime, projectConfigGetRsp.runtime) && - Objects.equals(this.data, projectConfigGetRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProjectConfigGetRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ProjectConfigGetRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ProjectConfigGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectConfigGetRsp is not found in the empty JSON string", ProjectConfigGetRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ProjectConfigGetRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectConfigGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ProjectConfigGetRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - ProjectConfig.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProjectConfigGetRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProjectConfigGetRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProjectConfigGetRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ProjectConfigGetRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ProjectConfigGetRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ProjectConfigGetRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of ProjectConfigGetRsp - * @throws IOException if the JSON string is invalid with respect to ProjectConfigGetRsp - */ - public static ProjectConfigGetRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProjectConfigGetRsp.class); - } - - /** - * Convert an instance of ProjectConfigGetRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ProjectConfigSaveReq.java b/src/main/java/com/corbado/generated/model/ProjectConfigSaveReq.java deleted file mode 100644 index 92d1309..0000000 --- a/src/main/java/com/corbado/generated/model/ProjectConfigSaveReq.java +++ /dev/null @@ -1,2036 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.AppType; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ProjectConfigSaveReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ProjectConfigSaveReq { - public static final String SERIALIZED_NAME_EXTERNAL_NAME = "externalName"; - @SerializedName(SERIALIZED_NAME_EXTERNAL_NAME) - private String externalName; - - public static final String SERIALIZED_NAME_APP_TYPE = "appType"; - @SerializedName(SERIALIZED_NAME_APP_TYPE) - private AppType appType; - - public static final String SERIALIZED_NAME_PRODUCT_KEY = "productKey"; - @SerializedName(SERIALIZED_NAME_PRODUCT_KEY) - private String productKey; - - public static final String SERIALIZED_NAME_EMAIL_FROM = "emailFrom"; - @SerializedName(SERIALIZED_NAME_EMAIL_FROM) - private String emailFrom; - - public static final String SERIALIZED_NAME_SMS_FROM = "smsFrom"; - @SerializedName(SERIALIZED_NAME_SMS_FROM) - private String smsFrom; - - /** - * Defines which version of webhook is used - */ - @JsonAdapter(ExternalApplicationProtocolVersionEnum.Adapter.class) - public enum ExternalApplicationProtocolVersionEnum { - V1("v1"), - - V2("v2"); - - private String value; - - ExternalApplicationProtocolVersionEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ExternalApplicationProtocolVersionEnum fromValue(String value) { - for (ExternalApplicationProtocolVersionEnum b : ExternalApplicationProtocolVersionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ExternalApplicationProtocolVersionEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ExternalApplicationProtocolVersionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ExternalApplicationProtocolVersionEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ExternalApplicationProtocolVersionEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_EXTERNAL_APPLICATION_PROTOCOL_VERSION = "externalApplicationProtocolVersion"; - @SerializedName(SERIALIZED_NAME_EXTERNAL_APPLICATION_PROTOCOL_VERSION) - private ExternalApplicationProtocolVersionEnum externalApplicationProtocolVersion; - - public static final String SERIALIZED_NAME_WEBHOOK_U_R_L = "webhookURL"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_U_R_L) - private String webhookURL; - - public static final String SERIALIZED_NAME_WEBHOOK_ACTIONS = "webhookActions"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_ACTIONS) - private List webhookActions = new ArrayList<>(); - - public static final String SERIALIZED_NAME_WEBHOOK_USERNAME = "webhookUsername"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_USERNAME) - private String webhookUsername; - - public static final String SERIALIZED_NAME_WEBHOOK_PASSWORD = "webhookPassword"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_PASSWORD) - private String webhookPassword; - - public static final String SERIALIZED_NAME_WEBHOOK_TEST_INVALID_USERNAME = "webhookTestInvalidUsername"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_TEST_INVALID_USERNAME) - private String webhookTestInvalidUsername; - - public static final String SERIALIZED_NAME_WEBHOOK_TEST_VALID_USERNAME = "webhookTestValidUsername"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_TEST_VALID_USERNAME) - private String webhookTestValidUsername; - - public static final String SERIALIZED_NAME_WEBHOOK_TEST_VALID_PASSWORD = "webhookTestValidPassword"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_TEST_VALID_PASSWORD) - private String webhookTestValidPassword; - - public static final String SERIALIZED_NAME_EXTERNAL_APPLICATION_USERNAME = "externalApplicationUsername"; - @SerializedName(SERIALIZED_NAME_EXTERNAL_APPLICATION_USERNAME) - private String externalApplicationUsername; - - public static final String SERIALIZED_NAME_EXTERNAL_APPLICATION_PASSWORD = "externalApplicationPassword"; - @SerializedName(SERIALIZED_NAME_EXTERNAL_APPLICATION_PASSWORD) - private String externalApplicationPassword; - - public static final String SERIALIZED_NAME_LEGACY_AUTH_METHODS_URL = "legacyAuthMethodsUrl"; - @SerializedName(SERIALIZED_NAME_LEGACY_AUTH_METHODS_URL) - private String legacyAuthMethodsUrl; - - public static final String SERIALIZED_NAME_PASSWORD_VERIFY_URL = "passwordVerifyUrl"; - @SerializedName(SERIALIZED_NAME_PASSWORD_VERIFY_URL) - private String passwordVerifyUrl; - - public static final String SERIALIZED_NAME_AUTH_SUCCESS_REDIRECT_URL = "authSuccessRedirectUrl"; - @SerializedName(SERIALIZED_NAME_AUTH_SUCCESS_REDIRECT_URL) - private String authSuccessRedirectUrl; - - public static final String SERIALIZED_NAME_PASSWORD_RESET_URL = "passwordResetUrl"; - @SerializedName(SERIALIZED_NAME_PASSWORD_RESET_URL) - private String passwordResetUrl; - - public static final String SERIALIZED_NAME_ALLOW_USER_REGISTRATION = "allowUserRegistration"; - @SerializedName(SERIALIZED_NAME_ALLOW_USER_REGISTRATION) - private Boolean allowUserRegistration; - - public static final String SERIALIZED_NAME_ALLOW_I_P_STICKINESS = "allowIPStickiness"; - @SerializedName(SERIALIZED_NAME_ALLOW_I_P_STICKINESS) - private Boolean allowIPStickiness; - - /** - * Gets or Sets passkeyAppendInterval - */ - @JsonAdapter(PasskeyAppendIntervalEnum.Adapter.class) - public enum PasskeyAppendIntervalEnum { - _0D("0d"), - - _1D("1d"), - - _3D("3d"), - - _1W("1w"), - - _3W("3w"), - - _1M("1m"), - - _3M("3m"); - - private String value; - - PasskeyAppendIntervalEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static PasskeyAppendIntervalEnum fromValue(String value) { - for (PasskeyAppendIntervalEnum b : PasskeyAppendIntervalEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final PasskeyAppendIntervalEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public PasskeyAppendIntervalEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return PasskeyAppendIntervalEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - PasskeyAppendIntervalEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_PASSKEY_APPEND_INTERVAL = "passkeyAppendInterval"; - @SerializedName(SERIALIZED_NAME_PASSKEY_APPEND_INTERVAL) - private PasskeyAppendIntervalEnum passkeyAppendInterval; - - public static final String SERIALIZED_NAME_FALLBACK_LANGUAGE = "fallbackLanguage"; - @SerializedName(SERIALIZED_NAME_FALLBACK_LANGUAGE) - private String fallbackLanguage; - - public static final String SERIALIZED_NAME_AUTO_DETECT_LANGUAGE = "autoDetectLanguage"; - @SerializedName(SERIALIZED_NAME_AUTO_DETECT_LANGUAGE) - private Boolean autoDetectLanguage; - - public static final String SERIALIZED_NAME_HAS_EXISTING_USERS = "hasExistingUsers"; - @SerializedName(SERIALIZED_NAME_HAS_EXISTING_USERS) - private Boolean hasExistingUsers; - - public static final String SERIALIZED_NAME_HAS_VERIFIED_SESSION = "hasVerifiedSession"; - @SerializedName(SERIALIZED_NAME_HAS_VERIFIED_SESSION) - private Boolean hasVerifiedSession; - - public static final String SERIALIZED_NAME_HAS_GENERATED_SESSION = "hasGeneratedSession"; - @SerializedName(SERIALIZED_NAME_HAS_GENERATED_SESSION) - private Boolean hasGeneratedSession; - - public static final String SERIALIZED_NAME_HAS_STARTED_USING_PASSKEYS = "hasStartedUsingPasskeys"; - @SerializedName(SERIALIZED_NAME_HAS_STARTED_USING_PASSKEYS) - private Boolean hasStartedUsingPasskeys; - - public static final String SERIALIZED_NAME_HAS_STARTED_USING_SESSIONS = "hasStartedUsingSessions"; - @SerializedName(SERIALIZED_NAME_HAS_STARTED_USING_SESSIONS) - private Boolean hasStartedUsingSessions; - - public static final String SERIALIZED_NAME_APPLICATION_URL = "applicationUrl"; - @SerializedName(SERIALIZED_NAME_APPLICATION_URL) - private String applicationUrl; - - public static final String SERIALIZED_NAME_USE_CLI = "useCli"; - @SerializedName(SERIALIZED_NAME_USE_CLI) - private Boolean useCli; - - public static final String SERIALIZED_NAME_DOUBLE_OPT_IN = "doubleOptIn"; - @SerializedName(SERIALIZED_NAME_DOUBLE_OPT_IN) - private Boolean doubleOptIn; - - public static final String SERIALIZED_NAME_USER_FULL_NAME_REQUIRED = "userFullNameRequired"; - @SerializedName(SERIALIZED_NAME_USER_FULL_NAME_REQUIRED) - private Boolean userFullNameRequired; - - public static final String SERIALIZED_NAME_WEBAUTHN_R_P_I_D = "webauthnRPID"; - @SerializedName(SERIALIZED_NAME_WEBAUTHN_R_P_I_D) - private String webauthnRPID; - - /** - * Gets or Sets environment - */ - @JsonAdapter(EnvironmentEnum.Adapter.class) - public enum EnvironmentEnum { - DEV("dev"), - - PROD("prod"); - - private String value; - - EnvironmentEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static EnvironmentEnum fromValue(String value) { - for (EnvironmentEnum b : EnvironmentEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final EnvironmentEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public EnvironmentEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return EnvironmentEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - EnvironmentEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; - @SerializedName(SERIALIZED_NAME_ENVIRONMENT) - private EnvironmentEnum environment; - - /** - * Gets or Sets frontendFramework - */ - @JsonAdapter(FrontendFrameworkEnum.Adapter.class) - public enum FrontendFrameworkEnum { - REACT("react"), - - VUEJS("vuejs"), - - VANILLAJS("vanillajs"), - - ANGULAR("angular"), - - SVELTE("svelte"), - - NEXTJS("nextjs"), - - NUXTJS("nuxtjs"), - - FLUTTER("flutter"); - - private String value; - - FrontendFrameworkEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static FrontendFrameworkEnum fromValue(String value) { - for (FrontendFrameworkEnum b : FrontendFrameworkEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final FrontendFrameworkEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public FrontendFrameworkEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return FrontendFrameworkEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - FrontendFrameworkEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_FRONTEND_FRAMEWORK = "frontendFramework"; - @SerializedName(SERIALIZED_NAME_FRONTEND_FRAMEWORK) - private FrontendFrameworkEnum frontendFramework; - - /** - * Gets or Sets backendLanguage - */ - @JsonAdapter(BackendLanguageEnum.Adapter.class) - public enum BackendLanguageEnum { - JAVASCRIPT("javascript"), - - PHP("php"), - - GO("go"), - - OTHER("other"); - - private String value; - - BackendLanguageEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static BackendLanguageEnum fromValue(String value) { - for (BackendLanguageEnum b : BackendLanguageEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final BackendLanguageEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public BackendLanguageEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return BackendLanguageEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - BackendLanguageEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_BACKEND_LANGUAGE = "backendLanguage"; - @SerializedName(SERIALIZED_NAME_BACKEND_LANGUAGE) - private BackendLanguageEnum backendLanguage; - - public static final String SERIALIZED_NAME_WEB_COMPONENT_DEBUG = "webComponentDebug"; - @SerializedName(SERIALIZED_NAME_WEB_COMPONENT_DEBUG) - private Boolean webComponentDebug; - - public static final String SERIALIZED_NAME_SMTP_USE_CUSTOM = "smtpUseCustom"; - @SerializedName(SERIALIZED_NAME_SMTP_USE_CUSTOM) - private Boolean smtpUseCustom; - - public static final String SERIALIZED_NAME_SMTP_HOST = "smtpHost"; - @SerializedName(SERIALIZED_NAME_SMTP_HOST) - private String smtpHost; - - public static final String SERIALIZED_NAME_SMTP_PORT = "smtpPort"; - @SerializedName(SERIALIZED_NAME_SMTP_PORT) - private Integer smtpPort; - - public static final String SERIALIZED_NAME_SMTP_USERNAME = "smtpUsername"; - @SerializedName(SERIALIZED_NAME_SMTP_USERNAME) - private String smtpUsername; - - public static final String SERIALIZED_NAME_SMTP_PASSWORD = "smtpPassword"; - @SerializedName(SERIALIZED_NAME_SMTP_PASSWORD) - private String smtpPassword; - - public static final String SERIALIZED_NAME_SUPPORT_EMAIL = "supportEmail"; - @SerializedName(SERIALIZED_NAME_SUPPORT_EMAIL) - private String supportEmail; - - /** - * Gets or Sets signupFlow - */ - @JsonAdapter(SignupFlowEnum.Adapter.class) - public enum SignupFlowEnum { - PASSKEY_WITH_EMAIL_OTP_FALLBACK("PasskeyWithEmailOTPFallback"), - - EMAIL_OTP_SIGNUP("EmailOTPSignup"); - - private String value; - - SignupFlowEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static SignupFlowEnum fromValue(String value) { - for (SignupFlowEnum b : SignupFlowEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final SignupFlowEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public SignupFlowEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return SignupFlowEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - SignupFlowEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_SIGNUP_FLOW = "signupFlow"; - @SerializedName(SERIALIZED_NAME_SIGNUP_FLOW) - private SignupFlowEnum signupFlow; - - public static final String SERIALIZED_NAME_SIGNUP_FLOW_OPTIONS = "signupFlowOptions"; - @SerializedName(SERIALIZED_NAME_SIGNUP_FLOW_OPTIONS) - private Object signupFlowOptions; - - /** - * Gets or Sets loginFlow - */ - @JsonAdapter(LoginFlowEnum.Adapter.class) - public enum LoginFlowEnum { - PASSKEY_WITH_EMAIL_OTP_FALLBACK("PasskeyWithEmailOTPFallback"); - - private String value; - - LoginFlowEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LoginFlowEnum fromValue(String value) { - for (LoginFlowEnum b : LoginFlowEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LoginFlowEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LoginFlowEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LoginFlowEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - LoginFlowEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_LOGIN_FLOW = "loginFlow"; - @SerializedName(SERIALIZED_NAME_LOGIN_FLOW) - private LoginFlowEnum loginFlow; - - public static final String SERIALIZED_NAME_LOGIN_FLOW_OPTIONS = "loginFlowOptions"; - @SerializedName(SERIALIZED_NAME_LOGIN_FLOW_OPTIONS) - private Object loginFlowOptions; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public static final String SERIALIZED_NAME_ALLOW_STATIC_CHALLENGES = "allowStaticChallenges"; - @SerializedName(SERIALIZED_NAME_ALLOW_STATIC_CHALLENGES) - private Boolean allowStaticChallenges; - - public ProjectConfigSaveReq() { - } - - public ProjectConfigSaveReq externalName(String externalName) { - this.externalName = externalName; - return this; - } - - /** - * Get externalName - * @return externalName - **/ - @javax.annotation.Nullable - public String getExternalName() { - return externalName; - } - - public void setExternalName(String externalName) { - this.externalName = externalName; - } - - - public ProjectConfigSaveReq appType(AppType appType) { - this.appType = appType; - return this; - } - - /** - * Get appType - * @return appType - **/ - @javax.annotation.Nullable - public AppType getAppType() { - return appType; - } - - public void setAppType(AppType appType) { - this.appType = appType; - } - - - public ProjectConfigSaveReq productKey(String productKey) { - this.productKey = productKey; - return this; - } - - /** - * Get productKey - * @return productKey - **/ - @javax.annotation.Nullable - public String getProductKey() { - return productKey; - } - - public void setProductKey(String productKey) { - this.productKey = productKey; - } - - - public ProjectConfigSaveReq emailFrom(String emailFrom) { - this.emailFrom = emailFrom; - return this; - } - - /** - * Get emailFrom - * @return emailFrom - **/ - @javax.annotation.Nullable - public String getEmailFrom() { - return emailFrom; - } - - public void setEmailFrom(String emailFrom) { - this.emailFrom = emailFrom; - } - - - public ProjectConfigSaveReq smsFrom(String smsFrom) { - this.smsFrom = smsFrom; - return this; - } - - /** - * Get smsFrom - * @return smsFrom - **/ - @javax.annotation.Nullable - public String getSmsFrom() { - return smsFrom; - } - - public void setSmsFrom(String smsFrom) { - this.smsFrom = smsFrom; - } - - - public ProjectConfigSaveReq externalApplicationProtocolVersion(ExternalApplicationProtocolVersionEnum externalApplicationProtocolVersion) { - this.externalApplicationProtocolVersion = externalApplicationProtocolVersion; - return this; - } - - /** - * Defines which version of webhook is used - * @return externalApplicationProtocolVersion - **/ - @javax.annotation.Nullable - public ExternalApplicationProtocolVersionEnum getExternalApplicationProtocolVersion() { - return externalApplicationProtocolVersion; - } - - public void setExternalApplicationProtocolVersion(ExternalApplicationProtocolVersionEnum externalApplicationProtocolVersion) { - this.externalApplicationProtocolVersion = externalApplicationProtocolVersion; - } - - - public ProjectConfigSaveReq webhookURL(String webhookURL) { - this.webhookURL = webhookURL; - return this; - } - - /** - * Get webhookURL - * @return webhookURL - **/ - @javax.annotation.Nullable - public String getWebhookURL() { - return webhookURL; - } - - public void setWebhookURL(String webhookURL) { - this.webhookURL = webhookURL; - } - - - public ProjectConfigSaveReq webhookActions(List webhookActions) { - this.webhookActions = webhookActions; - return this; - } - - public ProjectConfigSaveReq addWebhookActionsItem(String webhookActionsItem) { - if (this.webhookActions == null) { - this.webhookActions = new ArrayList<>(); - } - this.webhookActions.add(webhookActionsItem); - return this; - } - - /** - * Get webhookActions - * @return webhookActions - **/ - @javax.annotation.Nullable - public List getWebhookActions() { - return webhookActions; - } - - public void setWebhookActions(List webhookActions) { - this.webhookActions = webhookActions; - } - - - public ProjectConfigSaveReq webhookUsername(String webhookUsername) { - this.webhookUsername = webhookUsername; - return this; - } - - /** - * Get webhookUsername - * @return webhookUsername - **/ - @javax.annotation.Nullable - public String getWebhookUsername() { - return webhookUsername; - } - - public void setWebhookUsername(String webhookUsername) { - this.webhookUsername = webhookUsername; - } - - - public ProjectConfigSaveReq webhookPassword(String webhookPassword) { - this.webhookPassword = webhookPassword; - return this; - } - - /** - * Get webhookPassword - * @return webhookPassword - **/ - @javax.annotation.Nullable - public String getWebhookPassword() { - return webhookPassword; - } - - public void setWebhookPassword(String webhookPassword) { - this.webhookPassword = webhookPassword; - } - - - public ProjectConfigSaveReq webhookTestInvalidUsername(String webhookTestInvalidUsername) { - this.webhookTestInvalidUsername = webhookTestInvalidUsername; - return this; - } - - /** - * Get webhookTestInvalidUsername - * @return webhookTestInvalidUsername - **/ - @javax.annotation.Nullable - public String getWebhookTestInvalidUsername() { - return webhookTestInvalidUsername; - } - - public void setWebhookTestInvalidUsername(String webhookTestInvalidUsername) { - this.webhookTestInvalidUsername = webhookTestInvalidUsername; - } - - - public ProjectConfigSaveReq webhookTestValidUsername(String webhookTestValidUsername) { - this.webhookTestValidUsername = webhookTestValidUsername; - return this; - } - - /** - * Get webhookTestValidUsername - * @return webhookTestValidUsername - **/ - @javax.annotation.Nullable - public String getWebhookTestValidUsername() { - return webhookTestValidUsername; - } - - public void setWebhookTestValidUsername(String webhookTestValidUsername) { - this.webhookTestValidUsername = webhookTestValidUsername; - } - - - public ProjectConfigSaveReq webhookTestValidPassword(String webhookTestValidPassword) { - this.webhookTestValidPassword = webhookTestValidPassword; - return this; - } - - /** - * Get webhookTestValidPassword - * @return webhookTestValidPassword - **/ - @javax.annotation.Nullable - public String getWebhookTestValidPassword() { - return webhookTestValidPassword; - } - - public void setWebhookTestValidPassword(String webhookTestValidPassword) { - this.webhookTestValidPassword = webhookTestValidPassword; - } - - - public ProjectConfigSaveReq externalApplicationUsername(String externalApplicationUsername) { - this.externalApplicationUsername = externalApplicationUsername; - return this; - } - - /** - * Get externalApplicationUsername - * @return externalApplicationUsername - **/ - @javax.annotation.Nullable - public String getExternalApplicationUsername() { - return externalApplicationUsername; - } - - public void setExternalApplicationUsername(String externalApplicationUsername) { - this.externalApplicationUsername = externalApplicationUsername; - } - - - public ProjectConfigSaveReq externalApplicationPassword(String externalApplicationPassword) { - this.externalApplicationPassword = externalApplicationPassword; - return this; - } - - /** - * Get externalApplicationPassword - * @return externalApplicationPassword - **/ - @javax.annotation.Nullable - public String getExternalApplicationPassword() { - return externalApplicationPassword; - } - - public void setExternalApplicationPassword(String externalApplicationPassword) { - this.externalApplicationPassword = externalApplicationPassword; - } - - - public ProjectConfigSaveReq legacyAuthMethodsUrl(String legacyAuthMethodsUrl) { - this.legacyAuthMethodsUrl = legacyAuthMethodsUrl; - return this; - } - - /** - * Get legacyAuthMethodsUrl - * @return legacyAuthMethodsUrl - **/ - @javax.annotation.Nullable - public String getLegacyAuthMethodsUrl() { - return legacyAuthMethodsUrl; - } - - public void setLegacyAuthMethodsUrl(String legacyAuthMethodsUrl) { - this.legacyAuthMethodsUrl = legacyAuthMethodsUrl; - } - - - public ProjectConfigSaveReq passwordVerifyUrl(String passwordVerifyUrl) { - this.passwordVerifyUrl = passwordVerifyUrl; - return this; - } - - /** - * Get passwordVerifyUrl - * @return passwordVerifyUrl - **/ - @javax.annotation.Nullable - public String getPasswordVerifyUrl() { - return passwordVerifyUrl; - } - - public void setPasswordVerifyUrl(String passwordVerifyUrl) { - this.passwordVerifyUrl = passwordVerifyUrl; - } - - - public ProjectConfigSaveReq authSuccessRedirectUrl(String authSuccessRedirectUrl) { - this.authSuccessRedirectUrl = authSuccessRedirectUrl; - return this; - } - - /** - * Get authSuccessRedirectUrl - * @return authSuccessRedirectUrl - **/ - @javax.annotation.Nullable - public String getAuthSuccessRedirectUrl() { - return authSuccessRedirectUrl; - } - - public void setAuthSuccessRedirectUrl(String authSuccessRedirectUrl) { - this.authSuccessRedirectUrl = authSuccessRedirectUrl; - } - - - public ProjectConfigSaveReq passwordResetUrl(String passwordResetUrl) { - this.passwordResetUrl = passwordResetUrl; - return this; - } - - /** - * Get passwordResetUrl - * @return passwordResetUrl - **/ - @javax.annotation.Nullable - public String getPasswordResetUrl() { - return passwordResetUrl; - } - - public void setPasswordResetUrl(String passwordResetUrl) { - this.passwordResetUrl = passwordResetUrl; - } - - - public ProjectConfigSaveReq allowUserRegistration(Boolean allowUserRegistration) { - this.allowUserRegistration = allowUserRegistration; - return this; - } - - /** - * Get allowUserRegistration - * @return allowUserRegistration - **/ - @javax.annotation.Nullable - public Boolean getAllowUserRegistration() { - return allowUserRegistration; - } - - public void setAllowUserRegistration(Boolean allowUserRegistration) { - this.allowUserRegistration = allowUserRegistration; - } - - - public ProjectConfigSaveReq allowIPStickiness(Boolean allowIPStickiness) { - this.allowIPStickiness = allowIPStickiness; - return this; - } - - /** - * Get allowIPStickiness - * @return allowIPStickiness - **/ - @javax.annotation.Nullable - public Boolean getAllowIPStickiness() { - return allowIPStickiness; - } - - public void setAllowIPStickiness(Boolean allowIPStickiness) { - this.allowIPStickiness = allowIPStickiness; - } - - - public ProjectConfigSaveReq passkeyAppendInterval(PasskeyAppendIntervalEnum passkeyAppendInterval) { - this.passkeyAppendInterval = passkeyAppendInterval; - return this; - } - - /** - * Get passkeyAppendInterval - * @return passkeyAppendInterval - **/ - @javax.annotation.Nullable - public PasskeyAppendIntervalEnum getPasskeyAppendInterval() { - return passkeyAppendInterval; - } - - public void setPasskeyAppendInterval(PasskeyAppendIntervalEnum passkeyAppendInterval) { - this.passkeyAppendInterval = passkeyAppendInterval; - } - - - public ProjectConfigSaveReq fallbackLanguage(String fallbackLanguage) { - this.fallbackLanguage = fallbackLanguage; - return this; - } - - /** - * Get fallbackLanguage - * @return fallbackLanguage - **/ - @javax.annotation.Nullable - public String getFallbackLanguage() { - return fallbackLanguage; - } - - public void setFallbackLanguage(String fallbackLanguage) { - this.fallbackLanguage = fallbackLanguage; - } - - - public ProjectConfigSaveReq autoDetectLanguage(Boolean autoDetectLanguage) { - this.autoDetectLanguage = autoDetectLanguage; - return this; - } - - /** - * Get autoDetectLanguage - * @return autoDetectLanguage - **/ - @javax.annotation.Nullable - public Boolean getAutoDetectLanguage() { - return autoDetectLanguage; - } - - public void setAutoDetectLanguage(Boolean autoDetectLanguage) { - this.autoDetectLanguage = autoDetectLanguage; - } - - - public ProjectConfigSaveReq hasExistingUsers(Boolean hasExistingUsers) { - this.hasExistingUsers = hasExistingUsers; - return this; - } - - /** - * Get hasExistingUsers - * @return hasExistingUsers - **/ - @javax.annotation.Nullable - public Boolean getHasExistingUsers() { - return hasExistingUsers; - } - - public void setHasExistingUsers(Boolean hasExistingUsers) { - this.hasExistingUsers = hasExistingUsers; - } - - - public ProjectConfigSaveReq hasVerifiedSession(Boolean hasVerifiedSession) { - this.hasVerifiedSession = hasVerifiedSession; - return this; - } - - /** - * Get hasVerifiedSession - * @return hasVerifiedSession - **/ - @javax.annotation.Nullable - public Boolean getHasVerifiedSession() { - return hasVerifiedSession; - } - - public void setHasVerifiedSession(Boolean hasVerifiedSession) { - this.hasVerifiedSession = hasVerifiedSession; - } - - - public ProjectConfigSaveReq hasGeneratedSession(Boolean hasGeneratedSession) { - this.hasGeneratedSession = hasGeneratedSession; - return this; - } - - /** - * Get hasGeneratedSession - * @return hasGeneratedSession - **/ - @javax.annotation.Nullable - public Boolean getHasGeneratedSession() { - return hasGeneratedSession; - } - - public void setHasGeneratedSession(Boolean hasGeneratedSession) { - this.hasGeneratedSession = hasGeneratedSession; - } - - - public ProjectConfigSaveReq hasStartedUsingPasskeys(Boolean hasStartedUsingPasskeys) { - this.hasStartedUsingPasskeys = hasStartedUsingPasskeys; - return this; - } - - /** - * Get hasStartedUsingPasskeys - * @return hasStartedUsingPasskeys - **/ - @javax.annotation.Nullable - public Boolean getHasStartedUsingPasskeys() { - return hasStartedUsingPasskeys; - } - - public void setHasStartedUsingPasskeys(Boolean hasStartedUsingPasskeys) { - this.hasStartedUsingPasskeys = hasStartedUsingPasskeys; - } - - - public ProjectConfigSaveReq hasStartedUsingSessions(Boolean hasStartedUsingSessions) { - this.hasStartedUsingSessions = hasStartedUsingSessions; - return this; - } - - /** - * Get hasStartedUsingSessions - * @return hasStartedUsingSessions - **/ - @javax.annotation.Nullable - public Boolean getHasStartedUsingSessions() { - return hasStartedUsingSessions; - } - - public void setHasStartedUsingSessions(Boolean hasStartedUsingSessions) { - this.hasStartedUsingSessions = hasStartedUsingSessions; - } - - - public ProjectConfigSaveReq applicationUrl(String applicationUrl) { - this.applicationUrl = applicationUrl; - return this; - } - - /** - * Get applicationUrl - * @return applicationUrl - **/ - @javax.annotation.Nullable - public String getApplicationUrl() { - return applicationUrl; - } - - public void setApplicationUrl(String applicationUrl) { - this.applicationUrl = applicationUrl; - } - - - public ProjectConfigSaveReq useCli(Boolean useCli) { - this.useCli = useCli; - return this; - } - - /** - * Get useCli - * @return useCli - **/ - @javax.annotation.Nullable - public Boolean getUseCli() { - return useCli; - } - - public void setUseCli(Boolean useCli) { - this.useCli = useCli; - } - - - public ProjectConfigSaveReq doubleOptIn(Boolean doubleOptIn) { - this.doubleOptIn = doubleOptIn; - return this; - } - - /** - * Get doubleOptIn - * @return doubleOptIn - **/ - @javax.annotation.Nullable - public Boolean getDoubleOptIn() { - return doubleOptIn; - } - - public void setDoubleOptIn(Boolean doubleOptIn) { - this.doubleOptIn = doubleOptIn; - } - - - public ProjectConfigSaveReq userFullNameRequired(Boolean userFullNameRequired) { - this.userFullNameRequired = userFullNameRequired; - return this; - } - - /** - * Get userFullNameRequired - * @return userFullNameRequired - **/ - @javax.annotation.Nullable - public Boolean getUserFullNameRequired() { - return userFullNameRequired; - } - - public void setUserFullNameRequired(Boolean userFullNameRequired) { - this.userFullNameRequired = userFullNameRequired; - } - - - public ProjectConfigSaveReq webauthnRPID(String webauthnRPID) { - this.webauthnRPID = webauthnRPID; - return this; - } - - /** - * Get webauthnRPID - * @return webauthnRPID - **/ - @javax.annotation.Nullable - public String getWebauthnRPID() { - return webauthnRPID; - } - - public void setWebauthnRPID(String webauthnRPID) { - this.webauthnRPID = webauthnRPID; - } - - - public ProjectConfigSaveReq environment(EnvironmentEnum environment) { - this.environment = environment; - return this; - } - - /** - * Get environment - * @return environment - **/ - @javax.annotation.Nullable - public EnvironmentEnum getEnvironment() { - return environment; - } - - public void setEnvironment(EnvironmentEnum environment) { - this.environment = environment; - } - - - public ProjectConfigSaveReq frontendFramework(FrontendFrameworkEnum frontendFramework) { - this.frontendFramework = frontendFramework; - return this; - } - - /** - * Get frontendFramework - * @return frontendFramework - **/ - @javax.annotation.Nullable - public FrontendFrameworkEnum getFrontendFramework() { - return frontendFramework; - } - - public void setFrontendFramework(FrontendFrameworkEnum frontendFramework) { - this.frontendFramework = frontendFramework; - } - - - public ProjectConfigSaveReq backendLanguage(BackendLanguageEnum backendLanguage) { - this.backendLanguage = backendLanguage; - return this; - } - - /** - * Get backendLanguage - * @return backendLanguage - **/ - @javax.annotation.Nullable - public BackendLanguageEnum getBackendLanguage() { - return backendLanguage; - } - - public void setBackendLanguage(BackendLanguageEnum backendLanguage) { - this.backendLanguage = backendLanguage; - } - - - public ProjectConfigSaveReq webComponentDebug(Boolean webComponentDebug) { - this.webComponentDebug = webComponentDebug; - return this; - } - - /** - * Get webComponentDebug - * @return webComponentDebug - **/ - @javax.annotation.Nullable - public Boolean getWebComponentDebug() { - return webComponentDebug; - } - - public void setWebComponentDebug(Boolean webComponentDebug) { - this.webComponentDebug = webComponentDebug; - } - - - public ProjectConfigSaveReq smtpUseCustom(Boolean smtpUseCustom) { - this.smtpUseCustom = smtpUseCustom; - return this; - } - - /** - * Get smtpUseCustom - * @return smtpUseCustom - **/ - @javax.annotation.Nullable - public Boolean getSmtpUseCustom() { - return smtpUseCustom; - } - - public void setSmtpUseCustom(Boolean smtpUseCustom) { - this.smtpUseCustom = smtpUseCustom; - } - - - public ProjectConfigSaveReq smtpHost(String smtpHost) { - this.smtpHost = smtpHost; - return this; - } - - /** - * Get smtpHost - * @return smtpHost - **/ - @javax.annotation.Nullable - public String getSmtpHost() { - return smtpHost; - } - - public void setSmtpHost(String smtpHost) { - this.smtpHost = smtpHost; - } - - - public ProjectConfigSaveReq smtpPort(Integer smtpPort) { - this.smtpPort = smtpPort; - return this; - } - - /** - * Get smtpPort - * @return smtpPort - **/ - @javax.annotation.Nullable - public Integer getSmtpPort() { - return smtpPort; - } - - public void setSmtpPort(Integer smtpPort) { - this.smtpPort = smtpPort; - } - - - public ProjectConfigSaveReq smtpUsername(String smtpUsername) { - this.smtpUsername = smtpUsername; - return this; - } - - /** - * Get smtpUsername - * @return smtpUsername - **/ - @javax.annotation.Nullable - public String getSmtpUsername() { - return smtpUsername; - } - - public void setSmtpUsername(String smtpUsername) { - this.smtpUsername = smtpUsername; - } - - - public ProjectConfigSaveReq smtpPassword(String smtpPassword) { - this.smtpPassword = smtpPassword; - return this; - } - - /** - * Get smtpPassword - * @return smtpPassword - **/ - @javax.annotation.Nullable - public String getSmtpPassword() { - return smtpPassword; - } - - public void setSmtpPassword(String smtpPassword) { - this.smtpPassword = smtpPassword; - } - - - public ProjectConfigSaveReq supportEmail(String supportEmail) { - this.supportEmail = supportEmail; - return this; - } - - /** - * Get supportEmail - * @return supportEmail - **/ - @javax.annotation.Nullable - public String getSupportEmail() { - return supportEmail; - } - - public void setSupportEmail(String supportEmail) { - this.supportEmail = supportEmail; - } - - - public ProjectConfigSaveReq signupFlow(SignupFlowEnum signupFlow) { - this.signupFlow = signupFlow; - return this; - } - - /** - * Get signupFlow - * @return signupFlow - **/ - @javax.annotation.Nullable - public SignupFlowEnum getSignupFlow() { - return signupFlow; - } - - public void setSignupFlow(SignupFlowEnum signupFlow) { - this.signupFlow = signupFlow; - } - - - public ProjectConfigSaveReq signupFlowOptions(Object signupFlowOptions) { - this.signupFlowOptions = signupFlowOptions; - return this; - } - - /** - * Get signupFlowOptions - * @return signupFlowOptions - **/ - @javax.annotation.Nullable - public Object getSignupFlowOptions() { - return signupFlowOptions; - } - - public void setSignupFlowOptions(Object signupFlowOptions) { - this.signupFlowOptions = signupFlowOptions; - } - - - public ProjectConfigSaveReq loginFlow(LoginFlowEnum loginFlow) { - this.loginFlow = loginFlow; - return this; - } - - /** - * Get loginFlow - * @return loginFlow - **/ - @javax.annotation.Nullable - public LoginFlowEnum getLoginFlow() { - return loginFlow; - } - - public void setLoginFlow(LoginFlowEnum loginFlow) { - this.loginFlow = loginFlow; - } - - - public ProjectConfigSaveReq loginFlowOptions(Object loginFlowOptions) { - this.loginFlowOptions = loginFlowOptions; - return this; - } - - /** - * Get loginFlowOptions - * @return loginFlowOptions - **/ - @javax.annotation.Nullable - public Object getLoginFlowOptions() { - return loginFlowOptions; - } - - public void setLoginFlowOptions(Object loginFlowOptions) { - this.loginFlowOptions = loginFlowOptions; - } - - - public ProjectConfigSaveReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public ProjectConfigSaveReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - public ProjectConfigSaveReq allowStaticChallenges(Boolean allowStaticChallenges) { - this.allowStaticChallenges = allowStaticChallenges; - return this; - } - - /** - * Get allowStaticChallenges - * @return allowStaticChallenges - **/ - @javax.annotation.Nullable - public Boolean getAllowStaticChallenges() { - return allowStaticChallenges; - } - - public void setAllowStaticChallenges(Boolean allowStaticChallenges) { - this.allowStaticChallenges = allowStaticChallenges; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectConfigSaveReq projectConfigSaveReq = (ProjectConfigSaveReq) o; - return Objects.equals(this.externalName, projectConfigSaveReq.externalName) && - Objects.equals(this.appType, projectConfigSaveReq.appType) && - Objects.equals(this.productKey, projectConfigSaveReq.productKey) && - Objects.equals(this.emailFrom, projectConfigSaveReq.emailFrom) && - Objects.equals(this.smsFrom, projectConfigSaveReq.smsFrom) && - Objects.equals(this.externalApplicationProtocolVersion, projectConfigSaveReq.externalApplicationProtocolVersion) && - Objects.equals(this.webhookURL, projectConfigSaveReq.webhookURL) && - Objects.equals(this.webhookActions, projectConfigSaveReq.webhookActions) && - Objects.equals(this.webhookUsername, projectConfigSaveReq.webhookUsername) && - Objects.equals(this.webhookPassword, projectConfigSaveReq.webhookPassword) && - Objects.equals(this.webhookTestInvalidUsername, projectConfigSaveReq.webhookTestInvalidUsername) && - Objects.equals(this.webhookTestValidUsername, projectConfigSaveReq.webhookTestValidUsername) && - Objects.equals(this.webhookTestValidPassword, projectConfigSaveReq.webhookTestValidPassword) && - Objects.equals(this.externalApplicationUsername, projectConfigSaveReq.externalApplicationUsername) && - Objects.equals(this.externalApplicationPassword, projectConfigSaveReq.externalApplicationPassword) && - Objects.equals(this.legacyAuthMethodsUrl, projectConfigSaveReq.legacyAuthMethodsUrl) && - Objects.equals(this.passwordVerifyUrl, projectConfigSaveReq.passwordVerifyUrl) && - Objects.equals(this.authSuccessRedirectUrl, projectConfigSaveReq.authSuccessRedirectUrl) && - Objects.equals(this.passwordResetUrl, projectConfigSaveReq.passwordResetUrl) && - Objects.equals(this.allowUserRegistration, projectConfigSaveReq.allowUserRegistration) && - Objects.equals(this.allowIPStickiness, projectConfigSaveReq.allowIPStickiness) && - Objects.equals(this.passkeyAppendInterval, projectConfigSaveReq.passkeyAppendInterval) && - Objects.equals(this.fallbackLanguage, projectConfigSaveReq.fallbackLanguage) && - Objects.equals(this.autoDetectLanguage, projectConfigSaveReq.autoDetectLanguage) && - Objects.equals(this.hasExistingUsers, projectConfigSaveReq.hasExistingUsers) && - Objects.equals(this.hasVerifiedSession, projectConfigSaveReq.hasVerifiedSession) && - Objects.equals(this.hasGeneratedSession, projectConfigSaveReq.hasGeneratedSession) && - Objects.equals(this.hasStartedUsingPasskeys, projectConfigSaveReq.hasStartedUsingPasskeys) && - Objects.equals(this.hasStartedUsingSessions, projectConfigSaveReq.hasStartedUsingSessions) && - Objects.equals(this.applicationUrl, projectConfigSaveReq.applicationUrl) && - Objects.equals(this.useCli, projectConfigSaveReq.useCli) && - Objects.equals(this.doubleOptIn, projectConfigSaveReq.doubleOptIn) && - Objects.equals(this.userFullNameRequired, projectConfigSaveReq.userFullNameRequired) && - Objects.equals(this.webauthnRPID, projectConfigSaveReq.webauthnRPID) && - Objects.equals(this.environment, projectConfigSaveReq.environment) && - Objects.equals(this.frontendFramework, projectConfigSaveReq.frontendFramework) && - Objects.equals(this.backendLanguage, projectConfigSaveReq.backendLanguage) && - Objects.equals(this.webComponentDebug, projectConfigSaveReq.webComponentDebug) && - Objects.equals(this.smtpUseCustom, projectConfigSaveReq.smtpUseCustom) && - Objects.equals(this.smtpHost, projectConfigSaveReq.smtpHost) && - Objects.equals(this.smtpPort, projectConfigSaveReq.smtpPort) && - Objects.equals(this.smtpUsername, projectConfigSaveReq.smtpUsername) && - Objects.equals(this.smtpPassword, projectConfigSaveReq.smtpPassword) && - Objects.equals(this.supportEmail, projectConfigSaveReq.supportEmail) && - Objects.equals(this.signupFlow, projectConfigSaveReq.signupFlow) && - Objects.equals(this.signupFlowOptions, projectConfigSaveReq.signupFlowOptions) && - Objects.equals(this.loginFlow, projectConfigSaveReq.loginFlow) && - Objects.equals(this.loginFlowOptions, projectConfigSaveReq.loginFlowOptions) && - Objects.equals(this.requestID, projectConfigSaveReq.requestID) && - Objects.equals(this.clientInfo, projectConfigSaveReq.clientInfo) && - Objects.equals(this.allowStaticChallenges, projectConfigSaveReq.allowStaticChallenges); - } - - @Override - public int hashCode() { - return Objects.hash(externalName, appType, productKey, emailFrom, smsFrom, externalApplicationProtocolVersion, webhookURL, webhookActions, webhookUsername, webhookPassword, webhookTestInvalidUsername, webhookTestValidUsername, webhookTestValidPassword, externalApplicationUsername, externalApplicationPassword, legacyAuthMethodsUrl, passwordVerifyUrl, authSuccessRedirectUrl, passwordResetUrl, allowUserRegistration, allowIPStickiness, passkeyAppendInterval, fallbackLanguage, autoDetectLanguage, hasExistingUsers, hasVerifiedSession, hasGeneratedSession, hasStartedUsingPasskeys, hasStartedUsingSessions, applicationUrl, useCli, doubleOptIn, userFullNameRequired, webauthnRPID, environment, frontendFramework, backendLanguage, webComponentDebug, smtpUseCustom, smtpHost, smtpPort, smtpUsername, smtpPassword, supportEmail, signupFlow, signupFlowOptions, loginFlow, loginFlowOptions, requestID, clientInfo, allowStaticChallenges); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProjectConfigSaveReq {\n"); - sb.append(" externalName: ").append(toIndentedString(externalName)).append("\n"); - sb.append(" appType: ").append(toIndentedString(appType)).append("\n"); - sb.append(" productKey: ").append(toIndentedString(productKey)).append("\n"); - sb.append(" emailFrom: ").append(toIndentedString(emailFrom)).append("\n"); - sb.append(" smsFrom: ").append(toIndentedString(smsFrom)).append("\n"); - sb.append(" externalApplicationProtocolVersion: ").append(toIndentedString(externalApplicationProtocolVersion)).append("\n"); - sb.append(" webhookURL: ").append(toIndentedString(webhookURL)).append("\n"); - sb.append(" webhookActions: ").append(toIndentedString(webhookActions)).append("\n"); - sb.append(" webhookUsername: ").append(toIndentedString(webhookUsername)).append("\n"); - sb.append(" webhookPassword: ").append(toIndentedString(webhookPassword)).append("\n"); - sb.append(" webhookTestInvalidUsername: ").append(toIndentedString(webhookTestInvalidUsername)).append("\n"); - sb.append(" webhookTestValidUsername: ").append(toIndentedString(webhookTestValidUsername)).append("\n"); - sb.append(" webhookTestValidPassword: ").append(toIndentedString(webhookTestValidPassword)).append("\n"); - sb.append(" externalApplicationUsername: ").append(toIndentedString(externalApplicationUsername)).append("\n"); - sb.append(" externalApplicationPassword: ").append(toIndentedString(externalApplicationPassword)).append("\n"); - sb.append(" legacyAuthMethodsUrl: ").append(toIndentedString(legacyAuthMethodsUrl)).append("\n"); - sb.append(" passwordVerifyUrl: ").append(toIndentedString(passwordVerifyUrl)).append("\n"); - sb.append(" authSuccessRedirectUrl: ").append(toIndentedString(authSuccessRedirectUrl)).append("\n"); - sb.append(" passwordResetUrl: ").append(toIndentedString(passwordResetUrl)).append("\n"); - sb.append(" allowUserRegistration: ").append(toIndentedString(allowUserRegistration)).append("\n"); - sb.append(" allowIPStickiness: ").append(toIndentedString(allowIPStickiness)).append("\n"); - sb.append(" passkeyAppendInterval: ").append(toIndentedString(passkeyAppendInterval)).append("\n"); - sb.append(" fallbackLanguage: ").append(toIndentedString(fallbackLanguage)).append("\n"); - sb.append(" autoDetectLanguage: ").append(toIndentedString(autoDetectLanguage)).append("\n"); - sb.append(" hasExistingUsers: ").append(toIndentedString(hasExistingUsers)).append("\n"); - sb.append(" hasVerifiedSession: ").append(toIndentedString(hasVerifiedSession)).append("\n"); - sb.append(" hasGeneratedSession: ").append(toIndentedString(hasGeneratedSession)).append("\n"); - sb.append(" hasStartedUsingPasskeys: ").append(toIndentedString(hasStartedUsingPasskeys)).append("\n"); - sb.append(" hasStartedUsingSessions: ").append(toIndentedString(hasStartedUsingSessions)).append("\n"); - sb.append(" applicationUrl: ").append(toIndentedString(applicationUrl)).append("\n"); - sb.append(" useCli: ").append(toIndentedString(useCli)).append("\n"); - sb.append(" doubleOptIn: ").append(toIndentedString(doubleOptIn)).append("\n"); - sb.append(" userFullNameRequired: ").append(toIndentedString(userFullNameRequired)).append("\n"); - sb.append(" webauthnRPID: ").append(toIndentedString(webauthnRPID)).append("\n"); - sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); - sb.append(" frontendFramework: ").append(toIndentedString(frontendFramework)).append("\n"); - sb.append(" backendLanguage: ").append(toIndentedString(backendLanguage)).append("\n"); - sb.append(" webComponentDebug: ").append(toIndentedString(webComponentDebug)).append("\n"); - sb.append(" smtpUseCustom: ").append(toIndentedString(smtpUseCustom)).append("\n"); - sb.append(" smtpHost: ").append(toIndentedString(smtpHost)).append("\n"); - sb.append(" smtpPort: ").append(toIndentedString(smtpPort)).append("\n"); - sb.append(" smtpUsername: ").append(toIndentedString(smtpUsername)).append("\n"); - sb.append(" smtpPassword: ").append(toIndentedString(smtpPassword)).append("\n"); - sb.append(" supportEmail: ").append(toIndentedString(supportEmail)).append("\n"); - sb.append(" signupFlow: ").append(toIndentedString(signupFlow)).append("\n"); - sb.append(" signupFlowOptions: ").append(toIndentedString(signupFlowOptions)).append("\n"); - sb.append(" loginFlow: ").append(toIndentedString(loginFlow)).append("\n"); - sb.append(" loginFlowOptions: ").append(toIndentedString(loginFlowOptions)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append(" allowStaticChallenges: ").append(toIndentedString(allowStaticChallenges)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("externalName"); - openapiFields.add("appType"); - openapiFields.add("productKey"); - openapiFields.add("emailFrom"); - openapiFields.add("smsFrom"); - openapiFields.add("externalApplicationProtocolVersion"); - openapiFields.add("webhookURL"); - openapiFields.add("webhookActions"); - openapiFields.add("webhookUsername"); - openapiFields.add("webhookPassword"); - openapiFields.add("webhookTestInvalidUsername"); - openapiFields.add("webhookTestValidUsername"); - openapiFields.add("webhookTestValidPassword"); - openapiFields.add("externalApplicationUsername"); - openapiFields.add("externalApplicationPassword"); - openapiFields.add("legacyAuthMethodsUrl"); - openapiFields.add("passwordVerifyUrl"); - openapiFields.add("authSuccessRedirectUrl"); - openapiFields.add("passwordResetUrl"); - openapiFields.add("allowUserRegistration"); - openapiFields.add("allowIPStickiness"); - openapiFields.add("passkeyAppendInterval"); - openapiFields.add("fallbackLanguage"); - openapiFields.add("autoDetectLanguage"); - openapiFields.add("hasExistingUsers"); - openapiFields.add("hasVerifiedSession"); - openapiFields.add("hasGeneratedSession"); - openapiFields.add("hasStartedUsingPasskeys"); - openapiFields.add("hasStartedUsingSessions"); - openapiFields.add("applicationUrl"); - openapiFields.add("useCli"); - openapiFields.add("doubleOptIn"); - openapiFields.add("userFullNameRequired"); - openapiFields.add("webauthnRPID"); - openapiFields.add("environment"); - openapiFields.add("frontendFramework"); - openapiFields.add("backendLanguage"); - openapiFields.add("webComponentDebug"); - openapiFields.add("smtpUseCustom"); - openapiFields.add("smtpHost"); - openapiFields.add("smtpPort"); - openapiFields.add("smtpUsername"); - openapiFields.add("smtpPassword"); - openapiFields.add("supportEmail"); - openapiFields.add("signupFlow"); - openapiFields.add("signupFlowOptions"); - openapiFields.add("loginFlow"); - openapiFields.add("loginFlowOptions"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - openapiFields.add("allowStaticChallenges"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ProjectConfigSaveReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ProjectConfigSaveReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectConfigSaveReq is not found in the empty JSON string", ProjectConfigSaveReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ProjectConfigSaveReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectConfigSaveReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("externalName") != null && !jsonObj.get("externalName").isJsonNull()) && !jsonObj.get("externalName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalName").toString())); - } - // validate the optional field `appType` - if (jsonObj.get("appType") != null && !jsonObj.get("appType").isJsonNull()) { - AppType.validateJsonElement(jsonObj.get("appType")); - } - if ((jsonObj.get("productKey") != null && !jsonObj.get("productKey").isJsonNull()) && !jsonObj.get("productKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `productKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productKey").toString())); - } - if ((jsonObj.get("emailFrom") != null && !jsonObj.get("emailFrom").isJsonNull()) && !jsonObj.get("emailFrom").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `emailFrom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailFrom").toString())); - } - if ((jsonObj.get("smsFrom") != null && !jsonObj.get("smsFrom").isJsonNull()) && !jsonObj.get("smsFrom").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `smsFrom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smsFrom").toString())); - } - if ((jsonObj.get("externalApplicationProtocolVersion") != null && !jsonObj.get("externalApplicationProtocolVersion").isJsonNull()) && !jsonObj.get("externalApplicationProtocolVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalApplicationProtocolVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalApplicationProtocolVersion").toString())); - } - // validate the optional field `externalApplicationProtocolVersion` - if (jsonObj.get("externalApplicationProtocolVersion") != null && !jsonObj.get("externalApplicationProtocolVersion").isJsonNull()) { - ExternalApplicationProtocolVersionEnum.validateJsonElement(jsonObj.get("externalApplicationProtocolVersion")); - } - if ((jsonObj.get("webhookURL") != null && !jsonObj.get("webhookURL").isJsonNull()) && !jsonObj.get("webhookURL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webhookURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookURL").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("webhookActions") != null && !jsonObj.get("webhookActions").isJsonNull() && !jsonObj.get("webhookActions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `webhookActions` to be an array in the JSON string but got `%s`", jsonObj.get("webhookActions").toString())); - } - if ((jsonObj.get("webhookUsername") != null && !jsonObj.get("webhookUsername").isJsonNull()) && !jsonObj.get("webhookUsername").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webhookUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookUsername").toString())); - } - if ((jsonObj.get("webhookPassword") != null && !jsonObj.get("webhookPassword").isJsonNull()) && !jsonObj.get("webhookPassword").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webhookPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookPassword").toString())); - } - if ((jsonObj.get("webhookTestInvalidUsername") != null && !jsonObj.get("webhookTestInvalidUsername").isJsonNull()) && !jsonObj.get("webhookTestInvalidUsername").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webhookTestInvalidUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookTestInvalidUsername").toString())); - } - if ((jsonObj.get("webhookTestValidUsername") != null && !jsonObj.get("webhookTestValidUsername").isJsonNull()) && !jsonObj.get("webhookTestValidUsername").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webhookTestValidUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookTestValidUsername").toString())); - } - if ((jsonObj.get("webhookTestValidPassword") != null && !jsonObj.get("webhookTestValidPassword").isJsonNull()) && !jsonObj.get("webhookTestValidPassword").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webhookTestValidPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookTestValidPassword").toString())); - } - if ((jsonObj.get("externalApplicationUsername") != null && !jsonObj.get("externalApplicationUsername").isJsonNull()) && !jsonObj.get("externalApplicationUsername").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalApplicationUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalApplicationUsername").toString())); - } - if ((jsonObj.get("externalApplicationPassword") != null && !jsonObj.get("externalApplicationPassword").isJsonNull()) && !jsonObj.get("externalApplicationPassword").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalApplicationPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalApplicationPassword").toString())); - } - if ((jsonObj.get("legacyAuthMethodsUrl") != null && !jsonObj.get("legacyAuthMethodsUrl").isJsonNull()) && !jsonObj.get("legacyAuthMethodsUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `legacyAuthMethodsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legacyAuthMethodsUrl").toString())); - } - if ((jsonObj.get("passwordVerifyUrl") != null && !jsonObj.get("passwordVerifyUrl").isJsonNull()) && !jsonObj.get("passwordVerifyUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `passwordVerifyUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passwordVerifyUrl").toString())); - } - if ((jsonObj.get("authSuccessRedirectUrl") != null && !jsonObj.get("authSuccessRedirectUrl").isJsonNull()) && !jsonObj.get("authSuccessRedirectUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authSuccessRedirectUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authSuccessRedirectUrl").toString())); - } - if ((jsonObj.get("passwordResetUrl") != null && !jsonObj.get("passwordResetUrl").isJsonNull()) && !jsonObj.get("passwordResetUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `passwordResetUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passwordResetUrl").toString())); - } - if ((jsonObj.get("passkeyAppendInterval") != null && !jsonObj.get("passkeyAppendInterval").isJsonNull()) && !jsonObj.get("passkeyAppendInterval").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `passkeyAppendInterval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passkeyAppendInterval").toString())); - } - // validate the optional field `passkeyAppendInterval` - if (jsonObj.get("passkeyAppendInterval") != null && !jsonObj.get("passkeyAppendInterval").isJsonNull()) { - PasskeyAppendIntervalEnum.validateJsonElement(jsonObj.get("passkeyAppendInterval")); - } - if ((jsonObj.get("fallbackLanguage") != null && !jsonObj.get("fallbackLanguage").isJsonNull()) && !jsonObj.get("fallbackLanguage").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fallbackLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fallbackLanguage").toString())); - } - if ((jsonObj.get("applicationUrl") != null && !jsonObj.get("applicationUrl").isJsonNull()) && !jsonObj.get("applicationUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `applicationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applicationUrl").toString())); - } - if ((jsonObj.get("webauthnRPID") != null && !jsonObj.get("webauthnRPID").isJsonNull()) && !jsonObj.get("webauthnRPID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webauthnRPID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webauthnRPID").toString())); - } - if ((jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonNull()) && !jsonObj.get("environment").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `environment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environment").toString())); - } - // validate the optional field `environment` - if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonNull()) { - EnvironmentEnum.validateJsonElement(jsonObj.get("environment")); - } - if ((jsonObj.get("frontendFramework") != null && !jsonObj.get("frontendFramework").isJsonNull()) && !jsonObj.get("frontendFramework").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `frontendFramework` to be a primitive type in the JSON string but got `%s`", jsonObj.get("frontendFramework").toString())); - } - // validate the optional field `frontendFramework` - if (jsonObj.get("frontendFramework") != null && !jsonObj.get("frontendFramework").isJsonNull()) { - FrontendFrameworkEnum.validateJsonElement(jsonObj.get("frontendFramework")); - } - if ((jsonObj.get("backendLanguage") != null && !jsonObj.get("backendLanguage").isJsonNull()) && !jsonObj.get("backendLanguage").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `backendLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("backendLanguage").toString())); - } - // validate the optional field `backendLanguage` - if (jsonObj.get("backendLanguage") != null && !jsonObj.get("backendLanguage").isJsonNull()) { - BackendLanguageEnum.validateJsonElement(jsonObj.get("backendLanguage")); - } - if ((jsonObj.get("smtpHost") != null && !jsonObj.get("smtpHost").isJsonNull()) && !jsonObj.get("smtpHost").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `smtpHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpHost").toString())); - } - if ((jsonObj.get("smtpUsername") != null && !jsonObj.get("smtpUsername").isJsonNull()) && !jsonObj.get("smtpUsername").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `smtpUsername` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpUsername").toString())); - } - if ((jsonObj.get("smtpPassword") != null && !jsonObj.get("smtpPassword").isJsonNull()) && !jsonObj.get("smtpPassword").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `smtpPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smtpPassword").toString())); - } - if ((jsonObj.get("supportEmail") != null && !jsonObj.get("supportEmail").isJsonNull()) && !jsonObj.get("supportEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `supportEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("supportEmail").toString())); - } - if ((jsonObj.get("signupFlow") != null && !jsonObj.get("signupFlow").isJsonNull()) && !jsonObj.get("signupFlow").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `signupFlow` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signupFlow").toString())); - } - // validate the optional field `signupFlow` - if (jsonObj.get("signupFlow") != null && !jsonObj.get("signupFlow").isJsonNull()) { - SignupFlowEnum.validateJsonElement(jsonObj.get("signupFlow")); - } - if ((jsonObj.get("loginFlow") != null && !jsonObj.get("loginFlow").isJsonNull()) && !jsonObj.get("loginFlow").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `loginFlow` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginFlow").toString())); - } - // validate the optional field `loginFlow` - if (jsonObj.get("loginFlow") != null && !jsonObj.get("loginFlow").isJsonNull()) { - LoginFlowEnum.validateJsonElement(jsonObj.get("loginFlow")); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProjectConfigSaveReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProjectConfigSaveReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProjectConfigSaveReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ProjectConfigSaveReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ProjectConfigSaveReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ProjectConfigSaveReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of ProjectConfigSaveReq - * @throws IOException if the JSON string is invalid with respect to ProjectConfigSaveReq - */ - public static ProjectConfigSaveReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProjectConfigSaveReq.class); - } - - /** - * Convert an instance of ProjectConfigSaveReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java b/src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java new file mode 100644 index 0000000..b8d706d --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ProjectConfigUpdateCnameReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class ProjectConfigUpdateCnameReq { + public static final String SERIALIZED_NAME_CNAME = "cname"; + @SerializedName(SERIALIZED_NAME_CNAME) + private String cname; + + public ProjectConfigUpdateCnameReq() { + } + + public ProjectConfigUpdateCnameReq cname(String cname) { + this.cname = cname; + return this; + } + + /** + * Get cname + * @return cname + */ + @javax.annotation.Nonnull + public String getCname() { + return cname; + } + + public void setCname(String cname) { + this.cname = cname; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectConfigUpdateCnameReq projectConfigUpdateCnameReq = (ProjectConfigUpdateCnameReq) o; + return Objects.equals(this.cname, projectConfigUpdateCnameReq.cname); + } + + @Override + public int hashCode() { + return Objects.hash(cname); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectConfigUpdateCnameReq {\n"); + sb.append(" cname: ").append(toIndentedString(cname)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cname"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("cname"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ProjectConfigUpdateCnameReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProjectConfigUpdateCnameReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectConfigUpdateCnameReq is not found in the empty JSON string", ProjectConfigUpdateCnameReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ProjectConfigUpdateCnameReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectConfigUpdateCnameReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProjectConfigUpdateCnameReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("cname").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cname` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cname").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ProjectConfigUpdateCnameReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProjectConfigUpdateCnameReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProjectConfigUpdateCnameReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ProjectConfigUpdateCnameReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ProjectConfigUpdateCnameReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProjectConfigUpdateCnameReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProjectConfigUpdateCnameReq + * @throws IOException if the JSON string is invalid with respect to ProjectConfigUpdateCnameReq + */ + public static ProjectConfigUpdateCnameReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProjectConfigUpdateCnameReq.class); + } + + /** + * Convert an instance of ProjectConfigUpdateCnameReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestReq.java b/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestReq.java deleted file mode 100644 index 8bf71bb..0000000 --- a/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestReq.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ProjectConfigWebhookTestReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ProjectConfigWebhookTestReq { - /** - * Gets or Sets action - */ - @JsonAdapter(ActionEnum.Adapter.class) - public enum ActionEnum { - AUTH_METHODS("authMethods"), - - PASSWORD_VERIFY("passwordVerify"); - - private String value; - - ActionEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ActionEnum fromValue(String value) { - for (ActionEnum b : ActionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ActionEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ActionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ActionEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ActionEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_ACTION = "action"; - @SerializedName(SERIALIZED_NAME_ACTION) - private ActionEnum action; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public ProjectConfigWebhookTestReq() { - } - - public ProjectConfigWebhookTestReq action(ActionEnum action) { - this.action = action; - return this; - } - - /** - * Get action - * @return action - **/ - @javax.annotation.Nonnull - public ActionEnum getAction() { - return action; - } - - public void setAction(ActionEnum action) { - this.action = action; - } - - - public ProjectConfigWebhookTestReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public ProjectConfigWebhookTestReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectConfigWebhookTestReq projectConfigWebhookTestReq = (ProjectConfigWebhookTestReq) o; - return Objects.equals(this.action, projectConfigWebhookTestReq.action) && - Objects.equals(this.requestID, projectConfigWebhookTestReq.requestID) && - Objects.equals(this.clientInfo, projectConfigWebhookTestReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(action, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProjectConfigWebhookTestReq {\n"); - sb.append(" action: ").append(toIndentedString(action)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("action"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("action"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ProjectConfigWebhookTestReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ProjectConfigWebhookTestReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectConfigWebhookTestReq is not found in the empty JSON string", ProjectConfigWebhookTestReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ProjectConfigWebhookTestReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectConfigWebhookTestReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ProjectConfigWebhookTestReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("action").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString())); - } - // validate the required field `action` - ActionEnum.validateJsonElement(jsonObj.get("action")); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProjectConfigWebhookTestReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProjectConfigWebhookTestReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProjectConfigWebhookTestReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ProjectConfigWebhookTestReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ProjectConfigWebhookTestReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ProjectConfigWebhookTestReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of ProjectConfigWebhookTestReq - * @throws IOException if the JSON string is invalid with respect to ProjectConfigWebhookTestReq - */ - public static ProjectConfigWebhookTestReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProjectConfigWebhookTestReq.class); - } - - /** - * Convert an instance of ProjectConfigWebhookTestReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRsp.java b/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRsp.java deleted file mode 100644 index 5dfe28c..0000000 --- a/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ProjectConfigWebhookTestRspAllOfData; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ProjectConfigWebhookTestRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ProjectConfigWebhookTestRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private ProjectConfigWebhookTestRspAllOfData data; - - public ProjectConfigWebhookTestRsp() { - } - - public ProjectConfigWebhookTestRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public ProjectConfigWebhookTestRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public ProjectConfigWebhookTestRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public ProjectConfigWebhookTestRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public ProjectConfigWebhookTestRsp data(ProjectConfigWebhookTestRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public ProjectConfigWebhookTestRspAllOfData getData() { - return data; - } - - public void setData(ProjectConfigWebhookTestRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectConfigWebhookTestRsp projectConfigWebhookTestRsp = (ProjectConfigWebhookTestRsp) o; - return Objects.equals(this.httpStatusCode, projectConfigWebhookTestRsp.httpStatusCode) && - Objects.equals(this.message, projectConfigWebhookTestRsp.message) && - Objects.equals(this.requestData, projectConfigWebhookTestRsp.requestData) && - Objects.equals(this.runtime, projectConfigWebhookTestRsp.runtime) && - Objects.equals(this.data, projectConfigWebhookTestRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProjectConfigWebhookTestRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ProjectConfigWebhookTestRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ProjectConfigWebhookTestRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectConfigWebhookTestRsp is not found in the empty JSON string", ProjectConfigWebhookTestRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ProjectConfigWebhookTestRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectConfigWebhookTestRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ProjectConfigWebhookTestRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - ProjectConfigWebhookTestRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProjectConfigWebhookTestRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProjectConfigWebhookTestRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProjectConfigWebhookTestRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ProjectConfigWebhookTestRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ProjectConfigWebhookTestRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ProjectConfigWebhookTestRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of ProjectConfigWebhookTestRsp - * @throws IOException if the JSON string is invalid with respect to ProjectConfigWebhookTestRsp - */ - public static ProjectConfigWebhookTestRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProjectConfigWebhookTestRsp.class); - } - - /** - * Convert an instance of ProjectConfigWebhookTestRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRspAllOfData.java b/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRspAllOfData.java deleted file mode 100644 index aa8bb6a..0000000 --- a/src/main/java/com/corbado/generated/model/ProjectConfigWebhookTestRspAllOfData.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ProjectConfigWebhookTestRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ProjectConfigWebhookTestRspAllOfData { - public static final String SERIALIZED_NAME_CODE = "code"; - @SerializedName(SERIALIZED_NAME_CODE) - private String code; - - public static final String SERIALIZED_NAME_DETAILS = "details"; - @SerializedName(SERIALIZED_NAME_DETAILS) - private String details; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private BigDecimal runtime; - - public ProjectConfigWebhookTestRspAllOfData() { - } - - public ProjectConfigWebhookTestRspAllOfData code(String code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - **/ - @javax.annotation.Nonnull - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - - public ProjectConfigWebhookTestRspAllOfData details(String details) { - this.details = details; - return this; - } - - /** - * Get details - * @return details - **/ - @javax.annotation.Nonnull - public String getDetails() { - return details; - } - - public void setDetails(String details) { - this.details = details; - } - - - public ProjectConfigWebhookTestRspAllOfData runtime(BigDecimal runtime) { - this.runtime = runtime; - return this; - } - - /** - * Get runtime - * @return runtime - **/ - @javax.annotation.Nonnull - public BigDecimal getRuntime() { - return runtime; - } - - public void setRuntime(BigDecimal runtime) { - this.runtime = runtime; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectConfigWebhookTestRspAllOfData projectConfigWebhookTestRspAllOfData = (ProjectConfigWebhookTestRspAllOfData) o; - return Objects.equals(this.code, projectConfigWebhookTestRspAllOfData.code) && - Objects.equals(this.details, projectConfigWebhookTestRspAllOfData.details) && - Objects.equals(this.runtime, projectConfigWebhookTestRspAllOfData.runtime); - } - - @Override - public int hashCode() { - return Objects.hash(code, details, runtime); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProjectConfigWebhookTestRspAllOfData {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("code"); - openapiFields.add("details"); - openapiFields.add("runtime"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("code"); - openapiRequiredFields.add("details"); - openapiRequiredFields.add("runtime"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ProjectConfigWebhookTestRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ProjectConfigWebhookTestRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectConfigWebhookTestRspAllOfData is not found in the empty JSON string", ProjectConfigWebhookTestRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ProjectConfigWebhookTestRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectConfigWebhookTestRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ProjectConfigWebhookTestRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); - } - if (!jsonObj.get("details").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `details` to be a primitive type in the JSON string but got `%s`", jsonObj.get("details").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProjectConfigWebhookTestRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProjectConfigWebhookTestRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProjectConfigWebhookTestRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ProjectConfigWebhookTestRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ProjectConfigWebhookTestRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ProjectConfigWebhookTestRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of ProjectConfigWebhookTestRspAllOfData - * @throws IOException if the JSON string is invalid with respect to ProjectConfigWebhookTestRspAllOfData - */ - public static ProjectConfigWebhookTestRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProjectConfigWebhookTestRspAllOfData.class); - } - - /** - * Convert an instance of ProjectConfigWebhookTestRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ProjectSecretCreateReq.java b/src/main/java/com/corbado/generated/model/ProjectSecretCreateReq.java deleted file mode 100644 index 314ff40..0000000 --- a/src/main/java/com/corbado/generated/model/ProjectSecretCreateReq.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ProjectSecretCreateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ProjectSecretCreateReq { - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public ProjectSecretCreateReq() { - } - - public ProjectSecretCreateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public ProjectSecretCreateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectSecretCreateReq projectSecretCreateReq = (ProjectSecretCreateReq) o; - return Objects.equals(this.requestID, projectSecretCreateReq.requestID) && - Objects.equals(this.clientInfo, projectSecretCreateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProjectSecretCreateReq {\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ProjectSecretCreateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ProjectSecretCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectSecretCreateReq is not found in the empty JSON string", ProjectSecretCreateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ProjectSecretCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectSecretCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProjectSecretCreateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProjectSecretCreateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProjectSecretCreateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ProjectSecretCreateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ProjectSecretCreateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ProjectSecretCreateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of ProjectSecretCreateReq - * @throws IOException if the JSON string is invalid with respect to ProjectSecretCreateReq - */ - public static ProjectSecretCreateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProjectSecretCreateReq.class); - } - - /** - * Convert an instance of ProjectSecretCreateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ProjectSecretCreateRsp.java b/src/main/java/com/corbado/generated/model/ProjectSecretCreateRsp.java deleted file mode 100644 index 0c72f48..0000000 --- a/src/main/java/com/corbado/generated/model/ProjectSecretCreateRsp.java +++ /dev/null @@ -1,419 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ProjectSecretCreateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ProjectSecretCreateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SECRET = "secret"; - @SerializedName(SERIALIZED_NAME_SECRET) - private String secret; - - public static final String SERIALIZED_NAME_HINT = "hint"; - @SerializedName(SERIALIZED_NAME_HINT) - private String hint; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public ProjectSecretCreateRsp() { - } - - public ProjectSecretCreateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public ProjectSecretCreateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public ProjectSecretCreateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public ProjectSecretCreateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public ProjectSecretCreateRsp id(String id) { - this.id = id; - return this; - } - - /** - * ID of project secret - * @return id - **/ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public ProjectSecretCreateRsp secret(String secret) { - this.secret = secret; - return this; - } - - /** - * Server-side generated secret. Only filled on create - * @return secret - **/ - @javax.annotation.Nullable - public String getSecret() { - return secret; - } - - public void setSecret(String secret) { - this.secret = secret; - } - - - public ProjectSecretCreateRsp hint(String hint) { - this.hint = hint; - return this; - } - - /** - * Hint of the server-side generated secret. First 3 characters and last 3 characters - * @return hint - **/ - @javax.annotation.Nonnull - public String getHint() { - return hint; - } - - public void setHint(String hint) { - this.hint = hint; - } - - - public ProjectSecretCreateRsp created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectSecretCreateRsp projectSecretCreateRsp = (ProjectSecretCreateRsp) o; - return Objects.equals(this.httpStatusCode, projectSecretCreateRsp.httpStatusCode) && - Objects.equals(this.message, projectSecretCreateRsp.message) && - Objects.equals(this.requestData, projectSecretCreateRsp.requestData) && - Objects.equals(this.runtime, projectSecretCreateRsp.runtime) && - Objects.equals(this.id, projectSecretCreateRsp.id) && - Objects.equals(this.secret, projectSecretCreateRsp.secret) && - Objects.equals(this.hint, projectSecretCreateRsp.hint) && - Objects.equals(this.created, projectSecretCreateRsp.created); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, id, secret, hint, created); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProjectSecretCreateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); - sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("id"); - openapiFields.add("secret"); - openapiFields.add("hint"); - openapiFields.add("created"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("hint"); - openapiRequiredFields.add("created"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ProjectSecretCreateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ProjectSecretCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectSecretCreateRsp is not found in the empty JSON string", ProjectSecretCreateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ProjectSecretCreateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectSecretCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ProjectSecretCreateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if ((jsonObj.get("secret") != null && !jsonObj.get("secret").isJsonNull()) && !jsonObj.get("secret").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); - } - if (!jsonObj.get("hint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProjectSecretCreateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProjectSecretCreateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProjectSecretCreateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ProjectSecretCreateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ProjectSecretCreateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ProjectSecretCreateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of ProjectSecretCreateRsp - * @throws IOException if the JSON string is invalid with respect to ProjectSecretCreateRsp - */ - public static ProjectSecretCreateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProjectSecretCreateRsp.class); - } - - /** - * Convert an instance of ProjectSecretCreateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ProjectSecretDeleteReq.java b/src/main/java/com/corbado/generated/model/ProjectSecretDeleteReq.java deleted file mode 100644 index 2a5b1fe..0000000 --- a/src/main/java/com/corbado/generated/model/ProjectSecretDeleteReq.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ProjectSecretDeleteReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ProjectSecretDeleteReq { - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public ProjectSecretDeleteReq() { - } - - public ProjectSecretDeleteReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public ProjectSecretDeleteReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectSecretDeleteReq projectSecretDeleteReq = (ProjectSecretDeleteReq) o; - return Objects.equals(this.requestID, projectSecretDeleteReq.requestID) && - Objects.equals(this.clientInfo, projectSecretDeleteReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProjectSecretDeleteReq {\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ProjectSecretDeleteReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ProjectSecretDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectSecretDeleteReq is not found in the empty JSON string", ProjectSecretDeleteReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ProjectSecretDeleteReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectSecretDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProjectSecretDeleteReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProjectSecretDeleteReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProjectSecretDeleteReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ProjectSecretDeleteReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ProjectSecretDeleteReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ProjectSecretDeleteReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of ProjectSecretDeleteReq - * @throws IOException if the JSON string is invalid with respect to ProjectSecretDeleteReq - */ - public static ProjectSecretDeleteReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProjectSecretDeleteReq.class); - } - - /** - * Convert an instance of ProjectSecretDeleteReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ProjectSecretItem.java b/src/main/java/com/corbado/generated/model/ProjectSecretItem.java deleted file mode 100644 index 7e1f042..0000000 --- a/src/main/java/com/corbado/generated/model/ProjectSecretItem.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ProjectSecretItem - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ProjectSecretItem { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_SECRET = "secret"; - @SerializedName(SERIALIZED_NAME_SECRET) - private String secret; - - public static final String SERIALIZED_NAME_HINT = "hint"; - @SerializedName(SERIALIZED_NAME_HINT) - private String hint; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public ProjectSecretItem() { - } - - public ProjectSecretItem id(String id) { - this.id = id; - return this; - } - - /** - * ID of project secret - * @return id - **/ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public ProjectSecretItem secret(String secret) { - this.secret = secret; - return this; - } - - /** - * Server-side generated secret. Only filled on create - * @return secret - **/ - @javax.annotation.Nullable - public String getSecret() { - return secret; - } - - public void setSecret(String secret) { - this.secret = secret; - } - - - public ProjectSecretItem hint(String hint) { - this.hint = hint; - return this; - } - - /** - * Hint of the server-side generated secret. First 3 characters and last 3 characters - * @return hint - **/ - @javax.annotation.Nonnull - public String getHint() { - return hint; - } - - public void setHint(String hint) { - this.hint = hint; - } - - - public ProjectSecretItem created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectSecretItem projectSecretItem = (ProjectSecretItem) o; - return Objects.equals(this.id, projectSecretItem.id) && - Objects.equals(this.secret, projectSecretItem.secret) && - Objects.equals(this.hint, projectSecretItem.hint) && - Objects.equals(this.created, projectSecretItem.created); - } - - @Override - public int hashCode() { - return Objects.hash(id, secret, hint, created); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProjectSecretItem {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); - sb.append(" hint: ").append(toIndentedString(hint)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("id"); - openapiFields.add("secret"); - openapiFields.add("hint"); - openapiFields.add("created"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("hint"); - openapiRequiredFields.add("created"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ProjectSecretItem - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ProjectSecretItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectSecretItem is not found in the empty JSON string", ProjectSecretItem.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ProjectSecretItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectSecretItem` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ProjectSecretItem.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if ((jsonObj.get("secret") != null && !jsonObj.get("secret").isJsonNull()) && !jsonObj.get("secret").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); - } - if (!jsonObj.get("hint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hint").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProjectSecretItem.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProjectSecretItem' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProjectSecretItem.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ProjectSecretItem value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ProjectSecretItem read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ProjectSecretItem given an JSON string - * - * @param jsonString JSON string - * @return An instance of ProjectSecretItem - * @throws IOException if the JSON string is invalid with respect to ProjectSecretItem - */ - public static ProjectSecretItem fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProjectSecretItem.class); - } - - /** - * Convert an instance of ProjectSecretItem to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ProjectSecretListRsp.java b/src/main/java/com/corbado/generated/model/ProjectSecretListRsp.java deleted file mode 100644 index 7780529..0000000 --- a/src/main/java/com/corbado/generated/model/ProjectSecretListRsp.java +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.ProjectSecretItem; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ProjectSecretListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ProjectSecretListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_ROWS = "rows"; - @SerializedName(SERIALIZED_NAME_ROWS) - private List rows = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public ProjectSecretListRsp() { - } - - public ProjectSecretListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public ProjectSecretListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public ProjectSecretListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public ProjectSecretListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public ProjectSecretListRsp rows(List rows) { - this.rows = rows; - return this; - } - - public ProjectSecretListRsp addRowsItem(ProjectSecretItem rowsItem) { - if (this.rows == null) { - this.rows = new ArrayList<>(); - } - this.rows.add(rowsItem); - return this; - } - - /** - * Get rows - * @return rows - **/ - @javax.annotation.Nonnull - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - - public ProjectSecretListRsp paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectSecretListRsp projectSecretListRsp = (ProjectSecretListRsp) o; - return Objects.equals(this.httpStatusCode, projectSecretListRsp.httpStatusCode) && - Objects.equals(this.message, projectSecretListRsp.message) && - Objects.equals(this.requestData, projectSecretListRsp.requestData) && - Objects.equals(this.runtime, projectSecretListRsp.runtime) && - Objects.equals(this.rows, projectSecretListRsp.rows) && - Objects.equals(this.paging, projectSecretListRsp.paging); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, rows, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProjectSecretListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("rows"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("rows"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ProjectSecretListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ProjectSecretListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ProjectSecretListRsp is not found in the empty JSON string", ProjectSecretListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ProjectSecretListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProjectSecretListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ProjectSecretListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // ensure the json data is an array - if (!jsonObj.get("rows").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rows` to be an array in the JSON string but got `%s`", jsonObj.get("rows").toString())); - } - - JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); - // validate the required field `rows` (array) - for (int i = 0; i < jsonArrayrows.size(); i++) { - ProjectSecretItem.validateJsonElement(jsonArrayrows.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ProjectSecretListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ProjectSecretListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ProjectSecretListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ProjectSecretListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ProjectSecretListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ProjectSecretListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of ProjectSecretListRsp - * @throws IOException if the JSON string is invalid with respect to ProjectSecretListRsp - */ - public static ProjectSecretListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ProjectSecretListRsp.class); - } - - /** - * Convert an instance of ProjectSecretListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/RequestData.java b/src/main/java/com/corbado/generated/model/RequestData.java index 67f2e97..cb0cd5f 100644 --- a/src/main/java/com/corbado/generated/model/RequestData.java +++ b/src/main/java/com/corbado/generated/model/RequestData.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ /** * Data about the request itself, can be used for debugging */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class RequestData { public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; @SerializedName(SERIALIZED_NAME_REQUEST_I_D) @@ -67,10 +67,10 @@ public RequestData requestID(String requestID) { return this; } - /** + /** * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side * @return requestID - **/ + */ @javax.annotation.Nonnull public String getRequestID() { return requestID; @@ -86,10 +86,10 @@ public RequestData link(String link) { return this; } - /** + /** * Link to dashboard with details about request * @return link - **/ + */ @javax.annotation.Nonnull public String getLink() { return link; @@ -156,12 +156,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("link"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RequestData - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RequestData + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RequestData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -221,22 +221,22 @@ public RequestData read(JsonReader in) throws IOException { } } - /** - * Create an instance of RequestData given an JSON string - * - * @param jsonString JSON string - * @return An instance of RequestData - * @throws IOException if the JSON string is invalid with respect to RequestData - */ + /** + * Create an instance of RequestData given an JSON string + * + * @param jsonString JSON string + * @return An instance of RequestData + * @throws IOException if the JSON string is invalid with respect to RequestData + */ public static RequestData fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RequestData.class); } - /** - * Convert an instance of RequestData to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of RequestData to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/com/corbado/generated/model/RequestLog.java b/src/main/java/com/corbado/generated/model/RequestLog.java deleted file mode 100644 index fb25459..0000000 --- a/src/main/java/com/corbado/generated/model/RequestLog.java +++ /dev/null @@ -1,706 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * Request log entry - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class RequestLog { - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; - @SerializedName(SERIALIZED_NAME_PROJECT_I_D) - private String projectID; - - public static final String SERIALIZED_NAME_USER_I_D = "userID"; - @SerializedName(SERIALIZED_NAME_USER_I_D) - private String userID; - - public static final String SERIALIZED_NAME_APPLICATION = "application"; - @SerializedName(SERIALIZED_NAME_APPLICATION) - private String application; - - public static final String SERIALIZED_NAME_METHOD = "method"; - @SerializedName(SERIALIZED_NAME_METHOD) - private String method; - - public static final String SERIALIZED_NAME_ENDPOINT = "endpoint"; - @SerializedName(SERIALIZED_NAME_ENDPOINT) - private String endpoint; - - public static final String SERIALIZED_NAME_SOURCE = "source"; - @SerializedName(SERIALIZED_NAME_SOURCE) - private String source; - - public static final String SERIALIZED_NAME_REQUEST = "request"; - @SerializedName(SERIALIZED_NAME_REQUEST) - private String request; - - public static final String SERIALIZED_NAME_REQUEST_HEADERS = "requestHeaders"; - @SerializedName(SERIALIZED_NAME_REQUEST_HEADERS) - private Map requestHeaders = new HashMap<>(); - - public static final String SERIALIZED_NAME_QUERY_PARAMS = "queryParams"; - @SerializedName(SERIALIZED_NAME_QUERY_PARAMS) - private String queryParams; - - public static final String SERIALIZED_NAME_RESPONSE_STATUS = "responseStatus"; - @SerializedName(SERIALIZED_NAME_RESPONSE_STATUS) - private BigDecimal responseStatus; - - public static final String SERIALIZED_NAME_RESPONSE = "response"; - @SerializedName(SERIALIZED_NAME_RESPONSE) - private String response; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_REMOTE_ADDRESS = "remoteAddress"; - @SerializedName(SERIALIZED_NAME_REMOTE_ADDRESS) - private String remoteAddress; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_TAGS = "tags"; - @SerializedName(SERIALIZED_NAME_TAGS) - private Object tags; - - public static final String SERIALIZED_NAME_DETAILS = "details"; - @SerializedName(SERIALIZED_NAME_DETAILS) - private List details = new ArrayList<>(); - - public RequestLog() { - } - - public RequestLog requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nonnull - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public RequestLog projectID(String projectID) { - this.projectID = projectID; - return this; - } - - /** - * ID of project - * @return projectID - **/ - @javax.annotation.Nonnull - public String getProjectID() { - return projectID; - } - - public void setProjectID(String projectID) { - this.projectID = projectID; - } - - - public RequestLog userID(String userID) { - this.userID = userID; - return this; - } - - /** - * ID of the user - * @return userID - **/ - @javax.annotation.Nonnull - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - - public RequestLog application(String application) { - this.application = application; - return this; - } - - /** - * Application this request was processed with - * @return application - **/ - @javax.annotation.Nonnull - public String getApplication() { - return application; - } - - public void setApplication(String application) { - this.application = application; - } - - - public RequestLog method(String method) { - this.method = method; - return this; - } - - /** - * HTTP method (such as GET and POST) - * @return method - **/ - @javax.annotation.Nonnull - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - - public RequestLog endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /** - * Endpoint that was requested - * @return endpoint - **/ - @javax.annotation.Nonnull - public String getEndpoint() { - return endpoint; - } - - public void setEndpoint(String endpoint) { - this.endpoint = endpoint; - } - - - public RequestLog source(String source) { - this.source = source; - return this; - } - - /** - * Request source - * @return source - **/ - @javax.annotation.Nonnull - public String getSource() { - return source; - } - - public void setSource(String source) { - this.source = source; - } - - - public RequestLog request(String request) { - this.request = request; - return this; - } - - /** - * Request JSON data - * @return request - **/ - @javax.annotation.Nonnull - public String getRequest() { - return request; - } - - public void setRequest(String request) { - this.request = request; - } - - - public RequestLog requestHeaders(Map requestHeaders) { - this.requestHeaders = requestHeaders; - return this; - } - - public RequestLog putRequestHeadersItem(String key, String requestHeadersItem) { - if (this.requestHeaders == null) { - this.requestHeaders = new HashMap<>(); - } - this.requestHeaders.put(key, requestHeadersItem); - return this; - } - - /** - * Request headers - * @return requestHeaders - **/ - @javax.annotation.Nonnull - public Map getRequestHeaders() { - return requestHeaders; - } - - public void setRequestHeaders(Map requestHeaders) { - this.requestHeaders = requestHeaders; - } - - - public RequestLog queryParams(String queryParams) { - this.queryParams = queryParams; - return this; - } - - /** - * Request query parameters - * @return queryParams - **/ - @javax.annotation.Nonnull - public String getQueryParams() { - return queryParams; - } - - public void setQueryParams(String queryParams) { - this.queryParams = queryParams; - } - - - public RequestLog responseStatus(BigDecimal responseStatus) { - this.responseStatus = responseStatus; - return this; - } - - /** - * Response HTTP status - * @return responseStatus - **/ - @javax.annotation.Nonnull - public BigDecimal getResponseStatus() { - return responseStatus; - } - - public void setResponseStatus(BigDecimal responseStatus) { - this.responseStatus = responseStatus; - } - - - public RequestLog response(String response) { - this.response = response; - return this; - } - - /** - * Response JSON data - * @return response - **/ - @javax.annotation.Nonnull - public String getResponse() { - return response; - } - - public void setResponse(String response) { - this.response = response; - } - - - public RequestLog runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public RequestLog remoteAddress(String remoteAddress) { - this.remoteAddress = remoteAddress; - return this; - } - - /** - * Caller remote address - * @return remoteAddress - **/ - @javax.annotation.Nonnull - public String getRemoteAddress() { - return remoteAddress; - } - - public void setRemoteAddress(String remoteAddress) { - this.remoteAddress = remoteAddress; - } - - - public RequestLog created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the request was performed in RFC3339 format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public RequestLog tags(Object tags) { - this.tags = tags; - return this; - } - - /** - * Arbitrary tags attached to this request - * @return tags - **/ - @javax.annotation.Nonnull - public Object getTags() { - return tags; - } - - public void setTags(Object tags) { - this.tags = tags; - } - - - public RequestLog details(List details) { - this.details = details; - return this; - } - - public RequestLog addDetailsItem(String detailsItem) { - if (this.details == null) { - this.details = new ArrayList<>(); - } - this.details.add(detailsItem); - return this; - } - - /** - * Any freetext additional information attached to this request. Additional logs, errors, etc. - * @return details - **/ - @javax.annotation.Nonnull - public List getDetails() { - return details; - } - - public void setDetails(List details) { - this.details = details; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RequestLog requestLog = (RequestLog) o; - return Objects.equals(this.requestID, requestLog.requestID) && - Objects.equals(this.projectID, requestLog.projectID) && - Objects.equals(this.userID, requestLog.userID) && - Objects.equals(this.application, requestLog.application) && - Objects.equals(this.method, requestLog.method) && - Objects.equals(this.endpoint, requestLog.endpoint) && - Objects.equals(this.source, requestLog.source) && - Objects.equals(this.request, requestLog.request) && - Objects.equals(this.requestHeaders, requestLog.requestHeaders) && - Objects.equals(this.queryParams, requestLog.queryParams) && - Objects.equals(this.responseStatus, requestLog.responseStatus) && - Objects.equals(this.response, requestLog.response) && - Objects.equals(this.runtime, requestLog.runtime) && - Objects.equals(this.remoteAddress, requestLog.remoteAddress) && - Objects.equals(this.created, requestLog.created) && - Objects.equals(this.tags, requestLog.tags) && - Objects.equals(this.details, requestLog.details); - } - - @Override - public int hashCode() { - return Objects.hash(requestID, projectID, userID, application, method, endpoint, source, request, requestHeaders, queryParams, responseStatus, response, runtime, remoteAddress, created, tags, details); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RequestLog {\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); - sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb.append(" application: ").append(toIndentedString(application)).append("\n"); - sb.append(" method: ").append(toIndentedString(method)).append("\n"); - sb.append(" endpoint: ").append(toIndentedString(endpoint)).append("\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); - sb.append(" request: ").append(toIndentedString(request)).append("\n"); - sb.append(" requestHeaders: ").append(toIndentedString(requestHeaders)).append("\n"); - sb.append(" queryParams: ").append(toIndentedString(queryParams)).append("\n"); - sb.append(" responseStatus: ").append(toIndentedString(responseStatus)).append("\n"); - sb.append(" response: ").append(toIndentedString(response)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" remoteAddress: ").append(toIndentedString(remoteAddress)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("requestID"); - openapiFields.add("projectID"); - openapiFields.add("userID"); - openapiFields.add("application"); - openapiFields.add("method"); - openapiFields.add("endpoint"); - openapiFields.add("source"); - openapiFields.add("request"); - openapiFields.add("requestHeaders"); - openapiFields.add("queryParams"); - openapiFields.add("responseStatus"); - openapiFields.add("response"); - openapiFields.add("runtime"); - openapiFields.add("remoteAddress"); - openapiFields.add("created"); - openapiFields.add("tags"); - openapiFields.add("details"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("requestID"); - openapiRequiredFields.add("projectID"); - openapiRequiredFields.add("userID"); - openapiRequiredFields.add("application"); - openapiRequiredFields.add("method"); - openapiRequiredFields.add("endpoint"); - openapiRequiredFields.add("source"); - openapiRequiredFields.add("request"); - openapiRequiredFields.add("requestHeaders"); - openapiRequiredFields.add("queryParams"); - openapiRequiredFields.add("responseStatus"); - openapiRequiredFields.add("response"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("remoteAddress"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("tags"); - openapiRequiredFields.add("details"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RequestLog - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RequestLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in RequestLog is not found in the empty JSON string", RequestLog.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RequestLog.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RequestLog` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RequestLog.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - if (!jsonObj.get("projectID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); - } - if (!jsonObj.get("userID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); - } - if (!jsonObj.get("application").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `application` to be a primitive type in the JSON string but got `%s`", jsonObj.get("application").toString())); - } - if (!jsonObj.get("method").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); - } - if (!jsonObj.get("endpoint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `endpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endpoint").toString())); - } - if (!jsonObj.get("source").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString())); - } - if (!jsonObj.get("request").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `request` to be a primitive type in the JSON string but got `%s`", jsonObj.get("request").toString())); - } - if (!jsonObj.get("queryParams").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `queryParams` to be a primitive type in the JSON string but got `%s`", jsonObj.get("queryParams").toString())); - } - if (!jsonObj.get("response").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response").toString())); - } - if (!jsonObj.get("remoteAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `remoteAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remoteAddress").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - // ensure the required json array is present - if (jsonObj.get("details") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("details").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `details` to be an array in the JSON string but got `%s`", jsonObj.get("details").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RequestLog.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RequestLog' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(RequestLog.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, RequestLog value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RequestLog read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of RequestLog given an JSON string - * - * @param jsonString JSON string - * @return An instance of RequestLog - * @throws IOException if the JSON string is invalid with respect to RequestLog - */ - public static RequestLog fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RequestLog.class); - } - - /** - * Convert an instance of RequestLog to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/RequestLogGetRsp.java b/src/main/java/com/corbado/generated/model/RequestLogGetRsp.java deleted file mode 100644 index 4bb58db..0000000 --- a/src/main/java/com/corbado/generated/model/RequestLogGetRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.RequestLog; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * RequestLogGetRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class RequestLogGetRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private RequestLog data; - - public RequestLogGetRsp() { - } - - public RequestLogGetRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public RequestLogGetRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public RequestLogGetRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public RequestLogGetRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public RequestLogGetRsp data(RequestLog data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public RequestLog getData() { - return data; - } - - public void setData(RequestLog data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RequestLogGetRsp requestLogGetRsp = (RequestLogGetRsp) o; - return Objects.equals(this.httpStatusCode, requestLogGetRsp.httpStatusCode) && - Objects.equals(this.message, requestLogGetRsp.message) && - Objects.equals(this.requestData, requestLogGetRsp.requestData) && - Objects.equals(this.runtime, requestLogGetRsp.runtime) && - Objects.equals(this.data, requestLogGetRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RequestLogGetRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RequestLogGetRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RequestLogGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in RequestLogGetRsp is not found in the empty JSON string", RequestLogGetRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RequestLogGetRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RequestLogGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RequestLogGetRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - RequestLog.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RequestLogGetRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RequestLogGetRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(RequestLogGetRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, RequestLogGetRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RequestLogGetRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of RequestLogGetRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of RequestLogGetRsp - * @throws IOException if the JSON string is invalid with respect to RequestLogGetRsp - */ - public static RequestLogGetRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RequestLogGetRsp.class); - } - - /** - * Convert an instance of RequestLogGetRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/RequestLogsListRsp.java b/src/main/java/com/corbado/generated/model/RequestLogsListRsp.java deleted file mode 100644 index 700bf03..0000000 --- a/src/main/java/com/corbado/generated/model/RequestLogsListRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.RequestLogsListRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * RequestLogsListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class RequestLogsListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private RequestLogsListRspAllOfData data; - - public RequestLogsListRsp() { - } - - public RequestLogsListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public RequestLogsListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public RequestLogsListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public RequestLogsListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public RequestLogsListRsp data(RequestLogsListRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public RequestLogsListRspAllOfData getData() { - return data; - } - - public void setData(RequestLogsListRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RequestLogsListRsp requestLogsListRsp = (RequestLogsListRsp) o; - return Objects.equals(this.httpStatusCode, requestLogsListRsp.httpStatusCode) && - Objects.equals(this.message, requestLogsListRsp.message) && - Objects.equals(this.requestData, requestLogsListRsp.requestData) && - Objects.equals(this.runtime, requestLogsListRsp.runtime) && - Objects.equals(this.data, requestLogsListRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RequestLogsListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RequestLogsListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RequestLogsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in RequestLogsListRsp is not found in the empty JSON string", RequestLogsListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RequestLogsListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RequestLogsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RequestLogsListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - RequestLogsListRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RequestLogsListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RequestLogsListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(RequestLogsListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, RequestLogsListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RequestLogsListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of RequestLogsListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of RequestLogsListRsp - * @throws IOException if the JSON string is invalid with respect to RequestLogsListRsp - */ - public static RequestLogsListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RequestLogsListRsp.class); - } - - /** - * Convert an instance of RequestLogsListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/RequestLogsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/RequestLogsListRspAllOfData.java deleted file mode 100644 index f256489..0000000 --- a/src/main/java/com/corbado/generated/model/RequestLogsListRspAllOfData.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.RequestLog; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * RequestLogsListRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class RequestLogsListRspAllOfData { - public static final String SERIALIZED_NAME_LOGS = "logs"; - @SerializedName(SERIALIZED_NAME_LOGS) - private List logs = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public RequestLogsListRspAllOfData() { - } - - public RequestLogsListRspAllOfData logs(List logs) { - this.logs = logs; - return this; - } - - public RequestLogsListRspAllOfData addLogsItem(RequestLog logsItem) { - if (this.logs == null) { - this.logs = new ArrayList<>(); - } - this.logs.add(logsItem); - return this; - } - - /** - * Get logs - * @return logs - **/ - @javax.annotation.Nonnull - public List getLogs() { - return logs; - } - - public void setLogs(List logs) { - this.logs = logs; - } - - - public RequestLogsListRspAllOfData paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RequestLogsListRspAllOfData requestLogsListRspAllOfData = (RequestLogsListRspAllOfData) o; - return Objects.equals(this.logs, requestLogsListRspAllOfData.logs) && - Objects.equals(this.paging, requestLogsListRspAllOfData.paging); - } - - @Override - public int hashCode() { - return Objects.hash(logs, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RequestLogsListRspAllOfData {\n"); - sb.append(" logs: ").append(toIndentedString(logs)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("logs"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("logs"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RequestLogsListRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RequestLogsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in RequestLogsListRspAllOfData is not found in the empty JSON string", RequestLogsListRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!RequestLogsListRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RequestLogsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RequestLogsListRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("logs").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `logs` to be an array in the JSON string but got `%s`", jsonObj.get("logs").toString())); - } - - JsonArray jsonArraylogs = jsonObj.getAsJsonArray("logs"); - // validate the required field `logs` (array) - for (int i = 0; i < jsonArraylogs.size(); i++) { - RequestLog.validateJsonElement(jsonArraylogs.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RequestLogsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RequestLogsListRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(RequestLogsListRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, RequestLogsListRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RequestLogsListRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of RequestLogsListRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of RequestLogsListRspAllOfData - * @throws IOException if the JSON string is invalid with respect to RequestLogsListRspAllOfData - */ - public static RequestLogsListRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RequestLogsListRspAllOfData.class); - } - - /** - * Convert an instance of RequestLogsListRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SessionConfig.java b/src/main/java/com/corbado/generated/model/SessionConfig.java deleted file mode 100644 index d7675c6..0000000 --- a/src/main/java/com/corbado/generated/model/SessionConfig.java +++ /dev/null @@ -1,756 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.AppType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SessionConfig - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SessionConfig { - public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; - @SerializedName(SERIALIZED_NAME_PROJECT_I_D) - private String projectID; - - public static final String SERIALIZED_NAME_APP_TYPE = "appType"; - @SerializedName(SERIALIZED_NAME_APP_TYPE) - private AppType appType; - - public static final String SERIALIZED_NAME_ACTIVE = "active"; - @SerializedName(SERIALIZED_NAME_ACTIVE) - private Boolean active; - - public static final String SERIALIZED_NAME_SHORT_LIFETIME_MINUTES = "shortLifetimeMinutes"; - @SerializedName(SERIALIZED_NAME_SHORT_LIFETIME_MINUTES) - private Integer shortLifetimeMinutes; - - public static final String SERIALIZED_NAME_SHORT_COOKIE_DOMAIN = "shortCookieDomain"; - @SerializedName(SERIALIZED_NAME_SHORT_COOKIE_DOMAIN) - private String shortCookieDomain; - - public static final String SERIALIZED_NAME_SHORT_COOKIE_SECURE = "shortCookieSecure"; - @SerializedName(SERIALIZED_NAME_SHORT_COOKIE_SECURE) - private Boolean shortCookieSecure; - - /** - * Gets or Sets shortCookieSameSite - */ - @JsonAdapter(ShortCookieSameSiteEnum.Adapter.class) - public enum ShortCookieSameSiteEnum { - LAX("lax"), - - STRICT("strict"), - - NONE("none"); - - private String value; - - ShortCookieSameSiteEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ShortCookieSameSiteEnum fromValue(String value) { - for (ShortCookieSameSiteEnum b : ShortCookieSameSiteEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ShortCookieSameSiteEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ShortCookieSameSiteEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ShortCookieSameSiteEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ShortCookieSameSiteEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_SHORT_COOKIE_SAME_SITE = "shortCookieSameSite"; - @SerializedName(SERIALIZED_NAME_SHORT_COOKIE_SAME_SITE) - private ShortCookieSameSiteEnum shortCookieSameSite; - - public static final String SERIALIZED_NAME_LONG_LIFETIME_VALUE = "longLifetimeValue"; - @SerializedName(SERIALIZED_NAME_LONG_LIFETIME_VALUE) - private Integer longLifetimeValue; - - /** - * Gets or Sets longLifetimeUnit - */ - @JsonAdapter(LongLifetimeUnitEnum.Adapter.class) - public enum LongLifetimeUnitEnum { - MIN("min"), - - HOUR("hour"), - - DAY("day"); - - private String value; - - LongLifetimeUnitEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LongLifetimeUnitEnum fromValue(String value) { - for (LongLifetimeUnitEnum b : LongLifetimeUnitEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LongLifetimeUnitEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LongLifetimeUnitEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LongLifetimeUnitEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - LongLifetimeUnitEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_LONG_LIFETIME_UNIT = "longLifetimeUnit"; - @SerializedName(SERIALIZED_NAME_LONG_LIFETIME_UNIT) - private LongLifetimeUnitEnum longLifetimeUnit; - - public static final String SERIALIZED_NAME_LONG_INACTIVITY_VALUE = "longInactivityValue"; - @SerializedName(SERIALIZED_NAME_LONG_INACTIVITY_VALUE) - private Integer longInactivityValue; - - /** - * Gets or Sets longInactivityUnit - */ - @JsonAdapter(LongInactivityUnitEnum.Adapter.class) - public enum LongInactivityUnitEnum { - MIN("min"), - - HOUR("hour"), - - DAY("day"); - - private String value; - - LongInactivityUnitEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LongInactivityUnitEnum fromValue(String value) { - for (LongInactivityUnitEnum b : LongInactivityUnitEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LongInactivityUnitEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LongInactivityUnitEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LongInactivityUnitEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - LongInactivityUnitEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_LONG_INACTIVITY_UNIT = "longInactivityUnit"; - @SerializedName(SERIALIZED_NAME_LONG_INACTIVITY_UNIT) - private LongInactivityUnitEnum longInactivityUnit; - - public static final String SERIALIZED_NAME_JWT_AUDIENCE = "jwtAudience"; - @SerializedName(SERIALIZED_NAME_JWT_AUDIENCE) - private String jwtAudience; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public SessionConfig() { - } - - public SessionConfig projectID(String projectID) { - this.projectID = projectID; - return this; - } - - /** - * ID of project - * @return projectID - **/ - @javax.annotation.Nonnull - public String getProjectID() { - return projectID; - } - - public void setProjectID(String projectID) { - this.projectID = projectID; - } - - - public SessionConfig appType(AppType appType) { - this.appType = appType; - return this; - } - - /** - * Get appType - * @return appType - **/ - @javax.annotation.Nonnull - public AppType getAppType() { - return appType; - } - - public void setAppType(AppType appType) { - this.appType = appType; - } - - - public SessionConfig active(Boolean active) { - this.active = active; - return this; - } - - /** - * Get active - * @return active - **/ - @javax.annotation.Nullable - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - - public SessionConfig shortLifetimeMinutes(Integer shortLifetimeMinutes) { - this.shortLifetimeMinutes = shortLifetimeMinutes; - return this; - } - - /** - * Get shortLifetimeMinutes - * @return shortLifetimeMinutes - **/ - @javax.annotation.Nonnull - public Integer getShortLifetimeMinutes() { - return shortLifetimeMinutes; - } - - public void setShortLifetimeMinutes(Integer shortLifetimeMinutes) { - this.shortLifetimeMinutes = shortLifetimeMinutes; - } - - - public SessionConfig shortCookieDomain(String shortCookieDomain) { - this.shortCookieDomain = shortCookieDomain; - return this; - } - - /** - * Get shortCookieDomain - * @return shortCookieDomain - **/ - @javax.annotation.Nonnull - public String getShortCookieDomain() { - return shortCookieDomain; - } - - public void setShortCookieDomain(String shortCookieDomain) { - this.shortCookieDomain = shortCookieDomain; - } - - - public SessionConfig shortCookieSecure(Boolean shortCookieSecure) { - this.shortCookieSecure = shortCookieSecure; - return this; - } - - /** - * Get shortCookieSecure - * @return shortCookieSecure - **/ - @javax.annotation.Nonnull - public Boolean getShortCookieSecure() { - return shortCookieSecure; - } - - public void setShortCookieSecure(Boolean shortCookieSecure) { - this.shortCookieSecure = shortCookieSecure; - } - - - public SessionConfig shortCookieSameSite(ShortCookieSameSiteEnum shortCookieSameSite) { - this.shortCookieSameSite = shortCookieSameSite; - return this; - } - - /** - * Get shortCookieSameSite - * @return shortCookieSameSite - **/ - @javax.annotation.Nonnull - public ShortCookieSameSiteEnum getShortCookieSameSite() { - return shortCookieSameSite; - } - - public void setShortCookieSameSite(ShortCookieSameSiteEnum shortCookieSameSite) { - this.shortCookieSameSite = shortCookieSameSite; - } - - - public SessionConfig longLifetimeValue(Integer longLifetimeValue) { - this.longLifetimeValue = longLifetimeValue; - return this; - } - - /** - * Get longLifetimeValue - * @return longLifetimeValue - **/ - @javax.annotation.Nonnull - public Integer getLongLifetimeValue() { - return longLifetimeValue; - } - - public void setLongLifetimeValue(Integer longLifetimeValue) { - this.longLifetimeValue = longLifetimeValue; - } - - - public SessionConfig longLifetimeUnit(LongLifetimeUnitEnum longLifetimeUnit) { - this.longLifetimeUnit = longLifetimeUnit; - return this; - } - - /** - * Get longLifetimeUnit - * @return longLifetimeUnit - **/ - @javax.annotation.Nonnull - public LongLifetimeUnitEnum getLongLifetimeUnit() { - return longLifetimeUnit; - } - - public void setLongLifetimeUnit(LongLifetimeUnitEnum longLifetimeUnit) { - this.longLifetimeUnit = longLifetimeUnit; - } - - - public SessionConfig longInactivityValue(Integer longInactivityValue) { - this.longInactivityValue = longInactivityValue; - return this; - } - - /** - * Get longInactivityValue - * @return longInactivityValue - **/ - @javax.annotation.Nonnull - public Integer getLongInactivityValue() { - return longInactivityValue; - } - - public void setLongInactivityValue(Integer longInactivityValue) { - this.longInactivityValue = longInactivityValue; - } - - - public SessionConfig longInactivityUnit(LongInactivityUnitEnum longInactivityUnit) { - this.longInactivityUnit = longInactivityUnit; - return this; - } - - /** - * Get longInactivityUnit - * @return longInactivityUnit - **/ - @javax.annotation.Nonnull - public LongInactivityUnitEnum getLongInactivityUnit() { - return longInactivityUnit; - } - - public void setLongInactivityUnit(LongInactivityUnitEnum longInactivityUnit) { - this.longInactivityUnit = longInactivityUnit; - } - - - public SessionConfig jwtAudience(String jwtAudience) { - this.jwtAudience = jwtAudience; - return this; - } - - /** - * Get jwtAudience - * @return jwtAudience - **/ - @javax.annotation.Nonnull - public String getJwtAudience() { - return jwtAudience; - } - - public void setJwtAudience(String jwtAudience) { - this.jwtAudience = jwtAudience; - } - - - public SessionConfig created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public SessionConfig updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SessionConfig sessionConfig = (SessionConfig) o; - return Objects.equals(this.projectID, sessionConfig.projectID) && - Objects.equals(this.appType, sessionConfig.appType) && - Objects.equals(this.active, sessionConfig.active) && - Objects.equals(this.shortLifetimeMinutes, sessionConfig.shortLifetimeMinutes) && - Objects.equals(this.shortCookieDomain, sessionConfig.shortCookieDomain) && - Objects.equals(this.shortCookieSecure, sessionConfig.shortCookieSecure) && - Objects.equals(this.shortCookieSameSite, sessionConfig.shortCookieSameSite) && - Objects.equals(this.longLifetimeValue, sessionConfig.longLifetimeValue) && - Objects.equals(this.longLifetimeUnit, sessionConfig.longLifetimeUnit) && - Objects.equals(this.longInactivityValue, sessionConfig.longInactivityValue) && - Objects.equals(this.longInactivityUnit, sessionConfig.longInactivityUnit) && - Objects.equals(this.jwtAudience, sessionConfig.jwtAudience) && - Objects.equals(this.created, sessionConfig.created) && - Objects.equals(this.updated, sessionConfig.updated); - } - - @Override - public int hashCode() { - return Objects.hash(projectID, appType, active, shortLifetimeMinutes, shortCookieDomain, shortCookieSecure, shortCookieSameSite, longLifetimeValue, longLifetimeUnit, longInactivityValue, longInactivityUnit, jwtAudience, created, updated); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SessionConfig {\n"); - sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); - sb.append(" appType: ").append(toIndentedString(appType)).append("\n"); - sb.append(" active: ").append(toIndentedString(active)).append("\n"); - sb.append(" shortLifetimeMinutes: ").append(toIndentedString(shortLifetimeMinutes)).append("\n"); - sb.append(" shortCookieDomain: ").append(toIndentedString(shortCookieDomain)).append("\n"); - sb.append(" shortCookieSecure: ").append(toIndentedString(shortCookieSecure)).append("\n"); - sb.append(" shortCookieSameSite: ").append(toIndentedString(shortCookieSameSite)).append("\n"); - sb.append(" longLifetimeValue: ").append(toIndentedString(longLifetimeValue)).append("\n"); - sb.append(" longLifetimeUnit: ").append(toIndentedString(longLifetimeUnit)).append("\n"); - sb.append(" longInactivityValue: ").append(toIndentedString(longInactivityValue)).append("\n"); - sb.append(" longInactivityUnit: ").append(toIndentedString(longInactivityUnit)).append("\n"); - sb.append(" jwtAudience: ").append(toIndentedString(jwtAudience)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("projectID"); - openapiFields.add("appType"); - openapiFields.add("active"); - openapiFields.add("shortLifetimeMinutes"); - openapiFields.add("shortCookieDomain"); - openapiFields.add("shortCookieSecure"); - openapiFields.add("shortCookieSameSite"); - openapiFields.add("longLifetimeValue"); - openapiFields.add("longLifetimeUnit"); - openapiFields.add("longInactivityValue"); - openapiFields.add("longInactivityUnit"); - openapiFields.add("jwtAudience"); - openapiFields.add("created"); - openapiFields.add("updated"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("projectID"); - openapiRequiredFields.add("appType"); - openapiRequiredFields.add("shortLifetimeMinutes"); - openapiRequiredFields.add("shortCookieDomain"); - openapiRequiredFields.add("shortCookieSecure"); - openapiRequiredFields.add("shortCookieSameSite"); - openapiRequiredFields.add("longLifetimeValue"); - openapiRequiredFields.add("longLifetimeUnit"); - openapiRequiredFields.add("longInactivityValue"); - openapiRequiredFields.add("longInactivityUnit"); - openapiRequiredFields.add("jwtAudience"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SessionConfig - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SessionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SessionConfig is not found in the empty JSON string", SessionConfig.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SessionConfig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionConfig` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SessionConfig.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("projectID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); - } - // validate the required field `appType` - AppType.validateJsonElement(jsonObj.get("appType")); - if (!jsonObj.get("shortCookieDomain").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shortCookieDomain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shortCookieDomain").toString())); - } - if (!jsonObj.get("shortCookieSameSite").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shortCookieSameSite` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shortCookieSameSite").toString())); - } - // validate the required field `shortCookieSameSite` - ShortCookieSameSiteEnum.validateJsonElement(jsonObj.get("shortCookieSameSite")); - if (!jsonObj.get("longLifetimeUnit").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `longLifetimeUnit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("longLifetimeUnit").toString())); - } - // validate the required field `longLifetimeUnit` - LongLifetimeUnitEnum.validateJsonElement(jsonObj.get("longLifetimeUnit")); - if (!jsonObj.get("longInactivityUnit").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `longInactivityUnit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("longInactivityUnit").toString())); - } - // validate the required field `longInactivityUnit` - LongInactivityUnitEnum.validateJsonElement(jsonObj.get("longInactivityUnit")); - if (!jsonObj.get("jwtAudience").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `jwtAudience` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jwtAudience").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SessionConfig.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SessionConfig' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SessionConfig.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SessionConfig value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SessionConfig read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SessionConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of SessionConfig - * @throws IOException if the JSON string is invalid with respect to SessionConfig - */ - public static SessionConfig fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SessionConfig.class); - } - - /** - * Convert an instance of SessionConfig to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SessionConfigGetRsp.java b/src/main/java/com/corbado/generated/model/SessionConfigGetRsp.java deleted file mode 100644 index f24c792..0000000 --- a/src/main/java/com/corbado/generated/model/SessionConfigGetRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.SessionConfig; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SessionConfigGetRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SessionConfigGetRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private SessionConfig data; - - public SessionConfigGetRsp() { - } - - public SessionConfigGetRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public SessionConfigGetRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public SessionConfigGetRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public SessionConfigGetRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public SessionConfigGetRsp data(SessionConfig data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public SessionConfig getData() { - return data; - } - - public void setData(SessionConfig data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SessionConfigGetRsp sessionConfigGetRsp = (SessionConfigGetRsp) o; - return Objects.equals(this.httpStatusCode, sessionConfigGetRsp.httpStatusCode) && - Objects.equals(this.message, sessionConfigGetRsp.message) && - Objects.equals(this.requestData, sessionConfigGetRsp.requestData) && - Objects.equals(this.runtime, sessionConfigGetRsp.runtime) && - Objects.equals(this.data, sessionConfigGetRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SessionConfigGetRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SessionConfigGetRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SessionConfigGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SessionConfigGetRsp is not found in the empty JSON string", SessionConfigGetRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SessionConfigGetRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionConfigGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SessionConfigGetRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - SessionConfig.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SessionConfigGetRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SessionConfigGetRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SessionConfigGetRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SessionConfigGetRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SessionConfigGetRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SessionConfigGetRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of SessionConfigGetRsp - * @throws IOException if the JSON string is invalid with respect to SessionConfigGetRsp - */ - public static SessionConfigGetRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SessionConfigGetRsp.class); - } - - /** - * Convert an instance of SessionConfigGetRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SessionConfigUpdateReq.java b/src/main/java/com/corbado/generated/model/SessionConfigUpdateReq.java deleted file mode 100644 index 1c0b9a5..0000000 --- a/src/main/java/com/corbado/generated/model/SessionConfigUpdateReq.java +++ /dev/null @@ -1,719 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.AppType; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SessionConfigUpdateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SessionConfigUpdateReq { - public static final String SERIALIZED_NAME_APP_TYPE = "appType"; - @SerializedName(SERIALIZED_NAME_APP_TYPE) - private AppType appType; - - public static final String SERIALIZED_NAME_ACTIVE = "active"; - @SerializedName(SERIALIZED_NAME_ACTIVE) - private Boolean active; - - public static final String SERIALIZED_NAME_SHORT_LIFETIME_MINUTES = "shortLifetimeMinutes"; - @SerializedName(SERIALIZED_NAME_SHORT_LIFETIME_MINUTES) - private Integer shortLifetimeMinutes; - - public static final String SERIALIZED_NAME_SHORT_COOKIE_DOMAIN = "shortCookieDomain"; - @SerializedName(SERIALIZED_NAME_SHORT_COOKIE_DOMAIN) - private String shortCookieDomain; - - public static final String SERIALIZED_NAME_SHORT_COOKIE_SECURE = "shortCookieSecure"; - @SerializedName(SERIALIZED_NAME_SHORT_COOKIE_SECURE) - private Boolean shortCookieSecure; - - /** - * Gets or Sets shortCookieSameSite - */ - @JsonAdapter(ShortCookieSameSiteEnum.Adapter.class) - public enum ShortCookieSameSiteEnum { - LAX("lax"), - - STRICT("strict"), - - NONE("none"); - - private String value; - - ShortCookieSameSiteEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static ShortCookieSameSiteEnum fromValue(String value) { - for (ShortCookieSameSiteEnum b : ShortCookieSameSiteEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ShortCookieSameSiteEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ShortCookieSameSiteEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ShortCookieSameSiteEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - ShortCookieSameSiteEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_SHORT_COOKIE_SAME_SITE = "shortCookieSameSite"; - @SerializedName(SERIALIZED_NAME_SHORT_COOKIE_SAME_SITE) - private ShortCookieSameSiteEnum shortCookieSameSite; - - public static final String SERIALIZED_NAME_LONG_LIFETIME_VALUE = "longLifetimeValue"; - @SerializedName(SERIALIZED_NAME_LONG_LIFETIME_VALUE) - private Integer longLifetimeValue; - - /** - * Gets or Sets longLifetimeUnit - */ - @JsonAdapter(LongLifetimeUnitEnum.Adapter.class) - public enum LongLifetimeUnitEnum { - MIN("min"), - - HOUR("hour"); - - private String value; - - LongLifetimeUnitEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LongLifetimeUnitEnum fromValue(String value) { - for (LongLifetimeUnitEnum b : LongLifetimeUnitEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LongLifetimeUnitEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LongLifetimeUnitEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LongLifetimeUnitEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - LongLifetimeUnitEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_LONG_LIFETIME_UNIT = "longLifetimeUnit"; - @SerializedName(SERIALIZED_NAME_LONG_LIFETIME_UNIT) - private LongLifetimeUnitEnum longLifetimeUnit; - - public static final String SERIALIZED_NAME_LONG_INACTIVITY_VALUE = "longInactivityValue"; - @SerializedName(SERIALIZED_NAME_LONG_INACTIVITY_VALUE) - private Integer longInactivityValue; - - /** - * Gets or Sets longInactivityUnit - */ - @JsonAdapter(LongInactivityUnitEnum.Adapter.class) - public enum LongInactivityUnitEnum { - MIN("min"), - - HOUR("hour"); - - private String value; - - LongInactivityUnitEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static LongInactivityUnitEnum fromValue(String value) { - for (LongInactivityUnitEnum b : LongInactivityUnitEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LongInactivityUnitEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LongInactivityUnitEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LongInactivityUnitEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - LongInactivityUnitEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_LONG_INACTIVITY_UNIT = "longInactivityUnit"; - @SerializedName(SERIALIZED_NAME_LONG_INACTIVITY_UNIT) - private LongInactivityUnitEnum longInactivityUnit; - - public static final String SERIALIZED_NAME_JWT_AUDIENCE = "jwtAudience"; - @SerializedName(SERIALIZED_NAME_JWT_AUDIENCE) - private String jwtAudience; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public SessionConfigUpdateReq() { - } - - public SessionConfigUpdateReq appType(AppType appType) { - this.appType = appType; - return this; - } - - /** - * Get appType - * @return appType - **/ - @javax.annotation.Nonnull - public AppType getAppType() { - return appType; - } - - public void setAppType(AppType appType) { - this.appType = appType; - } - - - public SessionConfigUpdateReq active(Boolean active) { - this.active = active; - return this; - } - - /** - * Get active - * @return active - **/ - @javax.annotation.Nullable - public Boolean getActive() { - return active; - } - - public void setActive(Boolean active) { - this.active = active; - } - - - public SessionConfigUpdateReq shortLifetimeMinutes(Integer shortLifetimeMinutes) { - this.shortLifetimeMinutes = shortLifetimeMinutes; - return this; - } - - /** - * Get shortLifetimeMinutes - * @return shortLifetimeMinutes - **/ - @javax.annotation.Nullable - public Integer getShortLifetimeMinutes() { - return shortLifetimeMinutes; - } - - public void setShortLifetimeMinutes(Integer shortLifetimeMinutes) { - this.shortLifetimeMinutes = shortLifetimeMinutes; - } - - - public SessionConfigUpdateReq shortCookieDomain(String shortCookieDomain) { - this.shortCookieDomain = shortCookieDomain; - return this; - } - - /** - * Get shortCookieDomain - * @return shortCookieDomain - **/ - @javax.annotation.Nullable - public String getShortCookieDomain() { - return shortCookieDomain; - } - - public void setShortCookieDomain(String shortCookieDomain) { - this.shortCookieDomain = shortCookieDomain; - } - - - public SessionConfigUpdateReq shortCookieSecure(Boolean shortCookieSecure) { - this.shortCookieSecure = shortCookieSecure; - return this; - } - - /** - * Get shortCookieSecure - * @return shortCookieSecure - **/ - @javax.annotation.Nullable - public Boolean getShortCookieSecure() { - return shortCookieSecure; - } - - public void setShortCookieSecure(Boolean shortCookieSecure) { - this.shortCookieSecure = shortCookieSecure; - } - - - public SessionConfigUpdateReq shortCookieSameSite(ShortCookieSameSiteEnum shortCookieSameSite) { - this.shortCookieSameSite = shortCookieSameSite; - return this; - } - - /** - * Get shortCookieSameSite - * @return shortCookieSameSite - **/ - @javax.annotation.Nullable - public ShortCookieSameSiteEnum getShortCookieSameSite() { - return shortCookieSameSite; - } - - public void setShortCookieSameSite(ShortCookieSameSiteEnum shortCookieSameSite) { - this.shortCookieSameSite = shortCookieSameSite; - } - - - public SessionConfigUpdateReq longLifetimeValue(Integer longLifetimeValue) { - this.longLifetimeValue = longLifetimeValue; - return this; - } - - /** - * Get longLifetimeValue - * @return longLifetimeValue - **/ - @javax.annotation.Nullable - public Integer getLongLifetimeValue() { - return longLifetimeValue; - } - - public void setLongLifetimeValue(Integer longLifetimeValue) { - this.longLifetimeValue = longLifetimeValue; - } - - - public SessionConfigUpdateReq longLifetimeUnit(LongLifetimeUnitEnum longLifetimeUnit) { - this.longLifetimeUnit = longLifetimeUnit; - return this; - } - - /** - * Get longLifetimeUnit - * @return longLifetimeUnit - **/ - @javax.annotation.Nullable - public LongLifetimeUnitEnum getLongLifetimeUnit() { - return longLifetimeUnit; - } - - public void setLongLifetimeUnit(LongLifetimeUnitEnum longLifetimeUnit) { - this.longLifetimeUnit = longLifetimeUnit; - } - - - public SessionConfigUpdateReq longInactivityValue(Integer longInactivityValue) { - this.longInactivityValue = longInactivityValue; - return this; - } - - /** - * Get longInactivityValue - * @return longInactivityValue - **/ - @javax.annotation.Nullable - public Integer getLongInactivityValue() { - return longInactivityValue; - } - - public void setLongInactivityValue(Integer longInactivityValue) { - this.longInactivityValue = longInactivityValue; - } - - - public SessionConfigUpdateReq longInactivityUnit(LongInactivityUnitEnum longInactivityUnit) { - this.longInactivityUnit = longInactivityUnit; - return this; - } - - /** - * Get longInactivityUnit - * @return longInactivityUnit - **/ - @javax.annotation.Nullable - public LongInactivityUnitEnum getLongInactivityUnit() { - return longInactivityUnit; - } - - public void setLongInactivityUnit(LongInactivityUnitEnum longInactivityUnit) { - this.longInactivityUnit = longInactivityUnit; - } - - - public SessionConfigUpdateReq jwtAudience(String jwtAudience) { - this.jwtAudience = jwtAudience; - return this; - } - - /** - * Get jwtAudience - * @return jwtAudience - **/ - @javax.annotation.Nullable - public String getJwtAudience() { - return jwtAudience; - } - - public void setJwtAudience(String jwtAudience) { - this.jwtAudience = jwtAudience; - } - - - public SessionConfigUpdateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public SessionConfigUpdateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SessionConfigUpdateReq sessionConfigUpdateReq = (SessionConfigUpdateReq) o; - return Objects.equals(this.appType, sessionConfigUpdateReq.appType) && - Objects.equals(this.active, sessionConfigUpdateReq.active) && - Objects.equals(this.shortLifetimeMinutes, sessionConfigUpdateReq.shortLifetimeMinutes) && - Objects.equals(this.shortCookieDomain, sessionConfigUpdateReq.shortCookieDomain) && - Objects.equals(this.shortCookieSecure, sessionConfigUpdateReq.shortCookieSecure) && - Objects.equals(this.shortCookieSameSite, sessionConfigUpdateReq.shortCookieSameSite) && - Objects.equals(this.longLifetimeValue, sessionConfigUpdateReq.longLifetimeValue) && - Objects.equals(this.longLifetimeUnit, sessionConfigUpdateReq.longLifetimeUnit) && - Objects.equals(this.longInactivityValue, sessionConfigUpdateReq.longInactivityValue) && - Objects.equals(this.longInactivityUnit, sessionConfigUpdateReq.longInactivityUnit) && - Objects.equals(this.jwtAudience, sessionConfigUpdateReq.jwtAudience) && - Objects.equals(this.requestID, sessionConfigUpdateReq.requestID) && - Objects.equals(this.clientInfo, sessionConfigUpdateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(appType, active, shortLifetimeMinutes, shortCookieDomain, shortCookieSecure, shortCookieSameSite, longLifetimeValue, longLifetimeUnit, longInactivityValue, longInactivityUnit, jwtAudience, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SessionConfigUpdateReq {\n"); - sb.append(" appType: ").append(toIndentedString(appType)).append("\n"); - sb.append(" active: ").append(toIndentedString(active)).append("\n"); - sb.append(" shortLifetimeMinutes: ").append(toIndentedString(shortLifetimeMinutes)).append("\n"); - sb.append(" shortCookieDomain: ").append(toIndentedString(shortCookieDomain)).append("\n"); - sb.append(" shortCookieSecure: ").append(toIndentedString(shortCookieSecure)).append("\n"); - sb.append(" shortCookieSameSite: ").append(toIndentedString(shortCookieSameSite)).append("\n"); - sb.append(" longLifetimeValue: ").append(toIndentedString(longLifetimeValue)).append("\n"); - sb.append(" longLifetimeUnit: ").append(toIndentedString(longLifetimeUnit)).append("\n"); - sb.append(" longInactivityValue: ").append(toIndentedString(longInactivityValue)).append("\n"); - sb.append(" longInactivityUnit: ").append(toIndentedString(longInactivityUnit)).append("\n"); - sb.append(" jwtAudience: ").append(toIndentedString(jwtAudience)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("appType"); - openapiFields.add("active"); - openapiFields.add("shortLifetimeMinutes"); - openapiFields.add("shortCookieDomain"); - openapiFields.add("shortCookieSecure"); - openapiFields.add("shortCookieSameSite"); - openapiFields.add("longLifetimeValue"); - openapiFields.add("longLifetimeUnit"); - openapiFields.add("longInactivityValue"); - openapiFields.add("longInactivityUnit"); - openapiFields.add("jwtAudience"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("appType"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SessionConfigUpdateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SessionConfigUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SessionConfigUpdateReq is not found in the empty JSON string", SessionConfigUpdateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SessionConfigUpdateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionConfigUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SessionConfigUpdateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `appType` - AppType.validateJsonElement(jsonObj.get("appType")); - if ((jsonObj.get("shortCookieDomain") != null && !jsonObj.get("shortCookieDomain").isJsonNull()) && !jsonObj.get("shortCookieDomain").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shortCookieDomain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shortCookieDomain").toString())); - } - if ((jsonObj.get("shortCookieSameSite") != null && !jsonObj.get("shortCookieSameSite").isJsonNull()) && !jsonObj.get("shortCookieSameSite").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shortCookieSameSite` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shortCookieSameSite").toString())); - } - // validate the optional field `shortCookieSameSite` - if (jsonObj.get("shortCookieSameSite") != null && !jsonObj.get("shortCookieSameSite").isJsonNull()) { - ShortCookieSameSiteEnum.validateJsonElement(jsonObj.get("shortCookieSameSite")); - } - if ((jsonObj.get("longLifetimeUnit") != null && !jsonObj.get("longLifetimeUnit").isJsonNull()) && !jsonObj.get("longLifetimeUnit").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `longLifetimeUnit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("longLifetimeUnit").toString())); - } - // validate the optional field `longLifetimeUnit` - if (jsonObj.get("longLifetimeUnit") != null && !jsonObj.get("longLifetimeUnit").isJsonNull()) { - LongLifetimeUnitEnum.validateJsonElement(jsonObj.get("longLifetimeUnit")); - } - if ((jsonObj.get("longInactivityUnit") != null && !jsonObj.get("longInactivityUnit").isJsonNull()) && !jsonObj.get("longInactivityUnit").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `longInactivityUnit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("longInactivityUnit").toString())); - } - // validate the optional field `longInactivityUnit` - if (jsonObj.get("longInactivityUnit") != null && !jsonObj.get("longInactivityUnit").isJsonNull()) { - LongInactivityUnitEnum.validateJsonElement(jsonObj.get("longInactivityUnit")); - } - if ((jsonObj.get("jwtAudience") != null && !jsonObj.get("jwtAudience").isJsonNull()) && !jsonObj.get("jwtAudience").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `jwtAudience` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jwtAudience").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SessionConfigUpdateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SessionConfigUpdateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SessionConfigUpdateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SessionConfigUpdateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SessionConfigUpdateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SessionConfigUpdateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of SessionConfigUpdateReq - * @throws IOException if the JSON string is invalid with respect to SessionConfigUpdateReq - */ - public static SessionConfigUpdateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SessionConfigUpdateReq.class); - } - - /** - * Convert an instance of SessionConfigUpdateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SessionTokenCreateReq.java b/src/main/java/com/corbado/generated/model/SessionTokenCreateReq.java deleted file mode 100644 index 920b49b..0000000 --- a/src/main/java/com/corbado/generated/model/SessionTokenCreateReq.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SessionTokenCreateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SessionTokenCreateReq { - public static final String SERIALIZED_NAME_USER_I_D = "userID"; - @SerializedName(SERIALIZED_NAME_USER_I_D) - private String userID; - - public static final String SERIALIZED_NAME_USER_DATA = "userData"; - @SerializedName(SERIALIZED_NAME_USER_DATA) - private String userData; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public SessionTokenCreateReq() { - } - - public SessionTokenCreateReq userID(String userID) { - this.userID = userID; - return this; - } - - /** - * ID of the user - * @return userID - **/ - @javax.annotation.Nonnull - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - - public SessionTokenCreateReq userData(String userData) { - this.userData = userData; - return this; - } - - /** - * Additional user data in JSON format - * @return userData - **/ - @javax.annotation.Nonnull - public String getUserData() { - return userData; - } - - public void setUserData(String userData) { - this.userData = userData; - } - - - public SessionTokenCreateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public SessionTokenCreateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nonnull - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SessionTokenCreateReq sessionTokenCreateReq = (SessionTokenCreateReq) o; - return Objects.equals(this.userID, sessionTokenCreateReq.userID) && - Objects.equals(this.userData, sessionTokenCreateReq.userData) && - Objects.equals(this.requestID, sessionTokenCreateReq.requestID) && - Objects.equals(this.clientInfo, sessionTokenCreateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(userID, userData, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SessionTokenCreateReq {\n"); - sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("userID"); - openapiFields.add("userData"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("userID"); - openapiRequiredFields.add("userData"); - openapiRequiredFields.add("clientInfo"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SessionTokenCreateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SessionTokenCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SessionTokenCreateReq is not found in the empty JSON string", SessionTokenCreateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SessionTokenCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionTokenCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SessionTokenCreateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("userID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); - } - if (!jsonObj.get("userData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userData").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the required field `clientInfo` - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SessionTokenCreateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SessionTokenCreateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SessionTokenCreateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SessionTokenCreateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SessionTokenCreateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SessionTokenCreateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of SessionTokenCreateReq - * @throws IOException if the JSON string is invalid with respect to SessionTokenCreateReq - */ - public static SessionTokenCreateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SessionTokenCreateReq.class); - } - - /** - * Convert an instance of SessionTokenCreateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SessionTokenCreateRsp.java b/src/main/java/com/corbado/generated/model/SessionTokenCreateRsp.java deleted file mode 100644 index ef0182a..0000000 --- a/src/main/java/com/corbado/generated/model/SessionTokenCreateRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.SessionTokenCreateRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SessionTokenCreateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SessionTokenCreateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private SessionTokenCreateRspAllOfData data; - - public SessionTokenCreateRsp() { - } - - public SessionTokenCreateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public SessionTokenCreateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public SessionTokenCreateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public SessionTokenCreateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public SessionTokenCreateRsp data(SessionTokenCreateRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public SessionTokenCreateRspAllOfData getData() { - return data; - } - - public void setData(SessionTokenCreateRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SessionTokenCreateRsp sessionTokenCreateRsp = (SessionTokenCreateRsp) o; - return Objects.equals(this.httpStatusCode, sessionTokenCreateRsp.httpStatusCode) && - Objects.equals(this.message, sessionTokenCreateRsp.message) && - Objects.equals(this.requestData, sessionTokenCreateRsp.requestData) && - Objects.equals(this.runtime, sessionTokenCreateRsp.runtime) && - Objects.equals(this.data, sessionTokenCreateRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SessionTokenCreateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SessionTokenCreateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SessionTokenCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SessionTokenCreateRsp is not found in the empty JSON string", SessionTokenCreateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SessionTokenCreateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionTokenCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SessionTokenCreateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - SessionTokenCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SessionTokenCreateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SessionTokenCreateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SessionTokenCreateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SessionTokenCreateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SessionTokenCreateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SessionTokenCreateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of SessionTokenCreateRsp - * @throws IOException if the JSON string is invalid with respect to SessionTokenCreateRsp - */ - public static SessionTokenCreateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SessionTokenCreateRsp.class); - } - - /** - * Convert an instance of SessionTokenCreateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SessionTokenCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/SessionTokenCreateRspAllOfData.java deleted file mode 100644 index dd7bb7f..0000000 --- a/src/main/java/com/corbado/generated/model/SessionTokenCreateRspAllOfData.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SessionTokenCreateRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SessionTokenCreateRspAllOfData { - public static final String SERIALIZED_NAME_TOKEN = "token"; - @SerializedName(SERIALIZED_NAME_TOKEN) - private String token; - - public SessionTokenCreateRspAllOfData() { - } - - public SessionTokenCreateRspAllOfData token(String token) { - this.token = token; - return this; - } - - /** - * Get token - * @return token - **/ - @javax.annotation.Nonnull - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SessionTokenCreateRspAllOfData sessionTokenCreateRspAllOfData = (SessionTokenCreateRspAllOfData) o; - return Objects.equals(this.token, sessionTokenCreateRspAllOfData.token); - } - - @Override - public int hashCode() { - return Objects.hash(token); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SessionTokenCreateRspAllOfData {\n"); - sb.append(" token: ").append(toIndentedString(token)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("token"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("token"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SessionTokenCreateRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SessionTokenCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SessionTokenCreateRspAllOfData is not found in the empty JSON string", SessionTokenCreateRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SessionTokenCreateRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionTokenCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SessionTokenCreateRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SessionTokenCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SessionTokenCreateRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SessionTokenCreateRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SessionTokenCreateRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SessionTokenCreateRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SessionTokenCreateRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of SessionTokenCreateRspAllOfData - * @throws IOException if the JSON string is invalid with respect to SessionTokenCreateRspAllOfData - */ - public static SessionTokenCreateRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SessionTokenCreateRspAllOfData.class); - } - - /** - * Convert an instance of SessionTokenCreateRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SessionTokenVerifyReq.java b/src/main/java/com/corbado/generated/model/SessionTokenVerifyReq.java deleted file mode 100644 index 8401bfd..0000000 --- a/src/main/java/com/corbado/generated/model/SessionTokenVerifyReq.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SessionTokenVerifyReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SessionTokenVerifyReq { - public static final String SERIALIZED_NAME_TOKEN = "token"; - @SerializedName(SERIALIZED_NAME_TOKEN) - private String token; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public SessionTokenVerifyReq() { - } - - public SessionTokenVerifyReq token(String token) { - this.token = token; - return this; - } - - /** - * Get token - * @return token - **/ - @javax.annotation.Nonnull - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - - - public SessionTokenVerifyReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public SessionTokenVerifyReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nonnull - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SessionTokenVerifyReq sessionTokenVerifyReq = (SessionTokenVerifyReq) o; - return Objects.equals(this.token, sessionTokenVerifyReq.token) && - Objects.equals(this.requestID, sessionTokenVerifyReq.requestID) && - Objects.equals(this.clientInfo, sessionTokenVerifyReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(token, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SessionTokenVerifyReq {\n"); - sb.append(" token: ").append(toIndentedString(token)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("token"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("token"); - openapiRequiredFields.add("clientInfo"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SessionTokenVerifyReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SessionTokenVerifyReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SessionTokenVerifyReq is not found in the empty JSON string", SessionTokenVerifyReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SessionTokenVerifyReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionTokenVerifyReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SessionTokenVerifyReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the required field `clientInfo` - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SessionTokenVerifyReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SessionTokenVerifyReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SessionTokenVerifyReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SessionTokenVerifyReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SessionTokenVerifyReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SessionTokenVerifyReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of SessionTokenVerifyReq - * @throws IOException if the JSON string is invalid with respect to SessionTokenVerifyReq - */ - public static SessionTokenVerifyReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SessionTokenVerifyReq.class); - } - - /** - * Convert an instance of SessionTokenVerifyReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SessionTokenVerifyRsp.java b/src/main/java/com/corbado/generated/model/SessionTokenVerifyRsp.java deleted file mode 100644 index 4aa7534..0000000 --- a/src/main/java/com/corbado/generated/model/SessionTokenVerifyRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.SessionTokenVerifyRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SessionTokenVerifyRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SessionTokenVerifyRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private SessionTokenVerifyRspAllOfData data; - - public SessionTokenVerifyRsp() { - } - - public SessionTokenVerifyRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public SessionTokenVerifyRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public SessionTokenVerifyRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public SessionTokenVerifyRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public SessionTokenVerifyRsp data(SessionTokenVerifyRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public SessionTokenVerifyRspAllOfData getData() { - return data; - } - - public void setData(SessionTokenVerifyRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SessionTokenVerifyRsp sessionTokenVerifyRsp = (SessionTokenVerifyRsp) o; - return Objects.equals(this.httpStatusCode, sessionTokenVerifyRsp.httpStatusCode) && - Objects.equals(this.message, sessionTokenVerifyRsp.message) && - Objects.equals(this.requestData, sessionTokenVerifyRsp.requestData) && - Objects.equals(this.runtime, sessionTokenVerifyRsp.runtime) && - Objects.equals(this.data, sessionTokenVerifyRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SessionTokenVerifyRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SessionTokenVerifyRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SessionTokenVerifyRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SessionTokenVerifyRsp is not found in the empty JSON string", SessionTokenVerifyRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SessionTokenVerifyRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionTokenVerifyRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SessionTokenVerifyRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - SessionTokenVerifyRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SessionTokenVerifyRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SessionTokenVerifyRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SessionTokenVerifyRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SessionTokenVerifyRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SessionTokenVerifyRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SessionTokenVerifyRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of SessionTokenVerifyRsp - * @throws IOException if the JSON string is invalid with respect to SessionTokenVerifyRsp - */ - public static SessionTokenVerifyRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SessionTokenVerifyRsp.class); - } - - /** - * Convert an instance of SessionTokenVerifyRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SessionTokenVerifyRspAllOfData.java b/src/main/java/com/corbado/generated/model/SessionTokenVerifyRspAllOfData.java deleted file mode 100644 index 824e58d..0000000 --- a/src/main/java/com/corbado/generated/model/SessionTokenVerifyRspAllOfData.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.FullUser; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SessionTokenVerifyRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SessionTokenVerifyRspAllOfData { - public static final String SERIALIZED_NAME_USER_I_D = "userID"; - @SerializedName(SERIALIZED_NAME_USER_I_D) - private String userID; - - public static final String SERIALIZED_NAME_USER = "user"; - @SerializedName(SERIALIZED_NAME_USER) - private FullUser user; - - public static final String SERIALIZED_NAME_USER_DATA = "userData"; - @SerializedName(SERIALIZED_NAME_USER_DATA) - private String userData; - - public SessionTokenVerifyRspAllOfData() { - } - - public SessionTokenVerifyRspAllOfData userID(String userID) { - this.userID = userID; - return this; - } - - /** - * ID of the user - * @return userID - **/ - @javax.annotation.Nonnull - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - - public SessionTokenVerifyRspAllOfData user(FullUser user) { - this.user = user; - return this; - } - - /** - * Get user - * @return user - **/ - @javax.annotation.Nonnull - public FullUser getUser() { - return user; - } - - public void setUser(FullUser user) { - this.user = user; - } - - - public SessionTokenVerifyRspAllOfData userData(String userData) { - this.userData = userData; - return this; - } - - /** - * Get userData - * @return userData - **/ - @javax.annotation.Nonnull - public String getUserData() { - return userData; - } - - public void setUserData(String userData) { - this.userData = userData; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SessionTokenVerifyRspAllOfData sessionTokenVerifyRspAllOfData = (SessionTokenVerifyRspAllOfData) o; - return Objects.equals(this.userID, sessionTokenVerifyRspAllOfData.userID) && - Objects.equals(this.user, sessionTokenVerifyRspAllOfData.user) && - Objects.equals(this.userData, sessionTokenVerifyRspAllOfData.userData); - } - - @Override - public int hashCode() { - return Objects.hash(userID, user, userData); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SessionTokenVerifyRspAllOfData {\n"); - sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb.append(" user: ").append(toIndentedString(user)).append("\n"); - sb.append(" userData: ").append(toIndentedString(userData)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("userID"); - openapiFields.add("user"); - openapiFields.add("userData"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("userID"); - openapiRequiredFields.add("user"); - openapiRequiredFields.add("userData"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SessionTokenVerifyRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SessionTokenVerifyRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SessionTokenVerifyRspAllOfData is not found in the empty JSON string", SessionTokenVerifyRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SessionTokenVerifyRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionTokenVerifyRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SessionTokenVerifyRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("userID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); - } - // validate the required field `user` - FullUser.validateJsonElement(jsonObj.get("user")); - if (!jsonObj.get("userData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userData").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SessionTokenVerifyRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SessionTokenVerifyRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SessionTokenVerifyRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SessionTokenVerifyRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SessionTokenVerifyRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SessionTokenVerifyRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of SessionTokenVerifyRspAllOfData - * @throws IOException if the JSON string is invalid with respect to SessionTokenVerifyRspAllOfData - */ - public static SessionTokenVerifyRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SessionTokenVerifyRspAllOfData.class); - } - - /** - * Convert an instance of SessionTokenVerifyRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ShortSession.java b/src/main/java/com/corbado/generated/model/ShortSession.java new file mode 100644 index 0000000..1e718fe --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ShortSession.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ShortSession + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class ShortSession { + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public ShortSession() { + } + + public ShortSession value(String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ShortSession shortSession = (ShortSession) o; + return Objects.equals(this.value, shortSession.value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ShortSession {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ShortSession + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ShortSession.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ShortSession is not found in the empty JSON string", ShortSession.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ShortSession.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ShortSession` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ShortSession.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ShortSession.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ShortSession' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ShortSession.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ShortSession value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ShortSession read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ShortSession given an JSON string + * + * @param jsonString JSON string + * @return An instance of ShortSession + * @throws IOException if the JSON string is invalid with respect to ShortSession + */ + public static ShortSession fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ShortSession.class); + } + + /** + * Convert an instance of ShortSession to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/ShortSessionCreateReq.java b/src/main/java/com/corbado/generated/model/ShortSessionCreateReq.java new file mode 100644 index 0000000..2496eb1 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/ShortSessionCreateReq.java @@ -0,0 +1,244 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.AppType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * ShortSessionCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class ShortSessionCreateReq { + public static final String SERIALIZED_NAME_APP_TYPE = "appType"; + @SerializedName(SERIALIZED_NAME_APP_TYPE) + private AppType appType; + + public static final String SERIALIZED_NAME_ISSUER = "issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + private String issuer; + + public ShortSessionCreateReq() { + } + + public ShortSessionCreateReq appType(AppType appType) { + this.appType = appType; + return this; + } + + /** + * Get appType + * @return appType + */ + @javax.annotation.Nonnull + public AppType getAppType() { + return appType; + } + + public void setAppType(AppType appType) { + this.appType = appType; + } + + + public ShortSessionCreateReq issuer(String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get issuer + * @return issuer + */ + @javax.annotation.Nonnull + public String getIssuer() { + return issuer; + } + + public void setIssuer(String issuer) { + this.issuer = issuer; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ShortSessionCreateReq shortSessionCreateReq = (ShortSessionCreateReq) o; + return Objects.equals(this.appType, shortSessionCreateReq.appType) && + Objects.equals(this.issuer, shortSessionCreateReq.issuer); + } + + @Override + public int hashCode() { + return Objects.hash(appType, issuer); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ShortSessionCreateReq {\n"); + sb.append(" appType: ").append(toIndentedString(appType)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("appType"); + openapiFields.add("issuer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("appType"); + openapiRequiredFields.add("issuer"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ShortSessionCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ShortSessionCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ShortSessionCreateReq is not found in the empty JSON string", ShortSessionCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ShortSessionCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ShortSessionCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ShortSessionCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `appType` + AppType.validateJsonElement(jsonObj.get("appType")); + if (!jsonObj.get("issuer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ShortSessionCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ShortSessionCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ShortSessionCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ShortSessionCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ShortSessionCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ShortSessionCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of ShortSessionCreateReq + * @throws IOException if the JSON string is invalid with respect to ShortSessionCreateReq + */ + public static ShortSessionCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ShortSessionCreateReq.class); + } + + /** + * Convert an instance of ShortSessionCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SmsCodeSendReq.java b/src/main/java/com/corbado/generated/model/SmsCodeSendReq.java deleted file mode 100644 index a0bbf38..0000000 --- a/src/main/java/com/corbado/generated/model/SmsCodeSendReq.java +++ /dev/null @@ -1,359 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SmsCodeSendReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SmsCodeSendReq { - public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; - @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) - private String phoneNumber; - - public static final String SERIALIZED_NAME_CREATE = "create"; - @SerializedName(SERIALIZED_NAME_CREATE) - private Boolean create; - - public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; - @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) - private String userFullName; - - public static final String SERIALIZED_NAME_TEMPLATE_NAME = "templateName"; - @SerializedName(SERIALIZED_NAME_TEMPLATE_NAME) - private String templateName; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public SmsCodeSendReq() { - } - - public SmsCodeSendReq phoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - /** - * Recipient phone number - * @return phoneNumber - **/ - @javax.annotation.Nonnull - public String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - - - public SmsCodeSendReq create(Boolean create) { - this.create = create; - return this; - } - - /** - * Defines if user phone number should be created if not found - * @return create - **/ - @javax.annotation.Nonnull - public Boolean getCreate() { - return create; - } - - public void setCreate(Boolean create) { - this.create = create; - } - - - public SmsCodeSendReq userFullName(String userFullName) { - this.userFullName = userFullName; - return this; - } - - /** - * Optional user's full name to be used if the user wasn't found and needs to be created first - * @return userFullName - **/ - @javax.annotation.Nullable - public String getUserFullName() { - return userFullName; - } - - public void setUserFullName(String userFullName) { - this.userFullName = userFullName; - } - - - public SmsCodeSendReq templateName(String templateName) { - this.templateName = templateName; - return this; - } - - /** - * Template name of SMS to send - * @return templateName - **/ - @javax.annotation.Nullable - public String getTemplateName() { - return templateName; - } - - public void setTemplateName(String templateName) { - this.templateName = templateName; - } - - - public SmsCodeSendReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public SmsCodeSendReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SmsCodeSendReq smsCodeSendReq = (SmsCodeSendReq) o; - return Objects.equals(this.phoneNumber, smsCodeSendReq.phoneNumber) && - Objects.equals(this.create, smsCodeSendReq.create) && - Objects.equals(this.userFullName, smsCodeSendReq.userFullName) && - Objects.equals(this.templateName, smsCodeSendReq.templateName) && - Objects.equals(this.requestID, smsCodeSendReq.requestID) && - Objects.equals(this.clientInfo, smsCodeSendReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(phoneNumber, create, userFullName, templateName, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SmsCodeSendReq {\n"); - sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); - sb.append(" create: ").append(toIndentedString(create)).append("\n"); - sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); - sb.append(" templateName: ").append(toIndentedString(templateName)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("phoneNumber"); - openapiFields.add("create"); - openapiFields.add("userFullName"); - openapiFields.add("templateName"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("phoneNumber"); - openapiRequiredFields.add("create"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SmsCodeSendReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SmsCodeSendReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SmsCodeSendReq is not found in the empty JSON string", SmsCodeSendReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SmsCodeSendReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsCodeSendReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SmsCodeSendReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("phoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); - } - if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); - } - if ((jsonObj.get("templateName") != null && !jsonObj.get("templateName").isJsonNull()) && !jsonObj.get("templateName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `templateName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("templateName").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SmsCodeSendReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SmsCodeSendReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SmsCodeSendReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SmsCodeSendReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SmsCodeSendReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SmsCodeSendReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of SmsCodeSendReq - * @throws IOException if the JSON string is invalid with respect to SmsCodeSendReq - */ - public static SmsCodeSendReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SmsCodeSendReq.class); - } - - /** - * Convert an instance of SmsCodeSendReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SmsCodeSendRsp.java b/src/main/java/com/corbado/generated/model/SmsCodeSendRsp.java deleted file mode 100644 index 1168a40..0000000 --- a/src/main/java/com/corbado/generated/model/SmsCodeSendRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.SmsCodeSendRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SmsCodeSendRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SmsCodeSendRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private SmsCodeSendRspAllOfData data; - - public SmsCodeSendRsp() { - } - - public SmsCodeSendRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public SmsCodeSendRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public SmsCodeSendRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public SmsCodeSendRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public SmsCodeSendRsp data(SmsCodeSendRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public SmsCodeSendRspAllOfData getData() { - return data; - } - - public void setData(SmsCodeSendRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SmsCodeSendRsp smsCodeSendRsp = (SmsCodeSendRsp) o; - return Objects.equals(this.httpStatusCode, smsCodeSendRsp.httpStatusCode) && - Objects.equals(this.message, smsCodeSendRsp.message) && - Objects.equals(this.requestData, smsCodeSendRsp.requestData) && - Objects.equals(this.runtime, smsCodeSendRsp.runtime) && - Objects.equals(this.data, smsCodeSendRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SmsCodeSendRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SmsCodeSendRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SmsCodeSendRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SmsCodeSendRsp is not found in the empty JSON string", SmsCodeSendRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SmsCodeSendRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsCodeSendRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SmsCodeSendRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - SmsCodeSendRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SmsCodeSendRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SmsCodeSendRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SmsCodeSendRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SmsCodeSendRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SmsCodeSendRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SmsCodeSendRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of SmsCodeSendRsp - * @throws IOException if the JSON string is invalid with respect to SmsCodeSendRsp - */ - public static SmsCodeSendRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SmsCodeSendRsp.class); - } - - /** - * Convert an instance of SmsCodeSendRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SmsCodeSendRspAllOfData.java b/src/main/java/com/corbado/generated/model/SmsCodeSendRspAllOfData.java deleted file mode 100644 index c00a6b3..0000000 --- a/src/main/java/com/corbado/generated/model/SmsCodeSendRspAllOfData.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SmsCodeSendRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SmsCodeSendRspAllOfData { - public static final String SERIALIZED_NAME_SMS_CODE_I_D = "smsCodeID"; - @SerializedName(SERIALIZED_NAME_SMS_CODE_I_D) - private String smsCodeID; - - public SmsCodeSendRspAllOfData() { - } - - public SmsCodeSendRspAllOfData smsCodeID(String smsCodeID) { - this.smsCodeID = smsCodeID; - return this; - } - - /** - * Get smsCodeID - * @return smsCodeID - **/ - @javax.annotation.Nonnull - public String getSmsCodeID() { - return smsCodeID; - } - - public void setSmsCodeID(String smsCodeID) { - this.smsCodeID = smsCodeID; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SmsCodeSendRspAllOfData smsCodeSendRspAllOfData = (SmsCodeSendRspAllOfData) o; - return Objects.equals(this.smsCodeID, smsCodeSendRspAllOfData.smsCodeID); - } - - @Override - public int hashCode() { - return Objects.hash(smsCodeID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SmsCodeSendRspAllOfData {\n"); - sb.append(" smsCodeID: ").append(toIndentedString(smsCodeID)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("smsCodeID"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("smsCodeID"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SmsCodeSendRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SmsCodeSendRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SmsCodeSendRspAllOfData is not found in the empty JSON string", SmsCodeSendRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SmsCodeSendRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsCodeSendRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SmsCodeSendRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("smsCodeID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `smsCodeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smsCodeID").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SmsCodeSendRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SmsCodeSendRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SmsCodeSendRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SmsCodeSendRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SmsCodeSendRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SmsCodeSendRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of SmsCodeSendRspAllOfData - * @throws IOException if the JSON string is invalid with respect to SmsCodeSendRspAllOfData - */ - public static SmsCodeSendRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SmsCodeSendRspAllOfData.class); - } - - /** - * Convert an instance of SmsCodeSendRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SmsCodeValidateReq.java b/src/main/java/com/corbado/generated/model/SmsCodeValidateReq.java deleted file mode 100644 index b2dcfb0..0000000 --- a/src/main/java/com/corbado/generated/model/SmsCodeValidateReq.java +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SmsCodeValidateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SmsCodeValidateReq { - public static final String SERIALIZED_NAME_SMS_CODE = "smsCode"; - @SerializedName(SERIALIZED_NAME_SMS_CODE) - private String smsCode; - - public static final String SERIALIZED_NAME_CREATE_LOGIN_TOKEN = "createLoginToken"; - @SerializedName(SERIALIZED_NAME_CREATE_LOGIN_TOKEN) - private Boolean createLoginToken; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public SmsCodeValidateReq() { - } - - public SmsCodeValidateReq smsCode(String smsCode) { - this.smsCode = smsCode; - return this; - } - - /** - * SMS OTP to validate - * @return smsCode - **/ - @javax.annotation.Nonnull - public String getSmsCode() { - return smsCode; - } - - public void setSmsCode(String smsCode) { - this.smsCode = smsCode; - } - - - public SmsCodeValidateReq createLoginToken(Boolean createLoginToken) { - this.createLoginToken = createLoginToken; - return this; - } - - /** - * Get createLoginToken - * @return createLoginToken - **/ - @javax.annotation.Nullable - public Boolean getCreateLoginToken() { - return createLoginToken; - } - - public void setCreateLoginToken(Boolean createLoginToken) { - this.createLoginToken = createLoginToken; - } - - - public SmsCodeValidateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public SmsCodeValidateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SmsCodeValidateReq smsCodeValidateReq = (SmsCodeValidateReq) o; - return Objects.equals(this.smsCode, smsCodeValidateReq.smsCode) && - Objects.equals(this.createLoginToken, smsCodeValidateReq.createLoginToken) && - Objects.equals(this.requestID, smsCodeValidateReq.requestID) && - Objects.equals(this.clientInfo, smsCodeValidateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(smsCode, createLoginToken, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SmsCodeValidateReq {\n"); - sb.append(" smsCode: ").append(toIndentedString(smsCode)).append("\n"); - sb.append(" createLoginToken: ").append(toIndentedString(createLoginToken)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("smsCode"); - openapiFields.add("createLoginToken"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("smsCode"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SmsCodeValidateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SmsCodeValidateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SmsCodeValidateReq is not found in the empty JSON string", SmsCodeValidateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SmsCodeValidateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsCodeValidateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SmsCodeValidateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("smsCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `smsCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smsCode").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SmsCodeValidateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SmsCodeValidateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SmsCodeValidateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SmsCodeValidateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SmsCodeValidateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SmsCodeValidateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of SmsCodeValidateReq - * @throws IOException if the JSON string is invalid with respect to SmsCodeValidateReq - */ - public static SmsCodeValidateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SmsCodeValidateReq.class); - } - - /** - * Convert an instance of SmsCodeValidateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SmsCodeValidateRsp.java b/src/main/java/com/corbado/generated/model/SmsCodeValidateRsp.java deleted file mode 100644 index 57192ba..0000000 --- a/src/main/java/com/corbado/generated/model/SmsCodeValidateRsp.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SmsCodeValidateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SmsCodeValidateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_LOGIN_TOKEN = "loginToken"; - @SerializedName(SERIALIZED_NAME_LOGIN_TOKEN) - private String loginToken; - - public SmsCodeValidateRsp() { - } - - public SmsCodeValidateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public SmsCodeValidateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public SmsCodeValidateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public SmsCodeValidateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public SmsCodeValidateRsp loginToken(String loginToken) { - this.loginToken = loginToken; - return this; - } - - /** - * Get loginToken - * @return loginToken - **/ - @javax.annotation.Nullable - public String getLoginToken() { - return loginToken; - } - - public void setLoginToken(String loginToken) { - this.loginToken = loginToken; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SmsCodeValidateRsp smsCodeValidateRsp = (SmsCodeValidateRsp) o; - return Objects.equals(this.httpStatusCode, smsCodeValidateRsp.httpStatusCode) && - Objects.equals(this.message, smsCodeValidateRsp.message) && - Objects.equals(this.requestData, smsCodeValidateRsp.requestData) && - Objects.equals(this.runtime, smsCodeValidateRsp.runtime) && - Objects.equals(this.loginToken, smsCodeValidateRsp.loginToken); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, loginToken); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SmsCodeValidateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" loginToken: ").append(toIndentedString(loginToken)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("loginToken"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SmsCodeValidateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SmsCodeValidateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SmsCodeValidateRsp is not found in the empty JSON string", SmsCodeValidateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SmsCodeValidateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsCodeValidateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SmsCodeValidateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if ((jsonObj.get("loginToken") != null && !jsonObj.get("loginToken").isJsonNull()) && !jsonObj.get("loginToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `loginToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginToken").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SmsCodeValidateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SmsCodeValidateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SmsCodeValidateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SmsCodeValidateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SmsCodeValidateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SmsCodeValidateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of SmsCodeValidateRsp - * @throws IOException if the JSON string is invalid with respect to SmsCodeValidateRsp - */ - public static SmsCodeValidateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SmsCodeValidateRsp.class); - } - - /** - * Convert an instance of SmsCodeValidateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SmsTemplateCreateReq.java b/src/main/java/com/corbado/generated/model/SmsTemplateCreateReq.java deleted file mode 100644 index 174d2f6..0000000 --- a/src/main/java/com/corbado/generated/model/SmsTemplateCreateReq.java +++ /dev/null @@ -1,415 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SmsTemplateCreateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SmsTemplateCreateReq { - /** - * Gets or Sets type - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - SMS_CODE("sms_code"), - - PASSKEY_NOTIFICATION("passkey_notification"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_TEXT_PLAIN = "textPlain"; - @SerializedName(SERIALIZED_NAME_TEXT_PLAIN) - private String textPlain; - - public static final String SERIALIZED_NAME_IS_DEFAULT = "isDefault"; - @SerializedName(SERIALIZED_NAME_IS_DEFAULT) - private Boolean isDefault; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public SmsTemplateCreateReq() { - } - - public SmsTemplateCreateReq type(TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - **/ - @javax.annotation.Nonnull - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - - public SmsTemplateCreateReq name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public SmsTemplateCreateReq textPlain(String textPlain) { - this.textPlain = textPlain; - return this; - } - - /** - * Get textPlain - * @return textPlain - **/ - @javax.annotation.Nonnull - public String getTextPlain() { - return textPlain; - } - - public void setTextPlain(String textPlain) { - this.textPlain = textPlain; - } - - - public SmsTemplateCreateReq isDefault(Boolean isDefault) { - this.isDefault = isDefault; - return this; - } - - /** - * Get isDefault - * @return isDefault - **/ - @javax.annotation.Nonnull - public Boolean getIsDefault() { - return isDefault; - } - - public void setIsDefault(Boolean isDefault) { - this.isDefault = isDefault; - } - - - public SmsTemplateCreateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public SmsTemplateCreateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SmsTemplateCreateReq smsTemplateCreateReq = (SmsTemplateCreateReq) o; - return Objects.equals(this.type, smsTemplateCreateReq.type) && - Objects.equals(this.name, smsTemplateCreateReq.name) && - Objects.equals(this.textPlain, smsTemplateCreateReq.textPlain) && - Objects.equals(this.isDefault, smsTemplateCreateReq.isDefault) && - Objects.equals(this.requestID, smsTemplateCreateReq.requestID) && - Objects.equals(this.clientInfo, smsTemplateCreateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(type, name, textPlain, isDefault, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SmsTemplateCreateReq {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" textPlain: ").append(toIndentedString(textPlain)).append("\n"); - sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("type"); - openapiFields.add("name"); - openapiFields.add("textPlain"); - openapiFields.add("isDefault"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("type"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("textPlain"); - openapiRequiredFields.add("isDefault"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SmsTemplateCreateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SmsTemplateCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SmsTemplateCreateReq is not found in the empty JSON string", SmsTemplateCreateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SmsTemplateCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsTemplateCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SmsTemplateCreateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - // validate the required field `type` - TypeEnum.validateJsonElement(jsonObj.get("type")); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("textPlain").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `textPlain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("textPlain").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SmsTemplateCreateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SmsTemplateCreateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SmsTemplateCreateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SmsTemplateCreateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SmsTemplateCreateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SmsTemplateCreateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of SmsTemplateCreateReq - * @throws IOException if the JSON string is invalid with respect to SmsTemplateCreateReq - */ - public static SmsTemplateCreateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SmsTemplateCreateReq.class); - } - - /** - * Convert an instance of SmsTemplateCreateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SmsTemplateCreateRsp.java b/src/main/java/com/corbado/generated/model/SmsTemplateCreateRsp.java deleted file mode 100644 index 69a578f..0000000 --- a/src/main/java/com/corbado/generated/model/SmsTemplateCreateRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.SmsTemplateCreateRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SmsTemplateCreateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SmsTemplateCreateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private SmsTemplateCreateRspAllOfData data; - - public SmsTemplateCreateRsp() { - } - - public SmsTemplateCreateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public SmsTemplateCreateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public SmsTemplateCreateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public SmsTemplateCreateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public SmsTemplateCreateRsp data(SmsTemplateCreateRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public SmsTemplateCreateRspAllOfData getData() { - return data; - } - - public void setData(SmsTemplateCreateRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SmsTemplateCreateRsp smsTemplateCreateRsp = (SmsTemplateCreateRsp) o; - return Objects.equals(this.httpStatusCode, smsTemplateCreateRsp.httpStatusCode) && - Objects.equals(this.message, smsTemplateCreateRsp.message) && - Objects.equals(this.requestData, smsTemplateCreateRsp.requestData) && - Objects.equals(this.runtime, smsTemplateCreateRsp.runtime) && - Objects.equals(this.data, smsTemplateCreateRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SmsTemplateCreateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SmsTemplateCreateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SmsTemplateCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SmsTemplateCreateRsp is not found in the empty JSON string", SmsTemplateCreateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SmsTemplateCreateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsTemplateCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SmsTemplateCreateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - SmsTemplateCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SmsTemplateCreateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SmsTemplateCreateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SmsTemplateCreateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SmsTemplateCreateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SmsTemplateCreateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SmsTemplateCreateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of SmsTemplateCreateRsp - * @throws IOException if the JSON string is invalid with respect to SmsTemplateCreateRsp - */ - public static SmsTemplateCreateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SmsTemplateCreateRsp.class); - } - - /** - * Convert an instance of SmsTemplateCreateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SmsTemplateCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/SmsTemplateCreateRspAllOfData.java deleted file mode 100644 index d1061f5..0000000 --- a/src/main/java/com/corbado/generated/model/SmsTemplateCreateRspAllOfData.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SmsTemplateCreateRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SmsTemplateCreateRspAllOfData { - public static final String SERIALIZED_NAME_SMS_TEMPLATE_I_D = "smsTemplateID"; - @SerializedName(SERIALIZED_NAME_SMS_TEMPLATE_I_D) - private String smsTemplateID; - - public SmsTemplateCreateRspAllOfData() { - } - - public SmsTemplateCreateRspAllOfData smsTemplateID(String smsTemplateID) { - this.smsTemplateID = smsTemplateID; - return this; - } - - /** - * Get smsTemplateID - * @return smsTemplateID - **/ - @javax.annotation.Nonnull - public String getSmsTemplateID() { - return smsTemplateID; - } - - public void setSmsTemplateID(String smsTemplateID) { - this.smsTemplateID = smsTemplateID; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SmsTemplateCreateRspAllOfData smsTemplateCreateRspAllOfData = (SmsTemplateCreateRspAllOfData) o; - return Objects.equals(this.smsTemplateID, smsTemplateCreateRspAllOfData.smsTemplateID); - } - - @Override - public int hashCode() { - return Objects.hash(smsTemplateID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SmsTemplateCreateRspAllOfData {\n"); - sb.append(" smsTemplateID: ").append(toIndentedString(smsTemplateID)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("smsTemplateID"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("smsTemplateID"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SmsTemplateCreateRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SmsTemplateCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SmsTemplateCreateRspAllOfData is not found in the empty JSON string", SmsTemplateCreateRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SmsTemplateCreateRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsTemplateCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SmsTemplateCreateRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("smsTemplateID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `smsTemplateID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smsTemplateID").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SmsTemplateCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SmsTemplateCreateRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SmsTemplateCreateRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SmsTemplateCreateRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SmsTemplateCreateRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SmsTemplateCreateRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of SmsTemplateCreateRspAllOfData - * @throws IOException if the JSON string is invalid with respect to SmsTemplateCreateRspAllOfData - */ - public static SmsTemplateCreateRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SmsTemplateCreateRspAllOfData.class); - } - - /** - * Convert an instance of SmsTemplateCreateRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SmsTemplateDeleteReq.java b/src/main/java/com/corbado/generated/model/SmsTemplateDeleteReq.java deleted file mode 100644 index 35320a7..0000000 --- a/src/main/java/com/corbado/generated/model/SmsTemplateDeleteReq.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * SmsTemplateDeleteReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class SmsTemplateDeleteReq { - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public SmsTemplateDeleteReq() { - } - - public SmsTemplateDeleteReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public SmsTemplateDeleteReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SmsTemplateDeleteReq smsTemplateDeleteReq = (SmsTemplateDeleteReq) o; - return Objects.equals(this.requestID, smsTemplateDeleteReq.requestID) && - Objects.equals(this.clientInfo, smsTemplateDeleteReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SmsTemplateDeleteReq {\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SmsTemplateDeleteReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SmsTemplateDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SmsTemplateDeleteReq is not found in the empty JSON string", SmsTemplateDeleteReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SmsTemplateDeleteReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SmsTemplateDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SmsTemplateDeleteReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SmsTemplateDeleteReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SmsTemplateDeleteReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SmsTemplateDeleteReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SmsTemplateDeleteReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SmsTemplateDeleteReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of SmsTemplateDeleteReq - * @throws IOException if the JSON string is invalid with respect to SmsTemplateDeleteReq - */ - public static SmsTemplateDeleteReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SmsTemplateDeleteReq.class); - } - - /** - * Convert an instance of SmsTemplateDeleteReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/SocialAccount.java b/src/main/java/com/corbado/generated/model/SocialAccount.java new file mode 100644 index 0000000..4993f35 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SocialAccount.java @@ -0,0 +1,394 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SocialAccount + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class SocialAccount { + public static final String SERIALIZED_NAME_SOCIAL_ACCOUNT_I_D = "socialAccountID"; + @SerializedName(SERIALIZED_NAME_SOCIAL_ACCOUNT_I_D) + private String socialAccountID; + + public static final String SERIALIZED_NAME_PROVIDER_TYPE = "providerType"; + @SerializedName(SERIALIZED_NAME_PROVIDER_TYPE) + private String providerType; + + public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) + private String identifierValue; + + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; + + public static final String SERIALIZED_NAME_FOREIGN_I_D = "foreignID"; + @SerializedName(SERIALIZED_NAME_FOREIGN_I_D) + private String foreignID; + + public static final String SERIALIZED_NAME_AVATAR_U_R_L = "avatarURL"; + @SerializedName(SERIALIZED_NAME_AVATAR_U_R_L) + private String avatarURL; + + public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; + @SerializedName(SERIALIZED_NAME_FULL_NAME) + private String fullName; + + public SocialAccount() { + } + + public SocialAccount socialAccountID(String socialAccountID) { + this.socialAccountID = socialAccountID; + return this; + } + + /** + * Get socialAccountID + * @return socialAccountID + */ + @javax.annotation.Nonnull + public String getSocialAccountID() { + return socialAccountID; + } + + public void setSocialAccountID(String socialAccountID) { + this.socialAccountID = socialAccountID; + } + + + public SocialAccount providerType(String providerType) { + this.providerType = providerType; + return this; + } + + /** + * Get providerType + * @return providerType + */ + @javax.annotation.Nonnull + public String getProviderType() { + return providerType; + } + + public void setProviderType(String providerType) { + this.providerType = providerType; + } + + + public SocialAccount identifierValue(String identifierValue) { + this.identifierValue = identifierValue; + return this; + } + + /** + * Get identifierValue + * @return identifierValue + */ + @javax.annotation.Nonnull + public String getIdentifierValue() { + return identifierValue; + } + + public void setIdentifierValue(String identifierValue) { + this.identifierValue = identifierValue; + } + + + public SocialAccount userID(String userID) { + this.userID = userID; + return this; + } + + /** + * Get userID + * @return userID + */ + @javax.annotation.Nonnull + public String getUserID() { + return userID; + } + + public void setUserID(String userID) { + this.userID = userID; + } + + + public SocialAccount foreignID(String foreignID) { + this.foreignID = foreignID; + return this; + } + + /** + * Get foreignID + * @return foreignID + */ + @javax.annotation.Nonnull + public String getForeignID() { + return foreignID; + } + + public void setForeignID(String foreignID) { + this.foreignID = foreignID; + } + + + public SocialAccount avatarURL(String avatarURL) { + this.avatarURL = avatarURL; + return this; + } + + /** + * Get avatarURL + * @return avatarURL + */ + @javax.annotation.Nonnull + public String getAvatarURL() { + return avatarURL; + } + + public void setAvatarURL(String avatarURL) { + this.avatarURL = avatarURL; + } + + + public SocialAccount fullName(String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + */ + @javax.annotation.Nonnull + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialAccount socialAccount = (SocialAccount) o; + return Objects.equals(this.socialAccountID, socialAccount.socialAccountID) && + Objects.equals(this.providerType, socialAccount.providerType) && + Objects.equals(this.identifierValue, socialAccount.identifierValue) && + Objects.equals(this.userID, socialAccount.userID) && + Objects.equals(this.foreignID, socialAccount.foreignID) && + Objects.equals(this.avatarURL, socialAccount.avatarURL) && + Objects.equals(this.fullName, socialAccount.fullName); + } + + @Override + public int hashCode() { + return Objects.hash(socialAccountID, providerType, identifierValue, userID, foreignID, avatarURL, fullName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialAccount {\n"); + sb.append(" socialAccountID: ").append(toIndentedString(socialAccountID)).append("\n"); + sb.append(" providerType: ").append(toIndentedString(providerType)).append("\n"); + sb.append(" identifierValue: ").append(toIndentedString(identifierValue)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); + sb.append(" foreignID: ").append(toIndentedString(foreignID)).append("\n"); + sb.append(" avatarURL: ").append(toIndentedString(avatarURL)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("socialAccountID"); + openapiFields.add("providerType"); + openapiFields.add("identifierValue"); + openapiFields.add("userID"); + openapiFields.add("foreignID"); + openapiFields.add("avatarURL"); + openapiFields.add("fullName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("socialAccountID"); + openapiRequiredFields.add("providerType"); + openapiRequiredFields.add("identifierValue"); + openapiRequiredFields.add("userID"); + openapiRequiredFields.add("foreignID"); + openapiRequiredFields.add("avatarURL"); + openapiRequiredFields.add("fullName"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SocialAccount + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialAccount.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialAccount is not found in the empty JSON string", SocialAccount.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SocialAccount.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SocialAccount` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SocialAccount.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("socialAccountID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `socialAccountID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialAccountID").toString())); + } + if (!jsonObj.get("providerType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `providerType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("providerType").toString())); + } + if (!jsonObj.get("identifierValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identifierValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifierValue").toString())); + } + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); + } + if (!jsonObj.get("foreignID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `foreignID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("foreignID").toString())); + } + if (!jsonObj.get("avatarURL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `avatarURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avatarURL").toString())); + } + if (!jsonObj.get("fullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SocialAccount.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialAccount' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialAccount.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SocialAccount value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SocialAccount read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialAccount given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialAccount + * @throws IOException if the JSON string is invalid with respect to SocialAccount + */ + public static SocialAccount fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialAccount.class); + } + + /** + * Convert an instance of SocialAccount to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java b/src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java new file mode 100644 index 0000000..5e85fa8 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java @@ -0,0 +1,334 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.SocialProviderType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SocialAccountCreateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class SocialAccountCreateReq { + public static final String SERIALIZED_NAME_PROVIDER_TYPE = "providerType"; + @SerializedName(SERIALIZED_NAME_PROVIDER_TYPE) + private SocialProviderType providerType; + + public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) + private String identifierValue; + + public static final String SERIALIZED_NAME_FOREIGN_I_D = "foreignID"; + @SerializedName(SERIALIZED_NAME_FOREIGN_I_D) + private String foreignID; + + public static final String SERIALIZED_NAME_AVATAR_U_R_L = "avatarURL"; + @SerializedName(SERIALIZED_NAME_AVATAR_U_R_L) + private String avatarURL; + + public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; + @SerializedName(SERIALIZED_NAME_FULL_NAME) + private String fullName; + + public SocialAccountCreateReq() { + } + + public SocialAccountCreateReq providerType(SocialProviderType providerType) { + this.providerType = providerType; + return this; + } + + /** + * Get providerType + * @return providerType + */ + @javax.annotation.Nonnull + public SocialProviderType getProviderType() { + return providerType; + } + + public void setProviderType(SocialProviderType providerType) { + this.providerType = providerType; + } + + + public SocialAccountCreateReq identifierValue(String identifierValue) { + this.identifierValue = identifierValue; + return this; + } + + /** + * Get identifierValue + * @return identifierValue + */ + @javax.annotation.Nonnull + public String getIdentifierValue() { + return identifierValue; + } + + public void setIdentifierValue(String identifierValue) { + this.identifierValue = identifierValue; + } + + + public SocialAccountCreateReq foreignID(String foreignID) { + this.foreignID = foreignID; + return this; + } + + /** + * Get foreignID + * @return foreignID + */ + @javax.annotation.Nonnull + public String getForeignID() { + return foreignID; + } + + public void setForeignID(String foreignID) { + this.foreignID = foreignID; + } + + + public SocialAccountCreateReq avatarURL(String avatarURL) { + this.avatarURL = avatarURL; + return this; + } + + /** + * Get avatarURL + * @return avatarURL + */ + @javax.annotation.Nonnull + public String getAvatarURL() { + return avatarURL; + } + + public void setAvatarURL(String avatarURL) { + this.avatarURL = avatarURL; + } + + + public SocialAccountCreateReq fullName(String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + */ + @javax.annotation.Nonnull + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialAccountCreateReq socialAccountCreateReq = (SocialAccountCreateReq) o; + return Objects.equals(this.providerType, socialAccountCreateReq.providerType) && + Objects.equals(this.identifierValue, socialAccountCreateReq.identifierValue) && + Objects.equals(this.foreignID, socialAccountCreateReq.foreignID) && + Objects.equals(this.avatarURL, socialAccountCreateReq.avatarURL) && + Objects.equals(this.fullName, socialAccountCreateReq.fullName); + } + + @Override + public int hashCode() { + return Objects.hash(providerType, identifierValue, foreignID, avatarURL, fullName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialAccountCreateReq {\n"); + sb.append(" providerType: ").append(toIndentedString(providerType)).append("\n"); + sb.append(" identifierValue: ").append(toIndentedString(identifierValue)).append("\n"); + sb.append(" foreignID: ").append(toIndentedString(foreignID)).append("\n"); + sb.append(" avatarURL: ").append(toIndentedString(avatarURL)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("providerType"); + openapiFields.add("identifierValue"); + openapiFields.add("foreignID"); + openapiFields.add("avatarURL"); + openapiFields.add("fullName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("providerType"); + openapiRequiredFields.add("identifierValue"); + openapiRequiredFields.add("foreignID"); + openapiRequiredFields.add("avatarURL"); + openapiRequiredFields.add("fullName"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SocialAccountCreateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialAccountCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialAccountCreateReq is not found in the empty JSON string", SocialAccountCreateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SocialAccountCreateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SocialAccountCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SocialAccountCreateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `providerType` + SocialProviderType.validateJsonElement(jsonObj.get("providerType")); + if (!jsonObj.get("identifierValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identifierValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifierValue").toString())); + } + if (!jsonObj.get("foreignID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `foreignID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("foreignID").toString())); + } + if (!jsonObj.get("avatarURL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `avatarURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avatarURL").toString())); + } + if (!jsonObj.get("fullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SocialAccountCreateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialAccountCreateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialAccountCreateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SocialAccountCreateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SocialAccountCreateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialAccountCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialAccountCreateReq + * @throws IOException if the JSON string is invalid with respect to SocialAccountCreateReq + */ + public static SocialAccountCreateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialAccountCreateReq.class); + } + + /** + * Convert an instance of SocialAccountCreateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SocialAccountList.java b/src/main/java/com/corbado/generated/model/SocialAccountList.java new file mode 100644 index 0000000..c7db6d0 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/SocialAccountList.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.SocialAccount; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * SocialAccountList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class SocialAccountList { + public static final String SERIALIZED_NAME_SOCIAL_ACCOUNTS = "socialAccounts"; + @SerializedName(SERIALIZED_NAME_SOCIAL_ACCOUNTS) + private List socialAccounts = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public SocialAccountList() { + } + + public SocialAccountList socialAccounts(List socialAccounts) { + this.socialAccounts = socialAccounts; + return this; + } + + public SocialAccountList addSocialAccountsItem(SocialAccount socialAccountsItem) { + if (this.socialAccounts == null) { + this.socialAccounts = new ArrayList<>(); + } + this.socialAccounts.add(socialAccountsItem); + return this; + } + + /** + * Get socialAccounts + * @return socialAccounts + */ + @javax.annotation.Nonnull + public List getSocialAccounts() { + return socialAccounts; + } + + public void setSocialAccounts(List socialAccounts) { + this.socialAccounts = socialAccounts; + } + + + public SocialAccountList paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + */ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialAccountList socialAccountList = (SocialAccountList) o; + return Objects.equals(this.socialAccounts, socialAccountList.socialAccounts) && + Objects.equals(this.paging, socialAccountList.paging); + } + + @Override + public int hashCode() { + return Objects.hash(socialAccounts, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialAccountList {\n"); + sb.append(" socialAccounts: ").append(toIndentedString(socialAccounts)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("socialAccounts"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("socialAccounts"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SocialAccountList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialAccountList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialAccountList is not found in the empty JSON string", SocialAccountList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SocialAccountList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SocialAccountList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SocialAccountList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("socialAccounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `socialAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("socialAccounts").toString())); + } + + JsonArray jsonArraysocialAccounts = jsonObj.getAsJsonArray("socialAccounts"); + // validate the required field `socialAccounts` (array) + for (int i = 0; i < jsonArraysocialAccounts.size(); i++) { + SocialAccount.validateJsonElement(jsonArraysocialAccounts.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SocialAccountList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialAccountList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialAccountList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SocialAccountList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SocialAccountList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialAccountList given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialAccountList + * @throws IOException if the JSON string is invalid with respect to SocialAccountList + */ + public static SocialAccountList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialAccountList.class); + } + + /** + * Convert an instance of SocialAccountList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/SocialProviderType.java b/src/main/java/com/corbado/generated/model/SocialProviderType.java index 0ccbd1d..b9c6451 100644 --- a/src/main/java/com/corbado/generated/model/SocialProviderType.java +++ b/src/main/java/com/corbado/generated/model/SocialProviderType.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/corbado/generated/model/Status.java b/src/main/java/com/corbado/generated/model/Status.java deleted file mode 100644 index e54facc..0000000 --- a/src/main/java/com/corbado/generated/model/Status.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.annotations.SerializedName; - -import java.io.IOException; -import com.google.gson.TypeAdapter; -import com.google.gson.JsonElement; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; - -/** - * Generic status that can describe Corbado entities - */ -@JsonAdapter(Status.Adapter.class) -public enum Status { - - ACTIVE("active"), - - PENDING("pending"), - - DELETED("deleted"); - - private String value; - - Status(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static Status fromValue(String value) { - for (Status b : Status.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final Status enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public Status read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return Status.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - Status.fromValue(value); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingBackupState.java b/src/main/java/com/corbado/generated/model/TrackingBackupState.java deleted file mode 100644 index dc6fb7f..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingBackupState.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingBackupState - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingBackupState { - public static final String SERIALIZED_NAME_BACKED_UP = "backedUp"; - @SerializedName(SERIALIZED_NAME_BACKED_UP) - private Integer backedUp; - - public static final String SERIALIZED_NAME_NOT_BACKED_UP = "notBackedUp"; - @SerializedName(SERIALIZED_NAME_NOT_BACKED_UP) - private Integer notBackedUp; - - public TrackingBackupState() { - } - - public TrackingBackupState backedUp(Integer backedUp) { - this.backedUp = backedUp; - return this; - } - - /** - * Get backedUp - * @return backedUp - **/ - @javax.annotation.Nonnull - public Integer getBackedUp() { - return backedUp; - } - - public void setBackedUp(Integer backedUp) { - this.backedUp = backedUp; - } - - - public TrackingBackupState notBackedUp(Integer notBackedUp) { - this.notBackedUp = notBackedUp; - return this; - } - - /** - * Get notBackedUp - * @return notBackedUp - **/ - @javax.annotation.Nonnull - public Integer getNotBackedUp() { - return notBackedUp; - } - - public void setNotBackedUp(Integer notBackedUp) { - this.notBackedUp = notBackedUp; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingBackupState trackingBackupState = (TrackingBackupState) o; - return Objects.equals(this.backedUp, trackingBackupState.backedUp) && - Objects.equals(this.notBackedUp, trackingBackupState.notBackedUp); - } - - @Override - public int hashCode() { - return Objects.hash(backedUp, notBackedUp); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingBackupState {\n"); - sb.append(" backedUp: ").append(toIndentedString(backedUp)).append("\n"); - sb.append(" notBackedUp: ").append(toIndentedString(notBackedUp)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("backedUp"); - openapiFields.add("notBackedUp"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("backedUp"); - openapiRequiredFields.add("notBackedUp"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingBackupState - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingBackupState.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBackupState is not found in the empty JSON string", TrackingBackupState.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingBackupState.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBackupState` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingBackupState.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingBackupState.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingBackupState' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingBackupState.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingBackupState value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingBackupState read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingBackupState given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingBackupState - * @throws IOException if the JSON string is invalid with respect to TrackingBackupState - */ - public static TrackingBackupState fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingBackupState.class); - } - - /** - * Convert an instance of TrackingBackupState to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingBackupStateGetRsp.java b/src/main/java/com/corbado/generated/model/TrackingBackupStateGetRsp.java deleted file mode 100644 index 7d2a07d..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingBackupStateGetRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.TrackingBackupState; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingBackupStateGetRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingBackupStateGetRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private TrackingBackupState data; - - public TrackingBackupStateGetRsp() { - } - - public TrackingBackupStateGetRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public TrackingBackupStateGetRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public TrackingBackupStateGetRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public TrackingBackupStateGetRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public TrackingBackupStateGetRsp data(TrackingBackupState data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public TrackingBackupState getData() { - return data; - } - - public void setData(TrackingBackupState data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingBackupStateGetRsp trackingBackupStateGetRsp = (TrackingBackupStateGetRsp) o; - return Objects.equals(this.httpStatusCode, trackingBackupStateGetRsp.httpStatusCode) && - Objects.equals(this.message, trackingBackupStateGetRsp.message) && - Objects.equals(this.requestData, trackingBackupStateGetRsp.requestData) && - Objects.equals(this.runtime, trackingBackupStateGetRsp.runtime) && - Objects.equals(this.data, trackingBackupStateGetRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingBackupStateGetRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingBackupStateGetRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingBackupStateGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBackupStateGetRsp is not found in the empty JSON string", TrackingBackupStateGetRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingBackupStateGetRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBackupStateGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingBackupStateGetRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - TrackingBackupState.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingBackupStateGetRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingBackupStateGetRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingBackupStateGetRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingBackupStateGetRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingBackupStateGetRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingBackupStateGetRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingBackupStateGetRsp - * @throws IOException if the JSON string is invalid with respect to TrackingBackupStateGetRsp - */ - public static TrackingBackupStateGetRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingBackupStateGetRsp.class); - } - - /** - * Convert an instance of TrackingBackupStateGetRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStats.java b/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStats.java deleted file mode 100644 index d417acf..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStats.java +++ /dev/null @@ -1,382 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingBrowserDetailedStats - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingBrowserDetailedStats { - public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; - @SerializedName(SERIALIZED_NAME_TIME_POINT) - private String timePoint; - - public static final String SERIALIZED_NAME_BROWSER_NAME = "browserName"; - @SerializedName(SERIALIZED_NAME_BROWSER_NAME) - private String browserName; - - public static final String SERIALIZED_NAME_BROWSER_VERSION = "browserVersion"; - @SerializedName(SERIALIZED_NAME_BROWSER_VERSION) - private String browserVersion; - - public static final String SERIALIZED_NAME_CNT = "cnt"; - @SerializedName(SERIALIZED_NAME_CNT) - private Integer cnt; - - public static final String SERIALIZED_NAME_WEBAUTHN = "webauthn"; - @SerializedName(SERIALIZED_NAME_WEBAUTHN) - private Integer webauthn; - - public static final String SERIALIZED_NAME_PLATFORM = "platform"; - @SerializedName(SERIALIZED_NAME_PLATFORM) - private Integer platform; - - public static final String SERIALIZED_NAME_CONDITIONAL_UI = "conditional_ui"; - @SerializedName(SERIALIZED_NAME_CONDITIONAL_UI) - private Integer conditionalUi; - - public TrackingBrowserDetailedStats() { - } - - public TrackingBrowserDetailedStats timePoint(String timePoint) { - this.timePoint = timePoint; - return this; - } - - /** - * Get timePoint - * @return timePoint - **/ - @javax.annotation.Nonnull - public String getTimePoint() { - return timePoint; - } - - public void setTimePoint(String timePoint) { - this.timePoint = timePoint; - } - - - public TrackingBrowserDetailedStats browserName(String browserName) { - this.browserName = browserName; - return this; - } - - /** - * Get browserName - * @return browserName - **/ - @javax.annotation.Nonnull - public String getBrowserName() { - return browserName; - } - - public void setBrowserName(String browserName) { - this.browserName = browserName; - } - - - public TrackingBrowserDetailedStats browserVersion(String browserVersion) { - this.browserVersion = browserVersion; - return this; - } - - /** - * Get browserVersion - * @return browserVersion - **/ - @javax.annotation.Nonnull - public String getBrowserVersion() { - return browserVersion; - } - - public void setBrowserVersion(String browserVersion) { - this.browserVersion = browserVersion; - } - - - public TrackingBrowserDetailedStats cnt(Integer cnt) { - this.cnt = cnt; - return this; - } - - /** - * Get cnt - * @return cnt - **/ - @javax.annotation.Nonnull - public Integer getCnt() { - return cnt; - } - - public void setCnt(Integer cnt) { - this.cnt = cnt; - } - - - public TrackingBrowserDetailedStats webauthn(Integer webauthn) { - this.webauthn = webauthn; - return this; - } - - /** - * Get webauthn - * @return webauthn - **/ - @javax.annotation.Nonnull - public Integer getWebauthn() { - return webauthn; - } - - public void setWebauthn(Integer webauthn) { - this.webauthn = webauthn; - } - - - public TrackingBrowserDetailedStats platform(Integer platform) { - this.platform = platform; - return this; - } - - /** - * Get platform - * @return platform - **/ - @javax.annotation.Nonnull - public Integer getPlatform() { - return platform; - } - - public void setPlatform(Integer platform) { - this.platform = platform; - } - - - public TrackingBrowserDetailedStats conditionalUi(Integer conditionalUi) { - this.conditionalUi = conditionalUi; - return this; - } - - /** - * Get conditionalUi - * @return conditionalUi - **/ - @javax.annotation.Nonnull - public Integer getConditionalUi() { - return conditionalUi; - } - - public void setConditionalUi(Integer conditionalUi) { - this.conditionalUi = conditionalUi; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingBrowserDetailedStats trackingBrowserDetailedStats = (TrackingBrowserDetailedStats) o; - return Objects.equals(this.timePoint, trackingBrowserDetailedStats.timePoint) && - Objects.equals(this.browserName, trackingBrowserDetailedStats.browserName) && - Objects.equals(this.browserVersion, trackingBrowserDetailedStats.browserVersion) && - Objects.equals(this.cnt, trackingBrowserDetailedStats.cnt) && - Objects.equals(this.webauthn, trackingBrowserDetailedStats.webauthn) && - Objects.equals(this.platform, trackingBrowserDetailedStats.platform) && - Objects.equals(this.conditionalUi, trackingBrowserDetailedStats.conditionalUi); - } - - @Override - public int hashCode() { - return Objects.hash(timePoint, browserName, browserVersion, cnt, webauthn, platform, conditionalUi); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingBrowserDetailedStats {\n"); - sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); - sb.append(" browserName: ").append(toIndentedString(browserName)).append("\n"); - sb.append(" browserVersion: ").append(toIndentedString(browserVersion)).append("\n"); - sb.append(" cnt: ").append(toIndentedString(cnt)).append("\n"); - sb.append(" webauthn: ").append(toIndentedString(webauthn)).append("\n"); - sb.append(" platform: ").append(toIndentedString(platform)).append("\n"); - sb.append(" conditionalUi: ").append(toIndentedString(conditionalUi)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("timePoint"); - openapiFields.add("browserName"); - openapiFields.add("browserVersion"); - openapiFields.add("cnt"); - openapiFields.add("webauthn"); - openapiFields.add("platform"); - openapiFields.add("conditional_ui"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("timePoint"); - openapiRequiredFields.add("browserName"); - openapiRequiredFields.add("browserVersion"); - openapiRequiredFields.add("cnt"); - openapiRequiredFields.add("webauthn"); - openapiRequiredFields.add("platform"); - openapiRequiredFields.add("conditional_ui"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingBrowserDetailedStats - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingBrowserDetailedStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBrowserDetailedStats is not found in the empty JSON string", TrackingBrowserDetailedStats.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingBrowserDetailedStats.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBrowserDetailedStats` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingBrowserDetailedStats.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("timePoint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); - } - if (!jsonObj.get("browserName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `browserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("browserName").toString())); - } - if (!jsonObj.get("browserVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `browserVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("browserVersion").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingBrowserDetailedStats.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingBrowserDetailedStats' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingBrowserDetailedStats.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingBrowserDetailedStats value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingBrowserDetailedStats read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingBrowserDetailedStats given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingBrowserDetailedStats - * @throws IOException if the JSON string is invalid with respect to TrackingBrowserDetailedStats - */ - public static TrackingBrowserDetailedStats fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingBrowserDetailedStats.class); - } - - /** - * Convert an instance of TrackingBrowserDetailedStats to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRsp.java b/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRsp.java deleted file mode 100644 index 36faa42..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.TrackingBrowserDetailedStatsListRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingBrowserDetailedStatsListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingBrowserDetailedStatsListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private TrackingBrowserDetailedStatsListRspAllOfData data; - - public TrackingBrowserDetailedStatsListRsp() { - } - - public TrackingBrowserDetailedStatsListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public TrackingBrowserDetailedStatsListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public TrackingBrowserDetailedStatsListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public TrackingBrowserDetailedStatsListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public TrackingBrowserDetailedStatsListRsp data(TrackingBrowserDetailedStatsListRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public TrackingBrowserDetailedStatsListRspAllOfData getData() { - return data; - } - - public void setData(TrackingBrowserDetailedStatsListRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingBrowserDetailedStatsListRsp trackingBrowserDetailedStatsListRsp = (TrackingBrowserDetailedStatsListRsp) o; - return Objects.equals(this.httpStatusCode, trackingBrowserDetailedStatsListRsp.httpStatusCode) && - Objects.equals(this.message, trackingBrowserDetailedStatsListRsp.message) && - Objects.equals(this.requestData, trackingBrowserDetailedStatsListRsp.requestData) && - Objects.equals(this.runtime, trackingBrowserDetailedStatsListRsp.runtime) && - Objects.equals(this.data, trackingBrowserDetailedStatsListRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingBrowserDetailedStatsListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingBrowserDetailedStatsListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingBrowserDetailedStatsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBrowserDetailedStatsListRsp is not found in the empty JSON string", TrackingBrowserDetailedStatsListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingBrowserDetailedStatsListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBrowserDetailedStatsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingBrowserDetailedStatsListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - TrackingBrowserDetailedStatsListRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingBrowserDetailedStatsListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingBrowserDetailedStatsListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingBrowserDetailedStatsListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingBrowserDetailedStatsListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingBrowserDetailedStatsListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingBrowserDetailedStatsListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingBrowserDetailedStatsListRsp - * @throws IOException if the JSON string is invalid with respect to TrackingBrowserDetailedStatsListRsp - */ - public static TrackingBrowserDetailedStatsListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingBrowserDetailedStatsListRsp.class); - } - - /** - * Convert an instance of TrackingBrowserDetailedStatsListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRspAllOfData.java deleted file mode 100644 index 48746a4..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingBrowserDetailedStatsListRspAllOfData.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.TrackingBrowserDetailedStats; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingBrowserDetailedStatsListRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingBrowserDetailedStatsListRspAllOfData { - public static final String SERIALIZED_NAME_STATS = "stats"; - @SerializedName(SERIALIZED_NAME_STATS) - private List stats = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public TrackingBrowserDetailedStatsListRspAllOfData() { - } - - public TrackingBrowserDetailedStatsListRspAllOfData stats(List stats) { - this.stats = stats; - return this; - } - - public TrackingBrowserDetailedStatsListRspAllOfData addStatsItem(TrackingBrowserDetailedStats statsItem) { - if (this.stats == null) { - this.stats = new ArrayList<>(); - } - this.stats.add(statsItem); - return this; - } - - /** - * Get stats - * @return stats - **/ - @javax.annotation.Nonnull - public List getStats() { - return stats; - } - - public void setStats(List stats) { - this.stats = stats; - } - - - public TrackingBrowserDetailedStatsListRspAllOfData paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingBrowserDetailedStatsListRspAllOfData trackingBrowserDetailedStatsListRspAllOfData = (TrackingBrowserDetailedStatsListRspAllOfData) o; - return Objects.equals(this.stats, trackingBrowserDetailedStatsListRspAllOfData.stats) && - Objects.equals(this.paging, trackingBrowserDetailedStatsListRspAllOfData.paging); - } - - @Override - public int hashCode() { - return Objects.hash(stats, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingBrowserDetailedStatsListRspAllOfData {\n"); - sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("stats"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("stats"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingBrowserDetailedStatsListRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingBrowserDetailedStatsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBrowserDetailedStatsListRspAllOfData is not found in the empty JSON string", TrackingBrowserDetailedStatsListRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingBrowserDetailedStatsListRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBrowserDetailedStatsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingBrowserDetailedStatsListRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("stats").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); - } - - JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); - // validate the required field `stats` (array) - for (int i = 0; i < jsonArraystats.size(); i++) { - TrackingBrowserDetailedStats.validateJsonElement(jsonArraystats.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingBrowserDetailedStatsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingBrowserDetailedStatsListRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingBrowserDetailedStatsListRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingBrowserDetailedStatsListRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingBrowserDetailedStatsListRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingBrowserDetailedStatsListRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingBrowserDetailedStatsListRspAllOfData - * @throws IOException if the JSON string is invalid with respect to TrackingBrowserDetailedStatsListRspAllOfData - */ - public static TrackingBrowserDetailedStatsListRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingBrowserDetailedStatsListRspAllOfData.class); - } - - /** - * Convert an instance of TrackingBrowserDetailedStatsListRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingBrowserStats.java b/src/main/java/com/corbado/generated/model/TrackingBrowserStats.java deleted file mode 100644 index 323265e..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingBrowserStats.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingBrowserStats - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingBrowserStats { - public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; - @SerializedName(SERIALIZED_NAME_TIME_POINT) - private String timePoint; - - public static final String SERIALIZED_NAME_CHROME = "chrome"; - @SerializedName(SERIALIZED_NAME_CHROME) - private Integer chrome; - - public static final String SERIALIZED_NAME_SAFARI = "safari"; - @SerializedName(SERIALIZED_NAME_SAFARI) - private Integer safari; - - public static final String SERIALIZED_NAME_EDGE = "edge"; - @SerializedName(SERIALIZED_NAME_EDGE) - private Integer edge; - - public static final String SERIALIZED_NAME_FIREFOX = "firefox"; - @SerializedName(SERIALIZED_NAME_FIREFOX) - private Integer firefox; - - public static final String SERIALIZED_NAME_OTHER = "other"; - @SerializedName(SERIALIZED_NAME_OTHER) - private Integer other; - - public TrackingBrowserStats() { - } - - public TrackingBrowserStats timePoint(String timePoint) { - this.timePoint = timePoint; - return this; - } - - /** - * Get timePoint - * @return timePoint - **/ - @javax.annotation.Nonnull - public String getTimePoint() { - return timePoint; - } - - public void setTimePoint(String timePoint) { - this.timePoint = timePoint; - } - - - public TrackingBrowserStats chrome(Integer chrome) { - this.chrome = chrome; - return this; - } - - /** - * Get chrome - * @return chrome - **/ - @javax.annotation.Nonnull - public Integer getChrome() { - return chrome; - } - - public void setChrome(Integer chrome) { - this.chrome = chrome; - } - - - public TrackingBrowserStats safari(Integer safari) { - this.safari = safari; - return this; - } - - /** - * Get safari - * @return safari - **/ - @javax.annotation.Nonnull - public Integer getSafari() { - return safari; - } - - public void setSafari(Integer safari) { - this.safari = safari; - } - - - public TrackingBrowserStats edge(Integer edge) { - this.edge = edge; - return this; - } - - /** - * Get edge - * @return edge - **/ - @javax.annotation.Nonnull - public Integer getEdge() { - return edge; - } - - public void setEdge(Integer edge) { - this.edge = edge; - } - - - public TrackingBrowserStats firefox(Integer firefox) { - this.firefox = firefox; - return this; - } - - /** - * Get firefox - * @return firefox - **/ - @javax.annotation.Nonnull - public Integer getFirefox() { - return firefox; - } - - public void setFirefox(Integer firefox) { - this.firefox = firefox; - } - - - public TrackingBrowserStats other(Integer other) { - this.other = other; - return this; - } - - /** - * Get other - * @return other - **/ - @javax.annotation.Nonnull - public Integer getOther() { - return other; - } - - public void setOther(Integer other) { - this.other = other; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingBrowserStats trackingBrowserStats = (TrackingBrowserStats) o; - return Objects.equals(this.timePoint, trackingBrowserStats.timePoint) && - Objects.equals(this.chrome, trackingBrowserStats.chrome) && - Objects.equals(this.safari, trackingBrowserStats.safari) && - Objects.equals(this.edge, trackingBrowserStats.edge) && - Objects.equals(this.firefox, trackingBrowserStats.firefox) && - Objects.equals(this.other, trackingBrowserStats.other); - } - - @Override - public int hashCode() { - return Objects.hash(timePoint, chrome, safari, edge, firefox, other); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingBrowserStats {\n"); - sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); - sb.append(" chrome: ").append(toIndentedString(chrome)).append("\n"); - sb.append(" safari: ").append(toIndentedString(safari)).append("\n"); - sb.append(" edge: ").append(toIndentedString(edge)).append("\n"); - sb.append(" firefox: ").append(toIndentedString(firefox)).append("\n"); - sb.append(" other: ").append(toIndentedString(other)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("timePoint"); - openapiFields.add("chrome"); - openapiFields.add("safari"); - openapiFields.add("edge"); - openapiFields.add("firefox"); - openapiFields.add("other"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("timePoint"); - openapiRequiredFields.add("chrome"); - openapiRequiredFields.add("safari"); - openapiRequiredFields.add("edge"); - openapiRequiredFields.add("firefox"); - openapiRequiredFields.add("other"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingBrowserStats - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingBrowserStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBrowserStats is not found in the empty JSON string", TrackingBrowserStats.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingBrowserStats.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBrowserStats` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingBrowserStats.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("timePoint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingBrowserStats.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingBrowserStats' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingBrowserStats.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingBrowserStats value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingBrowserStats read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingBrowserStats given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingBrowserStats - * @throws IOException if the JSON string is invalid with respect to TrackingBrowserStats - */ - public static TrackingBrowserStats fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingBrowserStats.class); - } - - /** - * Convert an instance of TrackingBrowserStats to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRsp.java b/src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRsp.java deleted file mode 100644 index f0fd562..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.TrackingBrowserStatsListRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingBrowserStatsListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingBrowserStatsListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private TrackingBrowserStatsListRspAllOfData data; - - public TrackingBrowserStatsListRsp() { - } - - public TrackingBrowserStatsListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public TrackingBrowserStatsListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public TrackingBrowserStatsListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public TrackingBrowserStatsListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public TrackingBrowserStatsListRsp data(TrackingBrowserStatsListRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public TrackingBrowserStatsListRspAllOfData getData() { - return data; - } - - public void setData(TrackingBrowserStatsListRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingBrowserStatsListRsp trackingBrowserStatsListRsp = (TrackingBrowserStatsListRsp) o; - return Objects.equals(this.httpStatusCode, trackingBrowserStatsListRsp.httpStatusCode) && - Objects.equals(this.message, trackingBrowserStatsListRsp.message) && - Objects.equals(this.requestData, trackingBrowserStatsListRsp.requestData) && - Objects.equals(this.runtime, trackingBrowserStatsListRsp.runtime) && - Objects.equals(this.data, trackingBrowserStatsListRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingBrowserStatsListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingBrowserStatsListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingBrowserStatsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBrowserStatsListRsp is not found in the empty JSON string", TrackingBrowserStatsListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingBrowserStatsListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBrowserStatsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingBrowserStatsListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - TrackingBrowserStatsListRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingBrowserStatsListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingBrowserStatsListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingBrowserStatsListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingBrowserStatsListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingBrowserStatsListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingBrowserStatsListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingBrowserStatsListRsp - * @throws IOException if the JSON string is invalid with respect to TrackingBrowserStatsListRsp - */ - public static TrackingBrowserStatsListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingBrowserStatsListRsp.class); - } - - /** - * Convert an instance of TrackingBrowserStatsListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRspAllOfData.java deleted file mode 100644 index 08fb21c..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingBrowserStatsListRspAllOfData.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.TrackingBrowserStats; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingBrowserStatsListRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingBrowserStatsListRspAllOfData { - public static final String SERIALIZED_NAME_STATS = "stats"; - @SerializedName(SERIALIZED_NAME_STATS) - private List stats = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public TrackingBrowserStatsListRspAllOfData() { - } - - public TrackingBrowserStatsListRspAllOfData stats(List stats) { - this.stats = stats; - return this; - } - - public TrackingBrowserStatsListRspAllOfData addStatsItem(TrackingBrowserStats statsItem) { - if (this.stats == null) { - this.stats = new ArrayList<>(); - } - this.stats.add(statsItem); - return this; - } - - /** - * Get stats - * @return stats - **/ - @javax.annotation.Nonnull - public List getStats() { - return stats; - } - - public void setStats(List stats) { - this.stats = stats; - } - - - public TrackingBrowserStatsListRspAllOfData paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingBrowserStatsListRspAllOfData trackingBrowserStatsListRspAllOfData = (TrackingBrowserStatsListRspAllOfData) o; - return Objects.equals(this.stats, trackingBrowserStatsListRspAllOfData.stats) && - Objects.equals(this.paging, trackingBrowserStatsListRspAllOfData.paging); - } - - @Override - public int hashCode() { - return Objects.hash(stats, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingBrowserStatsListRspAllOfData {\n"); - sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("stats"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("stats"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingBrowserStatsListRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingBrowserStatsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingBrowserStatsListRspAllOfData is not found in the empty JSON string", TrackingBrowserStatsListRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingBrowserStatsListRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingBrowserStatsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingBrowserStatsListRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("stats").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); - } - - JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); - // validate the required field `stats` (array) - for (int i = 0; i < jsonArraystats.size(); i++) { - TrackingBrowserStats.validateJsonElement(jsonArraystats.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingBrowserStatsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingBrowserStatsListRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingBrowserStatsListRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingBrowserStatsListRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingBrowserStatsListRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingBrowserStatsListRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingBrowserStatsListRspAllOfData - * @throws IOException if the JSON string is invalid with respect to TrackingBrowserStatsListRspAllOfData - */ - public static TrackingBrowserStatsListRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingBrowserStatsListRspAllOfData.class); - } - - /** - * Convert an instance of TrackingBrowserStatsListRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingDetailedStats.java b/src/main/java/com/corbado/generated/model/TrackingDetailedStats.java deleted file mode 100644 index a4f0b12..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingDetailedStats.java +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingDetailedStats - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingDetailedStats { - public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; - @SerializedName(SERIALIZED_NAME_TIME_POINT) - private String timePoint; - - public static final String SERIALIZED_NAME_VISITS = "visits"; - @SerializedName(SERIALIZED_NAME_VISITS) - private Integer visits; - - public static final String SERIALIZED_NAME_WEBAUTHN = "webauthn"; - @SerializedName(SERIALIZED_NAME_WEBAUTHN) - private Integer webauthn; - - public static final String SERIALIZED_NAME_PLATFORM = "platform"; - @SerializedName(SERIALIZED_NAME_PLATFORM) - private Integer platform; - - public static final String SERIALIZED_NAME_CONDITIONAL_UI = "conditionalUi"; - @SerializedName(SERIALIZED_NAME_CONDITIONAL_UI) - private Integer conditionalUi; - - public TrackingDetailedStats() { - } - - public TrackingDetailedStats timePoint(String timePoint) { - this.timePoint = timePoint; - return this; - } - - /** - * Get timePoint - * @return timePoint - **/ - @javax.annotation.Nonnull - public String getTimePoint() { - return timePoint; - } - - public void setTimePoint(String timePoint) { - this.timePoint = timePoint; - } - - - public TrackingDetailedStats visits(Integer visits) { - this.visits = visits; - return this; - } - - /** - * Get visits - * @return visits - **/ - @javax.annotation.Nonnull - public Integer getVisits() { - return visits; - } - - public void setVisits(Integer visits) { - this.visits = visits; - } - - - public TrackingDetailedStats webauthn(Integer webauthn) { - this.webauthn = webauthn; - return this; - } - - /** - * Get webauthn - * @return webauthn - **/ - @javax.annotation.Nonnull - public Integer getWebauthn() { - return webauthn; - } - - public void setWebauthn(Integer webauthn) { - this.webauthn = webauthn; - } - - - public TrackingDetailedStats platform(Integer platform) { - this.platform = platform; - return this; - } - - /** - * Get platform - * @return platform - **/ - @javax.annotation.Nonnull - public Integer getPlatform() { - return platform; - } - - public void setPlatform(Integer platform) { - this.platform = platform; - } - - - public TrackingDetailedStats conditionalUi(Integer conditionalUi) { - this.conditionalUi = conditionalUi; - return this; - } - - /** - * Get conditionalUi - * @return conditionalUi - **/ - @javax.annotation.Nonnull - public Integer getConditionalUi() { - return conditionalUi; - } - - public void setConditionalUi(Integer conditionalUi) { - this.conditionalUi = conditionalUi; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingDetailedStats trackingDetailedStats = (TrackingDetailedStats) o; - return Objects.equals(this.timePoint, trackingDetailedStats.timePoint) && - Objects.equals(this.visits, trackingDetailedStats.visits) && - Objects.equals(this.webauthn, trackingDetailedStats.webauthn) && - Objects.equals(this.platform, trackingDetailedStats.platform) && - Objects.equals(this.conditionalUi, trackingDetailedStats.conditionalUi); - } - - @Override - public int hashCode() { - return Objects.hash(timePoint, visits, webauthn, platform, conditionalUi); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingDetailedStats {\n"); - sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); - sb.append(" visits: ").append(toIndentedString(visits)).append("\n"); - sb.append(" webauthn: ").append(toIndentedString(webauthn)).append("\n"); - sb.append(" platform: ").append(toIndentedString(platform)).append("\n"); - sb.append(" conditionalUi: ").append(toIndentedString(conditionalUi)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("timePoint"); - openapiFields.add("visits"); - openapiFields.add("webauthn"); - openapiFields.add("platform"); - openapiFields.add("conditionalUi"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("timePoint"); - openapiRequiredFields.add("visits"); - openapiRequiredFields.add("webauthn"); - openapiRequiredFields.add("platform"); - openapiRequiredFields.add("conditionalUi"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingDetailedStats - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingDetailedStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingDetailedStats is not found in the empty JSON string", TrackingDetailedStats.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingDetailedStats.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingDetailedStats` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingDetailedStats.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("timePoint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingDetailedStats.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingDetailedStats' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingDetailedStats.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingDetailedStats value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingDetailedStats read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingDetailedStats given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingDetailedStats - * @throws IOException if the JSON string is invalid with respect to TrackingDetailedStats - */ - public static TrackingDetailedStats fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingDetailedStats.class); - } - - /** - * Convert an instance of TrackingDetailedStats to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRsp.java b/src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRsp.java deleted file mode 100644 index e6c02b6..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.TrackingDetailedStatsListRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingDetailedStatsListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingDetailedStatsListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private TrackingDetailedStatsListRspAllOfData data; - - public TrackingDetailedStatsListRsp() { - } - - public TrackingDetailedStatsListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public TrackingDetailedStatsListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public TrackingDetailedStatsListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public TrackingDetailedStatsListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public TrackingDetailedStatsListRsp data(TrackingDetailedStatsListRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public TrackingDetailedStatsListRspAllOfData getData() { - return data; - } - - public void setData(TrackingDetailedStatsListRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingDetailedStatsListRsp trackingDetailedStatsListRsp = (TrackingDetailedStatsListRsp) o; - return Objects.equals(this.httpStatusCode, trackingDetailedStatsListRsp.httpStatusCode) && - Objects.equals(this.message, trackingDetailedStatsListRsp.message) && - Objects.equals(this.requestData, trackingDetailedStatsListRsp.requestData) && - Objects.equals(this.runtime, trackingDetailedStatsListRsp.runtime) && - Objects.equals(this.data, trackingDetailedStatsListRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingDetailedStatsListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingDetailedStatsListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingDetailedStatsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingDetailedStatsListRsp is not found in the empty JSON string", TrackingDetailedStatsListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingDetailedStatsListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingDetailedStatsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingDetailedStatsListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - TrackingDetailedStatsListRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingDetailedStatsListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingDetailedStatsListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingDetailedStatsListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingDetailedStatsListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingDetailedStatsListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingDetailedStatsListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingDetailedStatsListRsp - * @throws IOException if the JSON string is invalid with respect to TrackingDetailedStatsListRsp - */ - public static TrackingDetailedStatsListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingDetailedStatsListRsp.class); - } - - /** - * Convert an instance of TrackingDetailedStatsListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRspAllOfData.java deleted file mode 100644 index f37f929..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingDetailedStatsListRspAllOfData.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.TrackingDetailedStats; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingDetailedStatsListRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingDetailedStatsListRspAllOfData { - public static final String SERIALIZED_NAME_STATS = "stats"; - @SerializedName(SERIALIZED_NAME_STATS) - private List stats = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public TrackingDetailedStatsListRspAllOfData() { - } - - public TrackingDetailedStatsListRspAllOfData stats(List stats) { - this.stats = stats; - return this; - } - - public TrackingDetailedStatsListRspAllOfData addStatsItem(TrackingDetailedStats statsItem) { - if (this.stats == null) { - this.stats = new ArrayList<>(); - } - this.stats.add(statsItem); - return this; - } - - /** - * Get stats - * @return stats - **/ - @javax.annotation.Nonnull - public List getStats() { - return stats; - } - - public void setStats(List stats) { - this.stats = stats; - } - - - public TrackingDetailedStatsListRspAllOfData paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingDetailedStatsListRspAllOfData trackingDetailedStatsListRspAllOfData = (TrackingDetailedStatsListRspAllOfData) o; - return Objects.equals(this.stats, trackingDetailedStatsListRspAllOfData.stats) && - Objects.equals(this.paging, trackingDetailedStatsListRspAllOfData.paging); - } - - @Override - public int hashCode() { - return Objects.hash(stats, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingDetailedStatsListRspAllOfData {\n"); - sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("stats"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("stats"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingDetailedStatsListRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingDetailedStatsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingDetailedStatsListRspAllOfData is not found in the empty JSON string", TrackingDetailedStatsListRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingDetailedStatsListRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingDetailedStatsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingDetailedStatsListRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("stats").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); - } - - JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); - // validate the required field `stats` (array) - for (int i = 0; i < jsonArraystats.size(); i++) { - TrackingDetailedStats.validateJsonElement(jsonArraystats.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingDetailedStatsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingDetailedStatsListRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingDetailedStatsListRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingDetailedStatsListRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingDetailedStatsListRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingDetailedStatsListRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingDetailedStatsListRspAllOfData - * @throws IOException if the JSON string is invalid with respect to TrackingDetailedStatsListRspAllOfData - */ - public static TrackingDetailedStatsListRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingDetailedStatsListRspAllOfData.class); - } - - /** - * Convert an instance of TrackingDetailedStatsListRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingEnums.java b/src/main/java/com/corbado/generated/model/TrackingEnums.java deleted file mode 100644 index abcd4dc..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingEnums.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingEnums - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingEnums { - public static final String SERIALIZED_NAME_BROWSER_NAMES = "browserNames"; - @SerializedName(SERIALIZED_NAME_BROWSER_NAMES) - private List browserNames = new ArrayList<>(); - - public static final String SERIALIZED_NAME_OS_NAMES = "osNames"; - @SerializedName(SERIALIZED_NAME_OS_NAMES) - private List osNames = new ArrayList<>(); - - public static final String SERIALIZED_NAME_OS_PLATFORMS = "osPlatforms"; - @SerializedName(SERIALIZED_NAME_OS_PLATFORMS) - private List osPlatforms = new ArrayList<>(); - - public TrackingEnums() { - } - - public TrackingEnums browserNames(List browserNames) { - this.browserNames = browserNames; - return this; - } - - public TrackingEnums addBrowserNamesItem(String browserNamesItem) { - if (this.browserNames == null) { - this.browserNames = new ArrayList<>(); - } - this.browserNames.add(browserNamesItem); - return this; - } - - /** - * Get browserNames - * @return browserNames - **/ - @javax.annotation.Nonnull - public List getBrowserNames() { - return browserNames; - } - - public void setBrowserNames(List browserNames) { - this.browserNames = browserNames; - } - - - public TrackingEnums osNames(List osNames) { - this.osNames = osNames; - return this; - } - - public TrackingEnums addOsNamesItem(String osNamesItem) { - if (this.osNames == null) { - this.osNames = new ArrayList<>(); - } - this.osNames.add(osNamesItem); - return this; - } - - /** - * Get osNames - * @return osNames - **/ - @javax.annotation.Nonnull - public List getOsNames() { - return osNames; - } - - public void setOsNames(List osNames) { - this.osNames = osNames; - } - - - public TrackingEnums osPlatforms(List osPlatforms) { - this.osPlatforms = osPlatforms; - return this; - } - - public TrackingEnums addOsPlatformsItem(String osPlatformsItem) { - if (this.osPlatforms == null) { - this.osPlatforms = new ArrayList<>(); - } - this.osPlatforms.add(osPlatformsItem); - return this; - } - - /** - * Get osPlatforms - * @return osPlatforms - **/ - @javax.annotation.Nonnull - public List getOsPlatforms() { - return osPlatforms; - } - - public void setOsPlatforms(List osPlatforms) { - this.osPlatforms = osPlatforms; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingEnums trackingEnums = (TrackingEnums) o; - return Objects.equals(this.browserNames, trackingEnums.browserNames) && - Objects.equals(this.osNames, trackingEnums.osNames) && - Objects.equals(this.osPlatforms, trackingEnums.osPlatforms); - } - - @Override - public int hashCode() { - return Objects.hash(browserNames, osNames, osPlatforms); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingEnums {\n"); - sb.append(" browserNames: ").append(toIndentedString(browserNames)).append("\n"); - sb.append(" osNames: ").append(toIndentedString(osNames)).append("\n"); - sb.append(" osPlatforms: ").append(toIndentedString(osPlatforms)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("browserNames"); - openapiFields.add("osNames"); - openapiFields.add("osPlatforms"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("browserNames"); - openapiRequiredFields.add("osNames"); - openapiRequiredFields.add("osPlatforms"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingEnums - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingEnums.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingEnums is not found in the empty JSON string", TrackingEnums.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingEnums.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingEnums` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingEnums.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the required json array is present - if (jsonObj.get("browserNames") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("browserNames").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `browserNames` to be an array in the JSON string but got `%s`", jsonObj.get("browserNames").toString())); - } - // ensure the required json array is present - if (jsonObj.get("osNames") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("osNames").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `osNames` to be an array in the JSON string but got `%s`", jsonObj.get("osNames").toString())); - } - // ensure the required json array is present - if (jsonObj.get("osPlatforms") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("osPlatforms").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `osPlatforms` to be an array in the JSON string but got `%s`", jsonObj.get("osPlatforms").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingEnums.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingEnums' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingEnums.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingEnums value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingEnums read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingEnums given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingEnums - * @throws IOException if the JSON string is invalid with respect to TrackingEnums - */ - public static TrackingEnums fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingEnums.class); - } - - /** - * Convert an instance of TrackingEnums to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingEnumsGetRsp.java b/src/main/java/com/corbado/generated/model/TrackingEnumsGetRsp.java deleted file mode 100644 index 67ed7bc..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingEnumsGetRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.TrackingEnums; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingEnumsGetRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingEnumsGetRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private TrackingEnums data; - - public TrackingEnumsGetRsp() { - } - - public TrackingEnumsGetRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public TrackingEnumsGetRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public TrackingEnumsGetRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public TrackingEnumsGetRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public TrackingEnumsGetRsp data(TrackingEnums data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public TrackingEnums getData() { - return data; - } - - public void setData(TrackingEnums data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingEnumsGetRsp trackingEnumsGetRsp = (TrackingEnumsGetRsp) o; - return Objects.equals(this.httpStatusCode, trackingEnumsGetRsp.httpStatusCode) && - Objects.equals(this.message, trackingEnumsGetRsp.message) && - Objects.equals(this.requestData, trackingEnumsGetRsp.requestData) && - Objects.equals(this.runtime, trackingEnumsGetRsp.runtime) && - Objects.equals(this.data, trackingEnumsGetRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingEnumsGetRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingEnumsGetRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingEnumsGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingEnumsGetRsp is not found in the empty JSON string", TrackingEnumsGetRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingEnumsGetRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingEnumsGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingEnumsGetRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - TrackingEnums.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingEnumsGetRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingEnumsGetRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingEnumsGetRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingEnumsGetRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingEnumsGetRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingEnumsGetRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingEnumsGetRsp - * @throws IOException if the JSON string is invalid with respect to TrackingEnumsGetRsp - */ - public static TrackingEnumsGetRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingEnumsGetRsp.class); - } - - /** - * Convert an instance of TrackingEnumsGetRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingOSDetailedStats.java b/src/main/java/com/corbado/generated/model/TrackingOSDetailedStats.java deleted file mode 100644 index bff01b6..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingOSDetailedStats.java +++ /dev/null @@ -1,468 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingOSDetailedStats - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingOSDetailedStats { - public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; - @SerializedName(SERIALIZED_NAME_TIME_POINT) - private String timePoint; - - public static final String SERIALIZED_NAME_OS_NAME = "osName"; - @SerializedName(SERIALIZED_NAME_OS_NAME) - private String osName; - - public static final String SERIALIZED_NAME_OS_VERSION = "osVersion"; - @SerializedName(SERIALIZED_NAME_OS_VERSION) - private String osVersion; - - /** - * Gets or Sets osPlatform - */ - @JsonAdapter(OsPlatformEnum.Adapter.class) - public enum OsPlatformEnum { - DESKTOP("desktop"), - - MOBILE("mobile"), - - UNKNOWN("unknown"); - - private String value; - - OsPlatformEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static OsPlatformEnum fromValue(String value) { - for (OsPlatformEnum b : OsPlatformEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final OsPlatformEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public OsPlatformEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return OsPlatformEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - OsPlatformEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_OS_PLATFORM = "osPlatform"; - @SerializedName(SERIALIZED_NAME_OS_PLATFORM) - private OsPlatformEnum osPlatform; - - public static final String SERIALIZED_NAME_CNT = "cnt"; - @SerializedName(SERIALIZED_NAME_CNT) - private Integer cnt; - - public static final String SERIALIZED_NAME_WEBAUTHN = "webauthn"; - @SerializedName(SERIALIZED_NAME_WEBAUTHN) - private Integer webauthn; - - public static final String SERIALIZED_NAME_PLATFORM = "platform"; - @SerializedName(SERIALIZED_NAME_PLATFORM) - private Integer platform; - - public static final String SERIALIZED_NAME_CONDITIONAL_UI = "conditional_ui"; - @SerializedName(SERIALIZED_NAME_CONDITIONAL_UI) - private Integer conditionalUi; - - public TrackingOSDetailedStats() { - } - - public TrackingOSDetailedStats timePoint(String timePoint) { - this.timePoint = timePoint; - return this; - } - - /** - * Get timePoint - * @return timePoint - **/ - @javax.annotation.Nonnull - public String getTimePoint() { - return timePoint; - } - - public void setTimePoint(String timePoint) { - this.timePoint = timePoint; - } - - - public TrackingOSDetailedStats osName(String osName) { - this.osName = osName; - return this; - } - - /** - * Get osName - * @return osName - **/ - @javax.annotation.Nonnull - public String getOsName() { - return osName; - } - - public void setOsName(String osName) { - this.osName = osName; - } - - - public TrackingOSDetailedStats osVersion(String osVersion) { - this.osVersion = osVersion; - return this; - } - - /** - * Get osVersion - * @return osVersion - **/ - @javax.annotation.Nonnull - public String getOsVersion() { - return osVersion; - } - - public void setOsVersion(String osVersion) { - this.osVersion = osVersion; - } - - - public TrackingOSDetailedStats osPlatform(OsPlatformEnum osPlatform) { - this.osPlatform = osPlatform; - return this; - } - - /** - * Get osPlatform - * @return osPlatform - **/ - @javax.annotation.Nonnull - public OsPlatformEnum getOsPlatform() { - return osPlatform; - } - - public void setOsPlatform(OsPlatformEnum osPlatform) { - this.osPlatform = osPlatform; - } - - - public TrackingOSDetailedStats cnt(Integer cnt) { - this.cnt = cnt; - return this; - } - - /** - * Get cnt - * @return cnt - **/ - @javax.annotation.Nonnull - public Integer getCnt() { - return cnt; - } - - public void setCnt(Integer cnt) { - this.cnt = cnt; - } - - - public TrackingOSDetailedStats webauthn(Integer webauthn) { - this.webauthn = webauthn; - return this; - } - - /** - * Get webauthn - * @return webauthn - **/ - @javax.annotation.Nonnull - public Integer getWebauthn() { - return webauthn; - } - - public void setWebauthn(Integer webauthn) { - this.webauthn = webauthn; - } - - - public TrackingOSDetailedStats platform(Integer platform) { - this.platform = platform; - return this; - } - - /** - * Get platform - * @return platform - **/ - @javax.annotation.Nonnull - public Integer getPlatform() { - return platform; - } - - public void setPlatform(Integer platform) { - this.platform = platform; - } - - - public TrackingOSDetailedStats conditionalUi(Integer conditionalUi) { - this.conditionalUi = conditionalUi; - return this; - } - - /** - * Get conditionalUi - * @return conditionalUi - **/ - @javax.annotation.Nonnull - public Integer getConditionalUi() { - return conditionalUi; - } - - public void setConditionalUi(Integer conditionalUi) { - this.conditionalUi = conditionalUi; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingOSDetailedStats trackingOSDetailedStats = (TrackingOSDetailedStats) o; - return Objects.equals(this.timePoint, trackingOSDetailedStats.timePoint) && - Objects.equals(this.osName, trackingOSDetailedStats.osName) && - Objects.equals(this.osVersion, trackingOSDetailedStats.osVersion) && - Objects.equals(this.osPlatform, trackingOSDetailedStats.osPlatform) && - Objects.equals(this.cnt, trackingOSDetailedStats.cnt) && - Objects.equals(this.webauthn, trackingOSDetailedStats.webauthn) && - Objects.equals(this.platform, trackingOSDetailedStats.platform) && - Objects.equals(this.conditionalUi, trackingOSDetailedStats.conditionalUi); - } - - @Override - public int hashCode() { - return Objects.hash(timePoint, osName, osVersion, osPlatform, cnt, webauthn, platform, conditionalUi); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingOSDetailedStats {\n"); - sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); - sb.append(" osName: ").append(toIndentedString(osName)).append("\n"); - sb.append(" osVersion: ").append(toIndentedString(osVersion)).append("\n"); - sb.append(" osPlatform: ").append(toIndentedString(osPlatform)).append("\n"); - sb.append(" cnt: ").append(toIndentedString(cnt)).append("\n"); - sb.append(" webauthn: ").append(toIndentedString(webauthn)).append("\n"); - sb.append(" platform: ").append(toIndentedString(platform)).append("\n"); - sb.append(" conditionalUi: ").append(toIndentedString(conditionalUi)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("timePoint"); - openapiFields.add("osName"); - openapiFields.add("osVersion"); - openapiFields.add("osPlatform"); - openapiFields.add("cnt"); - openapiFields.add("webauthn"); - openapiFields.add("platform"); - openapiFields.add("conditional_ui"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("timePoint"); - openapiRequiredFields.add("osName"); - openapiRequiredFields.add("osVersion"); - openapiRequiredFields.add("osPlatform"); - openapiRequiredFields.add("cnt"); - openapiRequiredFields.add("webauthn"); - openapiRequiredFields.add("platform"); - openapiRequiredFields.add("conditional_ui"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingOSDetailedStats - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingOSDetailedStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingOSDetailedStats is not found in the empty JSON string", TrackingOSDetailedStats.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingOSDetailedStats.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingOSDetailedStats` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingOSDetailedStats.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("timePoint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); - } - if (!jsonObj.get("osName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `osName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osName").toString())); - } - if (!jsonObj.get("osVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `osVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osVersion").toString())); - } - if (!jsonObj.get("osPlatform").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `osPlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osPlatform").toString())); - } - // validate the required field `osPlatform` - OsPlatformEnum.validateJsonElement(jsonObj.get("osPlatform")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingOSDetailedStats.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingOSDetailedStats' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingOSDetailedStats.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingOSDetailedStats value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingOSDetailedStats read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingOSDetailedStats given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingOSDetailedStats - * @throws IOException if the JSON string is invalid with respect to TrackingOSDetailedStats - */ - public static TrackingOSDetailedStats fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingOSDetailedStats.class); - } - - /** - * Convert an instance of TrackingOSDetailedStats to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRsp.java b/src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRsp.java deleted file mode 100644 index 07e94f9..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.TrackingOSDetailedStatsListRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingOSDetailedStatsListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingOSDetailedStatsListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private TrackingOSDetailedStatsListRspAllOfData data; - - public TrackingOSDetailedStatsListRsp() { - } - - public TrackingOSDetailedStatsListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public TrackingOSDetailedStatsListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public TrackingOSDetailedStatsListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public TrackingOSDetailedStatsListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public TrackingOSDetailedStatsListRsp data(TrackingOSDetailedStatsListRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public TrackingOSDetailedStatsListRspAllOfData getData() { - return data; - } - - public void setData(TrackingOSDetailedStatsListRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingOSDetailedStatsListRsp trackingOSDetailedStatsListRsp = (TrackingOSDetailedStatsListRsp) o; - return Objects.equals(this.httpStatusCode, trackingOSDetailedStatsListRsp.httpStatusCode) && - Objects.equals(this.message, trackingOSDetailedStatsListRsp.message) && - Objects.equals(this.requestData, trackingOSDetailedStatsListRsp.requestData) && - Objects.equals(this.runtime, trackingOSDetailedStatsListRsp.runtime) && - Objects.equals(this.data, trackingOSDetailedStatsListRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingOSDetailedStatsListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingOSDetailedStatsListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingOSDetailedStatsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingOSDetailedStatsListRsp is not found in the empty JSON string", TrackingOSDetailedStatsListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingOSDetailedStatsListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingOSDetailedStatsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingOSDetailedStatsListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - TrackingOSDetailedStatsListRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingOSDetailedStatsListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingOSDetailedStatsListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingOSDetailedStatsListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingOSDetailedStatsListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingOSDetailedStatsListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingOSDetailedStatsListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingOSDetailedStatsListRsp - * @throws IOException if the JSON string is invalid with respect to TrackingOSDetailedStatsListRsp - */ - public static TrackingOSDetailedStatsListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingOSDetailedStatsListRsp.class); - } - - /** - * Convert an instance of TrackingOSDetailedStatsListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRspAllOfData.java deleted file mode 100644 index 67225db..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingOSDetailedStatsListRspAllOfData.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.TrackingOSDetailedStats; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingOSDetailedStatsListRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingOSDetailedStatsListRspAllOfData { - public static final String SERIALIZED_NAME_STATS = "stats"; - @SerializedName(SERIALIZED_NAME_STATS) - private List stats = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public TrackingOSDetailedStatsListRspAllOfData() { - } - - public TrackingOSDetailedStatsListRspAllOfData stats(List stats) { - this.stats = stats; - return this; - } - - public TrackingOSDetailedStatsListRspAllOfData addStatsItem(TrackingOSDetailedStats statsItem) { - if (this.stats == null) { - this.stats = new ArrayList<>(); - } - this.stats.add(statsItem); - return this; - } - - /** - * Get stats - * @return stats - **/ - @javax.annotation.Nonnull - public List getStats() { - return stats; - } - - public void setStats(List stats) { - this.stats = stats; - } - - - public TrackingOSDetailedStatsListRspAllOfData paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingOSDetailedStatsListRspAllOfData trackingOSDetailedStatsListRspAllOfData = (TrackingOSDetailedStatsListRspAllOfData) o; - return Objects.equals(this.stats, trackingOSDetailedStatsListRspAllOfData.stats) && - Objects.equals(this.paging, trackingOSDetailedStatsListRspAllOfData.paging); - } - - @Override - public int hashCode() { - return Objects.hash(stats, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingOSDetailedStatsListRspAllOfData {\n"); - sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("stats"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("stats"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingOSDetailedStatsListRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingOSDetailedStatsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingOSDetailedStatsListRspAllOfData is not found in the empty JSON string", TrackingOSDetailedStatsListRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingOSDetailedStatsListRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingOSDetailedStatsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingOSDetailedStatsListRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("stats").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); - } - - JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); - // validate the required field `stats` (array) - for (int i = 0; i < jsonArraystats.size(); i++) { - TrackingOSDetailedStats.validateJsonElement(jsonArraystats.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingOSDetailedStatsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingOSDetailedStatsListRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingOSDetailedStatsListRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingOSDetailedStatsListRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingOSDetailedStatsListRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingOSDetailedStatsListRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingOSDetailedStatsListRspAllOfData - * @throws IOException if the JSON string is invalid with respect to TrackingOSDetailedStatsListRspAllOfData - */ - public static TrackingOSDetailedStatsListRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingOSDetailedStatsListRspAllOfData.class); - } - - /** - * Convert an instance of TrackingOSDetailedStatsListRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingOSStats.java b/src/main/java/com/corbado/generated/model/TrackingOSStats.java deleted file mode 100644 index 532a673..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingOSStats.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingOSStats - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingOSStats { - public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; - @SerializedName(SERIALIZED_NAME_TIME_POINT) - private String timePoint; - - public static final String SERIALIZED_NAME_MACOS = "macos"; - @SerializedName(SERIALIZED_NAME_MACOS) - private Integer macos; - - public static final String SERIALIZED_NAME_WINDOWS = "windows"; - @SerializedName(SERIALIZED_NAME_WINDOWS) - private Integer windows; - - public static final String SERIALIZED_NAME_IOS = "ios"; - @SerializedName(SERIALIZED_NAME_IOS) - private Integer ios; - - public static final String SERIALIZED_NAME_ANDROID = "android"; - @SerializedName(SERIALIZED_NAME_ANDROID) - private Integer android; - - public static final String SERIALIZED_NAME_OTHER = "other"; - @SerializedName(SERIALIZED_NAME_OTHER) - private Integer other; - - public TrackingOSStats() { - } - - public TrackingOSStats timePoint(String timePoint) { - this.timePoint = timePoint; - return this; - } - - /** - * Get timePoint - * @return timePoint - **/ - @javax.annotation.Nonnull - public String getTimePoint() { - return timePoint; - } - - public void setTimePoint(String timePoint) { - this.timePoint = timePoint; - } - - - public TrackingOSStats macos(Integer macos) { - this.macos = macos; - return this; - } - - /** - * Get macos - * @return macos - **/ - @javax.annotation.Nonnull - public Integer getMacos() { - return macos; - } - - public void setMacos(Integer macos) { - this.macos = macos; - } - - - public TrackingOSStats windows(Integer windows) { - this.windows = windows; - return this; - } - - /** - * Get windows - * @return windows - **/ - @javax.annotation.Nonnull - public Integer getWindows() { - return windows; - } - - public void setWindows(Integer windows) { - this.windows = windows; - } - - - public TrackingOSStats ios(Integer ios) { - this.ios = ios; - return this; - } - - /** - * Get ios - * @return ios - **/ - @javax.annotation.Nonnull - public Integer getIos() { - return ios; - } - - public void setIos(Integer ios) { - this.ios = ios; - } - - - public TrackingOSStats android(Integer android) { - this.android = android; - return this; - } - - /** - * Get android - * @return android - **/ - @javax.annotation.Nonnull - public Integer getAndroid() { - return android; - } - - public void setAndroid(Integer android) { - this.android = android; - } - - - public TrackingOSStats other(Integer other) { - this.other = other; - return this; - } - - /** - * Get other - * @return other - **/ - @javax.annotation.Nonnull - public Integer getOther() { - return other; - } - - public void setOther(Integer other) { - this.other = other; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingOSStats trackingOSStats = (TrackingOSStats) o; - return Objects.equals(this.timePoint, trackingOSStats.timePoint) && - Objects.equals(this.macos, trackingOSStats.macos) && - Objects.equals(this.windows, trackingOSStats.windows) && - Objects.equals(this.ios, trackingOSStats.ios) && - Objects.equals(this.android, trackingOSStats.android) && - Objects.equals(this.other, trackingOSStats.other); - } - - @Override - public int hashCode() { - return Objects.hash(timePoint, macos, windows, ios, android, other); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingOSStats {\n"); - sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); - sb.append(" macos: ").append(toIndentedString(macos)).append("\n"); - sb.append(" windows: ").append(toIndentedString(windows)).append("\n"); - sb.append(" ios: ").append(toIndentedString(ios)).append("\n"); - sb.append(" android: ").append(toIndentedString(android)).append("\n"); - sb.append(" other: ").append(toIndentedString(other)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("timePoint"); - openapiFields.add("macos"); - openapiFields.add("windows"); - openapiFields.add("ios"); - openapiFields.add("android"); - openapiFields.add("other"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("timePoint"); - openapiRequiredFields.add("macos"); - openapiRequiredFields.add("windows"); - openapiRequiredFields.add("ios"); - openapiRequiredFields.add("android"); - openapiRequiredFields.add("other"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingOSStats - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingOSStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingOSStats is not found in the empty JSON string", TrackingOSStats.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingOSStats.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingOSStats` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingOSStats.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("timePoint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingOSStats.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingOSStats' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingOSStats.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingOSStats value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingOSStats read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingOSStats given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingOSStats - * @throws IOException if the JSON string is invalid with respect to TrackingOSStats - */ - public static TrackingOSStats fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingOSStats.class); - } - - /** - * Convert an instance of TrackingOSStats to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingOSStatsListRsp.java b/src/main/java/com/corbado/generated/model/TrackingOSStatsListRsp.java deleted file mode 100644 index 51f781f..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingOSStatsListRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.TrackingOSStatsListRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingOSStatsListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingOSStatsListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private TrackingOSStatsListRspAllOfData data; - - public TrackingOSStatsListRsp() { - } - - public TrackingOSStatsListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public TrackingOSStatsListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public TrackingOSStatsListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public TrackingOSStatsListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public TrackingOSStatsListRsp data(TrackingOSStatsListRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public TrackingOSStatsListRspAllOfData getData() { - return data; - } - - public void setData(TrackingOSStatsListRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingOSStatsListRsp trackingOSStatsListRsp = (TrackingOSStatsListRsp) o; - return Objects.equals(this.httpStatusCode, trackingOSStatsListRsp.httpStatusCode) && - Objects.equals(this.message, trackingOSStatsListRsp.message) && - Objects.equals(this.requestData, trackingOSStatsListRsp.requestData) && - Objects.equals(this.runtime, trackingOSStatsListRsp.runtime) && - Objects.equals(this.data, trackingOSStatsListRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingOSStatsListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingOSStatsListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingOSStatsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingOSStatsListRsp is not found in the empty JSON string", TrackingOSStatsListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingOSStatsListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingOSStatsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingOSStatsListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - TrackingOSStatsListRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingOSStatsListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingOSStatsListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingOSStatsListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingOSStatsListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingOSStatsListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingOSStatsListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingOSStatsListRsp - * @throws IOException if the JSON string is invalid with respect to TrackingOSStatsListRsp - */ - public static TrackingOSStatsListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingOSStatsListRsp.class); - } - - /** - * Convert an instance of TrackingOSStatsListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingOSStatsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/TrackingOSStatsListRspAllOfData.java deleted file mode 100644 index dd5c1cc..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingOSStatsListRspAllOfData.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.TrackingOSStats; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingOSStatsListRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingOSStatsListRspAllOfData { - public static final String SERIALIZED_NAME_STATS = "stats"; - @SerializedName(SERIALIZED_NAME_STATS) - private List stats = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public TrackingOSStatsListRspAllOfData() { - } - - public TrackingOSStatsListRspAllOfData stats(List stats) { - this.stats = stats; - return this; - } - - public TrackingOSStatsListRspAllOfData addStatsItem(TrackingOSStats statsItem) { - if (this.stats == null) { - this.stats = new ArrayList<>(); - } - this.stats.add(statsItem); - return this; - } - - /** - * Get stats - * @return stats - **/ - @javax.annotation.Nonnull - public List getStats() { - return stats; - } - - public void setStats(List stats) { - this.stats = stats; - } - - - public TrackingOSStatsListRspAllOfData paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingOSStatsListRspAllOfData trackingOSStatsListRspAllOfData = (TrackingOSStatsListRspAllOfData) o; - return Objects.equals(this.stats, trackingOSStatsListRspAllOfData.stats) && - Objects.equals(this.paging, trackingOSStatsListRspAllOfData.paging); - } - - @Override - public int hashCode() { - return Objects.hash(stats, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingOSStatsListRspAllOfData {\n"); - sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("stats"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("stats"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingOSStatsListRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingOSStatsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingOSStatsListRspAllOfData is not found in the empty JSON string", TrackingOSStatsListRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingOSStatsListRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingOSStatsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingOSStatsListRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("stats").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); - } - - JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); - // validate the required field `stats` (array) - for (int i = 0; i < jsonArraystats.size(); i++) { - TrackingOSStats.validateJsonElement(jsonArraystats.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingOSStatsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingOSStatsListRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingOSStatsListRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingOSStatsListRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingOSStatsListRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingOSStatsListRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingOSStatsListRspAllOfData - * @throws IOException if the JSON string is invalid with respect to TrackingOSStatsListRspAllOfData - */ - public static TrackingOSStatsListRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingOSStatsListRspAllOfData.class); - } - - /** - * Convert an instance of TrackingOSStatsListRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingRawListRow.java b/src/main/java/com/corbado/generated/model/TrackingRawListRow.java deleted file mode 100644 index ced1658..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingRawListRow.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingRawListRow - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingRawListRow { - public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; - @SerializedName(SERIALIZED_NAME_TIME_POINT) - private String timePoint; - - public static final String SERIALIZED_NAME_HAS_WEBAUTHN = "hasWebauthn"; - @SerializedName(SERIALIZED_NAME_HAS_WEBAUTHN) - private Boolean hasWebauthn; - - public static final String SERIALIZED_NAME_HAS_PLATFORM_AUTH = "hasPlatformAuth"; - @SerializedName(SERIALIZED_NAME_HAS_PLATFORM_AUTH) - private Boolean hasPlatformAuth; - - public static final String SERIALIZED_NAME_HAS_CONDITIONAL_UI = "hasConditionalUi"; - @SerializedName(SERIALIZED_NAME_HAS_CONDITIONAL_UI) - private Boolean hasConditionalUi; - - public static final String SERIALIZED_NAME_OS_ID = "osId"; - @SerializedName(SERIALIZED_NAME_OS_ID) - private String osId; - - public static final String SERIALIZED_NAME_BROWSER_ID = "browserId"; - @SerializedName(SERIALIZED_NAME_BROWSER_ID) - private String browserId; - - public TrackingRawListRow() { - } - - public TrackingRawListRow timePoint(String timePoint) { - this.timePoint = timePoint; - return this; - } - - /** - * Get timePoint - * @return timePoint - **/ - @javax.annotation.Nonnull - public String getTimePoint() { - return timePoint; - } - - public void setTimePoint(String timePoint) { - this.timePoint = timePoint; - } - - - public TrackingRawListRow hasWebauthn(Boolean hasWebauthn) { - this.hasWebauthn = hasWebauthn; - return this; - } - - /** - * Get hasWebauthn - * @return hasWebauthn - **/ - @javax.annotation.Nonnull - public Boolean getHasWebauthn() { - return hasWebauthn; - } - - public void setHasWebauthn(Boolean hasWebauthn) { - this.hasWebauthn = hasWebauthn; - } - - - public TrackingRawListRow hasPlatformAuth(Boolean hasPlatformAuth) { - this.hasPlatformAuth = hasPlatformAuth; - return this; - } - - /** - * Get hasPlatformAuth - * @return hasPlatformAuth - **/ - @javax.annotation.Nonnull - public Boolean getHasPlatformAuth() { - return hasPlatformAuth; - } - - public void setHasPlatformAuth(Boolean hasPlatformAuth) { - this.hasPlatformAuth = hasPlatformAuth; - } - - - public TrackingRawListRow hasConditionalUi(Boolean hasConditionalUi) { - this.hasConditionalUi = hasConditionalUi; - return this; - } - - /** - * Get hasConditionalUi - * @return hasConditionalUi - **/ - @javax.annotation.Nonnull - public Boolean getHasConditionalUi() { - return hasConditionalUi; - } - - public void setHasConditionalUi(Boolean hasConditionalUi) { - this.hasConditionalUi = hasConditionalUi; - } - - - public TrackingRawListRow osId(String osId) { - this.osId = osId; - return this; - } - - /** - * Get osId - * @return osId - **/ - @javax.annotation.Nonnull - public String getOsId() { - return osId; - } - - public void setOsId(String osId) { - this.osId = osId; - } - - - public TrackingRawListRow browserId(String browserId) { - this.browserId = browserId; - return this; - } - - /** - * Get browserId - * @return browserId - **/ - @javax.annotation.Nonnull - public String getBrowserId() { - return browserId; - } - - public void setBrowserId(String browserId) { - this.browserId = browserId; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingRawListRow trackingRawListRow = (TrackingRawListRow) o; - return Objects.equals(this.timePoint, trackingRawListRow.timePoint) && - Objects.equals(this.hasWebauthn, trackingRawListRow.hasWebauthn) && - Objects.equals(this.hasPlatformAuth, trackingRawListRow.hasPlatformAuth) && - Objects.equals(this.hasConditionalUi, trackingRawListRow.hasConditionalUi) && - Objects.equals(this.osId, trackingRawListRow.osId) && - Objects.equals(this.browserId, trackingRawListRow.browserId); - } - - @Override - public int hashCode() { - return Objects.hash(timePoint, hasWebauthn, hasPlatformAuth, hasConditionalUi, osId, browserId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingRawListRow {\n"); - sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); - sb.append(" hasWebauthn: ").append(toIndentedString(hasWebauthn)).append("\n"); - sb.append(" hasPlatformAuth: ").append(toIndentedString(hasPlatformAuth)).append("\n"); - sb.append(" hasConditionalUi: ").append(toIndentedString(hasConditionalUi)).append("\n"); - sb.append(" osId: ").append(toIndentedString(osId)).append("\n"); - sb.append(" browserId: ").append(toIndentedString(browserId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("timePoint"); - openapiFields.add("hasWebauthn"); - openapiFields.add("hasPlatformAuth"); - openapiFields.add("hasConditionalUi"); - openapiFields.add("osId"); - openapiFields.add("browserId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("timePoint"); - openapiRequiredFields.add("hasWebauthn"); - openapiRequiredFields.add("hasPlatformAuth"); - openapiRequiredFields.add("hasConditionalUi"); - openapiRequiredFields.add("osId"); - openapiRequiredFields.add("browserId"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingRawListRow - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingRawListRow.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingRawListRow is not found in the empty JSON string", TrackingRawListRow.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingRawListRow.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingRawListRow` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingRawListRow.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("timePoint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); - } - if (!jsonObj.get("osId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `osId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osId").toString())); - } - if (!jsonObj.get("browserId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `browserId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("browserId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingRawListRow.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingRawListRow' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingRawListRow.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingRawListRow value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingRawListRow read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingRawListRow given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingRawListRow - * @throws IOException if the JSON string is invalid with respect to TrackingRawListRow - */ - public static TrackingRawListRow fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingRawListRow.class); - } - - /** - * Convert an instance of TrackingRawListRow to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingRawListRsp.java b/src/main/java/com/corbado/generated/model/TrackingRawListRsp.java deleted file mode 100644 index 996f66a..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingRawListRsp.java +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.TrackingRawListRow; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingRawListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingRawListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_ROWS = "rows"; - @SerializedName(SERIALIZED_NAME_ROWS) - private List rows = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public TrackingRawListRsp() { - } - - public TrackingRawListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public TrackingRawListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public TrackingRawListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public TrackingRawListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public TrackingRawListRsp rows(List rows) { - this.rows = rows; - return this; - } - - public TrackingRawListRsp addRowsItem(TrackingRawListRow rowsItem) { - if (this.rows == null) { - this.rows = new ArrayList<>(); - } - this.rows.add(rowsItem); - return this; - } - - /** - * Get rows - * @return rows - **/ - @javax.annotation.Nonnull - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - - public TrackingRawListRsp paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingRawListRsp trackingRawListRsp = (TrackingRawListRsp) o; - return Objects.equals(this.httpStatusCode, trackingRawListRsp.httpStatusCode) && - Objects.equals(this.message, trackingRawListRsp.message) && - Objects.equals(this.requestData, trackingRawListRsp.requestData) && - Objects.equals(this.runtime, trackingRawListRsp.runtime) && - Objects.equals(this.rows, trackingRawListRsp.rows) && - Objects.equals(this.paging, trackingRawListRsp.paging); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, rows, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingRawListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("rows"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("rows"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingRawListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingRawListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingRawListRsp is not found in the empty JSON string", TrackingRawListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingRawListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingRawListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingRawListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // ensure the json data is an array - if (!jsonObj.get("rows").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rows` to be an array in the JSON string but got `%s`", jsonObj.get("rows").toString())); - } - - JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); - // validate the required field `rows` (array) - for (int i = 0; i < jsonArrayrows.size(); i++) { - TrackingRawListRow.validateJsonElement(jsonArrayrows.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingRawListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingRawListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingRawListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingRawListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingRawListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingRawListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingRawListRsp - * @throws IOException if the JSON string is invalid with respect to TrackingRawListRsp - */ - public static TrackingRawListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingRawListRsp.class); - } - - /** - * Convert an instance of TrackingRawListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingStats.java b/src/main/java/com/corbado/generated/model/TrackingStats.java deleted file mode 100644 index e5b4505..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingStats.java +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingStats - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingStats { - public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; - @SerializedName(SERIALIZED_NAME_TIME_POINT) - private String timePoint; - - public static final String SERIALIZED_NAME_AGGREGATE_VISITS = "aggregateVisits"; - @SerializedName(SERIALIZED_NAME_AGGREGATE_VISITS) - private Integer aggregateVisits; - - public static final String SERIALIZED_NAME_AGGREGATE_WEBAUTHN = "aggregateWebauthn"; - @SerializedName(SERIALIZED_NAME_AGGREGATE_WEBAUTHN) - private Integer aggregateWebauthn; - - public static final String SERIALIZED_NAME_AGGREGATE_PLATFORM = "aggregatePlatform"; - @SerializedName(SERIALIZED_NAME_AGGREGATE_PLATFORM) - private Integer aggregatePlatform; - - public static final String SERIALIZED_NAME_AGGREGATE_CONDITIONAL_UI = "aggregateConditionalUi"; - @SerializedName(SERIALIZED_NAME_AGGREGATE_CONDITIONAL_UI) - private Integer aggregateConditionalUi; - - public TrackingStats() { - } - - public TrackingStats timePoint(String timePoint) { - this.timePoint = timePoint; - return this; - } - - /** - * Get timePoint - * @return timePoint - **/ - @javax.annotation.Nonnull - public String getTimePoint() { - return timePoint; - } - - public void setTimePoint(String timePoint) { - this.timePoint = timePoint; - } - - - public TrackingStats aggregateVisits(Integer aggregateVisits) { - this.aggregateVisits = aggregateVisits; - return this; - } - - /** - * Get aggregateVisits - * @return aggregateVisits - **/ - @javax.annotation.Nonnull - public Integer getAggregateVisits() { - return aggregateVisits; - } - - public void setAggregateVisits(Integer aggregateVisits) { - this.aggregateVisits = aggregateVisits; - } - - - public TrackingStats aggregateWebauthn(Integer aggregateWebauthn) { - this.aggregateWebauthn = aggregateWebauthn; - return this; - } - - /** - * Get aggregateWebauthn - * @return aggregateWebauthn - **/ - @javax.annotation.Nonnull - public Integer getAggregateWebauthn() { - return aggregateWebauthn; - } - - public void setAggregateWebauthn(Integer aggregateWebauthn) { - this.aggregateWebauthn = aggregateWebauthn; - } - - - public TrackingStats aggregatePlatform(Integer aggregatePlatform) { - this.aggregatePlatform = aggregatePlatform; - return this; - } - - /** - * Get aggregatePlatform - * @return aggregatePlatform - **/ - @javax.annotation.Nonnull - public Integer getAggregatePlatform() { - return aggregatePlatform; - } - - public void setAggregatePlatform(Integer aggregatePlatform) { - this.aggregatePlatform = aggregatePlatform; - } - - - public TrackingStats aggregateConditionalUi(Integer aggregateConditionalUi) { - this.aggregateConditionalUi = aggregateConditionalUi; - return this; - } - - /** - * Get aggregateConditionalUi - * @return aggregateConditionalUi - **/ - @javax.annotation.Nonnull - public Integer getAggregateConditionalUi() { - return aggregateConditionalUi; - } - - public void setAggregateConditionalUi(Integer aggregateConditionalUi) { - this.aggregateConditionalUi = aggregateConditionalUi; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingStats trackingStats = (TrackingStats) o; - return Objects.equals(this.timePoint, trackingStats.timePoint) && - Objects.equals(this.aggregateVisits, trackingStats.aggregateVisits) && - Objects.equals(this.aggregateWebauthn, trackingStats.aggregateWebauthn) && - Objects.equals(this.aggregatePlatform, trackingStats.aggregatePlatform) && - Objects.equals(this.aggregateConditionalUi, trackingStats.aggregateConditionalUi); - } - - @Override - public int hashCode() { - return Objects.hash(timePoint, aggregateVisits, aggregateWebauthn, aggregatePlatform, aggregateConditionalUi); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingStats {\n"); - sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); - sb.append(" aggregateVisits: ").append(toIndentedString(aggregateVisits)).append("\n"); - sb.append(" aggregateWebauthn: ").append(toIndentedString(aggregateWebauthn)).append("\n"); - sb.append(" aggregatePlatform: ").append(toIndentedString(aggregatePlatform)).append("\n"); - sb.append(" aggregateConditionalUi: ").append(toIndentedString(aggregateConditionalUi)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("timePoint"); - openapiFields.add("aggregateVisits"); - openapiFields.add("aggregateWebauthn"); - openapiFields.add("aggregatePlatform"); - openapiFields.add("aggregateConditionalUi"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("timePoint"); - openapiRequiredFields.add("aggregateVisits"); - openapiRequiredFields.add("aggregateWebauthn"); - openapiRequiredFields.add("aggregatePlatform"); - openapiRequiredFields.add("aggregateConditionalUi"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingStats - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingStats is not found in the empty JSON string", TrackingStats.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingStats.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingStats` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingStats.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("timePoint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingStats.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingStats' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingStats.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingStats value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingStats read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingStats given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingStats - * @throws IOException if the JSON string is invalid with respect to TrackingStats - */ - public static TrackingStats fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingStats.class); - } - - /** - * Convert an instance of TrackingStats to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingStatsListRsp.java b/src/main/java/com/corbado/generated/model/TrackingStatsListRsp.java deleted file mode 100644 index 54fca16..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingStatsListRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.TrackingStatsListRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingStatsListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingStatsListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private TrackingStatsListRspAllOfData data; - - public TrackingStatsListRsp() { - } - - public TrackingStatsListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public TrackingStatsListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public TrackingStatsListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public TrackingStatsListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public TrackingStatsListRsp data(TrackingStatsListRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public TrackingStatsListRspAllOfData getData() { - return data; - } - - public void setData(TrackingStatsListRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingStatsListRsp trackingStatsListRsp = (TrackingStatsListRsp) o; - return Objects.equals(this.httpStatusCode, trackingStatsListRsp.httpStatusCode) && - Objects.equals(this.message, trackingStatsListRsp.message) && - Objects.equals(this.requestData, trackingStatsListRsp.requestData) && - Objects.equals(this.runtime, trackingStatsListRsp.runtime) && - Objects.equals(this.data, trackingStatsListRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingStatsListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingStatsListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingStatsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingStatsListRsp is not found in the empty JSON string", TrackingStatsListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingStatsListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingStatsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingStatsListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - TrackingStatsListRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingStatsListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingStatsListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingStatsListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingStatsListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingStatsListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingStatsListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingStatsListRsp - * @throws IOException if the JSON string is invalid with respect to TrackingStatsListRsp - */ - public static TrackingStatsListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingStatsListRsp.class); - } - - /** - * Convert an instance of TrackingStatsListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/TrackingStatsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/TrackingStatsListRspAllOfData.java deleted file mode 100644 index d3917c9..0000000 --- a/src/main/java/com/corbado/generated/model/TrackingStatsListRspAllOfData.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.TrackingStats; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * TrackingStatsListRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class TrackingStatsListRspAllOfData { - public static final String SERIALIZED_NAME_STATS = "stats"; - @SerializedName(SERIALIZED_NAME_STATS) - private List stats = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public TrackingStatsListRspAllOfData() { - } - - public TrackingStatsListRspAllOfData stats(List stats) { - this.stats = stats; - return this; - } - - public TrackingStatsListRspAllOfData addStatsItem(TrackingStats statsItem) { - if (this.stats == null) { - this.stats = new ArrayList<>(); - } - this.stats.add(statsItem); - return this; - } - - /** - * Get stats - * @return stats - **/ - @javax.annotation.Nonnull - public List getStats() { - return stats; - } - - public void setStats(List stats) { - this.stats = stats; - } - - - public TrackingStatsListRspAllOfData paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TrackingStatsListRspAllOfData trackingStatsListRspAllOfData = (TrackingStatsListRspAllOfData) o; - return Objects.equals(this.stats, trackingStatsListRspAllOfData.stats) && - Objects.equals(this.paging, trackingStatsListRspAllOfData.paging); - } - - @Override - public int hashCode() { - return Objects.hash(stats, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TrackingStatsListRspAllOfData {\n"); - sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("stats"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("stats"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TrackingStatsListRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TrackingStatsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in TrackingStatsListRspAllOfData is not found in the empty JSON string", TrackingStatsListRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!TrackingStatsListRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackingStatsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TrackingStatsListRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("stats").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); - } - - JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); - // validate the required field `stats` (array) - for (int i = 0; i < jsonArraystats.size(); i++) { - TrackingStats.validateJsonElement(jsonArraystats.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TrackingStatsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'TrackingStatsListRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(TrackingStatsListRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, TrackingStatsListRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TrackingStatsListRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of TrackingStatsListRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of TrackingStatsListRspAllOfData - * @throws IOException if the JSON string is invalid with respect to TrackingStatsListRspAllOfData - */ - public static TrackingStatsListRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, TrackingStatsListRspAllOfData.class); - } - - /** - * Convert an instance of TrackingStatsListRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/User.java b/src/main/java/com/corbado/generated/model/User.java index b16922e..5b33145 100644 --- a/src/main/java/com/corbado/generated/model/User.java +++ b/src/main/java/com/corbado/generated/model/User.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,6 +14,7 @@ package com.corbado.generated.model; import java.util.Objects; +import com.corbado.generated.model.UserStatus; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -47,72 +48,45 @@ import com.corbado.generated.invoker.JSON; /** - * User entry + * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class User { - public static final String SERIALIZED_NAME_I_D = "ID"; - @SerializedName(SERIALIZED_NAME_I_D) - private String ID; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; + public static final String SERIALIZED_NAME_USER_I_D = "userID"; + @SerializedName(SERIALIZED_NAME_USER_I_D) + private String userID; public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; @SerializedName(SERIALIZED_NAME_FULL_NAME) private String fullName; - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) - private String status; + private UserStatus status; - public User() { - } + public static final String SERIALIZED_NAME_EXPLICIT_WEBAUTHN_I_D = "explicitWebauthnID"; + @SerializedName(SERIALIZED_NAME_EXPLICIT_WEBAUTHN_I_D) + private String explicitWebauthnID; - public User ID(String ID) { - this.ID = ID; - return this; - } - - /** - * ID of the user - * @return ID - **/ - @javax.annotation.Nonnull - public String getID() { - return ID; - } - - public void setID(String ID) { - this.ID = ID; + public User() { } - - public User name(String name) { - this.name = name; + public User userID(String userID) { + this.userID = userID; return this; } - /** - * Get name - * @return name - **/ + /** + * Get userID + * @return userID + */ @javax.annotation.Nonnull - public String getName() { - return name; + public String getUserID() { + return userID; } - public void setName(String name) { - this.name = name; + public void setUserID(String userID) { + this.userID = userID; } @@ -121,11 +95,11 @@ public User fullName(String fullName) { return this; } - /** + /** * Get fullName * @return fullName - **/ - @javax.annotation.Nonnull + */ + @javax.annotation.Nullable public String getFullName() { return fullName; } @@ -135,60 +109,41 @@ public void setFullName(String fullName) { } - public User created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public User updated(String updated) { - this.updated = updated; + public User status(UserStatus status) { + this.status = status; return this; } - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ + /** + * Get status + * @return status + */ @javax.annotation.Nonnull - public String getUpdated() { - return updated; + public UserStatus getStatus() { + return status; } - public void setUpdated(String updated) { - this.updated = updated; + public void setStatus(UserStatus status) { + this.status = status; } - public User status(String status) { - this.status = status; + public User explicitWebauthnID(String explicitWebauthnID) { + this.explicitWebauthnID = explicitWebauthnID; return this; } - /** - * Get status - * @return status - **/ - @javax.annotation.Nonnull - public String getStatus() { - return status; + /** + * Get explicitWebauthnID + * @return explicitWebauthnID + */ + @javax.annotation.Nullable + public String getExplicitWebauthnID() { + return explicitWebauthnID; } - public void setStatus(String status) { - this.status = status; + public void setExplicitWebauthnID(String explicitWebauthnID) { + this.explicitWebauthnID = explicitWebauthnID; } @@ -202,29 +157,25 @@ public boolean equals(Object o) { return false; } User user = (User) o; - return Objects.equals(this.ID, user.ID) && - Objects.equals(this.name, user.name) && + return Objects.equals(this.userID, user.userID) && Objects.equals(this.fullName, user.fullName) && - Objects.equals(this.created, user.created) && - Objects.equals(this.updated, user.updated) && - Objects.equals(this.status, user.status); + Objects.equals(this.status, user.status) && + Objects.equals(this.explicitWebauthnID, user.explicitWebauthnID); } @Override public int hashCode() { - return Objects.hash(ID, name, fullName, created, updated, status); + return Objects.hash(userID, fullName, status, explicitWebauthnID); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class User {\n"); - sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" explicitWebauthnID: ").append(toIndentedString(explicitWebauthnID)).append("\n"); sb.append("}"); return sb.toString(); } @@ -247,29 +198,23 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("ID"); - openapiFields.add("name"); + openapiFields.add("userID"); openapiFields.add("fullName"); - openapiFields.add("created"); - openapiFields.add("updated"); openapiFields.add("status"); + openapiFields.add("explicitWebauthnID"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("ID"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("fullName"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); + openapiRequiredFields.add("userID"); openapiRequiredFields.add("status"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to User - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to User + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!User.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -292,23 +237,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("ID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + if (!jsonObj.get("userID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); } - if (!jsonObj.get("fullName").isJsonPrimitive()) { + if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + // validate the required field `status` + UserStatus.validateJsonElement(jsonObj.get("status")); + if ((jsonObj.get("explicitWebauthnID") != null && !jsonObj.get("explicitWebauthnID").isJsonNull()) && !jsonObj.get("explicitWebauthnID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `explicitWebauthnID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("explicitWebauthnID").toString())); } } @@ -341,22 +279,22 @@ public User read(JsonReader in) throws IOException { } } - /** - * Create an instance of User given an JSON string - * - * @param jsonString JSON string - * @return An instance of User - * @throws IOException if the JSON string is invalid with respect to User - */ + /** + * Create an instance of User given an JSON string + * + * @param jsonString JSON string + * @return An instance of User + * @throws IOException if the JSON string is invalid with respect to User + */ public static User fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, User.class); } - /** - * Convert an instance of User to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of User to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/com/corbado/generated/model/UserAuthLog.java b/src/main/java/com/corbado/generated/model/UserAuthLog.java deleted file mode 100644 index 13aea1d..0000000 --- a/src/main/java/com/corbado/generated/model/UserAuthLog.java +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserAuthLog - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserAuthLog { - public static final String SERIALIZED_NAME_USER_I_D = "userID"; - @SerializedName(SERIALIZED_NAME_USER_I_D) - private String userID; - - public static final String SERIALIZED_NAME_USER_NAME = "userName"; - @SerializedName(SERIALIZED_NAME_USER_NAME) - private String userName; - - public static final String SERIALIZED_NAME_METHOD = "method"; - @SerializedName(SERIALIZED_NAME_METHOD) - private String method; - - public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; - @SerializedName(SERIALIZED_NAME_EVENT_TYPE) - private String eventType; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public UserAuthLog() { - } - - public UserAuthLog userID(String userID) { - this.userID = userID; - return this; - } - - /** - * ID of the user - * @return userID - **/ - @javax.annotation.Nonnull - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - - public UserAuthLog userName(String userName) { - this.userName = userName; - return this; - } - - /** - * Get userName - * @return userName - **/ - @javax.annotation.Nonnull - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - - public UserAuthLog method(String method) { - this.method = method; - return this; - } - - /** - * Get method - * @return method - **/ - @javax.annotation.Nonnull - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - - public UserAuthLog eventType(String eventType) { - this.eventType = eventType; - return this; - } - - /** - * Get eventType - * @return eventType - **/ - @javax.annotation.Nonnull - public String getEventType() { - return eventType; - } - - public void setEventType(String eventType) { - this.eventType = eventType; - } - - - public UserAuthLog status(String status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - **/ - @javax.annotation.Nonnull - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - - public UserAuthLog created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserAuthLog userAuthLog = (UserAuthLog) o; - return Objects.equals(this.userID, userAuthLog.userID) && - Objects.equals(this.userName, userAuthLog.userName) && - Objects.equals(this.method, userAuthLog.method) && - Objects.equals(this.eventType, userAuthLog.eventType) && - Objects.equals(this.status, userAuthLog.status) && - Objects.equals(this.created, userAuthLog.created); - } - - @Override - public int hashCode() { - return Objects.hash(userID, userName, method, eventType, status, created); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserAuthLog {\n"); - sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); - sb.append(" method: ").append(toIndentedString(method)).append("\n"); - sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("userID"); - openapiFields.add("userName"); - openapiFields.add("method"); - openapiFields.add("eventType"); - openapiFields.add("status"); - openapiFields.add("created"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("userID"); - openapiRequiredFields.add("userName"); - openapiRequiredFields.add("method"); - openapiRequiredFields.add("eventType"); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("created"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserAuthLog - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserAuthLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserAuthLog is not found in the empty JSON string", UserAuthLog.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserAuthLog.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserAuthLog` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserAuthLog.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("userID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); - } - if (!jsonObj.get("userName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userName").toString())); - } - if (!jsonObj.get("method").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); - } - if (!jsonObj.get("eventType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `eventType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventType").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserAuthLog.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserAuthLog' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserAuthLog.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserAuthLog value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserAuthLog read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserAuthLog given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserAuthLog - * @throws IOException if the JSON string is invalid with respect to UserAuthLog - */ - public static UserAuthLog fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserAuthLog.class); - } - - /** - * Convert an instance of UserAuthLog to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserAuthLogListRsp.java b/src/main/java/com/corbado/generated/model/UserAuthLogListRsp.java deleted file mode 100644 index 1446e90..0000000 --- a/src/main/java/com/corbado/generated/model/UserAuthLogListRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.UserAuthLogListRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserAuthLogListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserAuthLogListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private UserAuthLogListRspAllOfData data; - - public UserAuthLogListRsp() { - } - - public UserAuthLogListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public UserAuthLogListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public UserAuthLogListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public UserAuthLogListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public UserAuthLogListRsp data(UserAuthLogListRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public UserAuthLogListRspAllOfData getData() { - return data; - } - - public void setData(UserAuthLogListRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserAuthLogListRsp userAuthLogListRsp = (UserAuthLogListRsp) o; - return Objects.equals(this.httpStatusCode, userAuthLogListRsp.httpStatusCode) && - Objects.equals(this.message, userAuthLogListRsp.message) && - Objects.equals(this.requestData, userAuthLogListRsp.requestData) && - Objects.equals(this.runtime, userAuthLogListRsp.runtime) && - Objects.equals(this.data, userAuthLogListRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserAuthLogListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserAuthLogListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserAuthLogListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserAuthLogListRsp is not found in the empty JSON string", UserAuthLogListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserAuthLogListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserAuthLogListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserAuthLogListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - UserAuthLogListRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserAuthLogListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserAuthLogListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserAuthLogListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserAuthLogListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserAuthLogListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserAuthLogListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserAuthLogListRsp - * @throws IOException if the JSON string is invalid with respect to UserAuthLogListRsp - */ - public static UserAuthLogListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserAuthLogListRsp.class); - } - - /** - * Convert an instance of UserAuthLogListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserAuthLogListRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserAuthLogListRspAllOfData.java deleted file mode 100644 index 2393102..0000000 --- a/src/main/java/com/corbado/generated/model/UserAuthLogListRspAllOfData.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.UserAuthLog; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserAuthLogListRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserAuthLogListRspAllOfData { - public static final String SERIALIZED_NAME_ROWS = "rows"; - @SerializedName(SERIALIZED_NAME_ROWS) - private List rows = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public UserAuthLogListRspAllOfData() { - } - - public UserAuthLogListRspAllOfData rows(List rows) { - this.rows = rows; - return this; - } - - public UserAuthLogListRspAllOfData addRowsItem(UserAuthLog rowsItem) { - if (this.rows == null) { - this.rows = new ArrayList<>(); - } - this.rows.add(rowsItem); - return this; - } - - /** - * Get rows - * @return rows - **/ - @javax.annotation.Nonnull - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - - public UserAuthLogListRspAllOfData paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserAuthLogListRspAllOfData userAuthLogListRspAllOfData = (UserAuthLogListRspAllOfData) o; - return Objects.equals(this.rows, userAuthLogListRspAllOfData.rows) && - Objects.equals(this.paging, userAuthLogListRspAllOfData.paging); - } - - @Override - public int hashCode() { - return Objects.hash(rows, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserAuthLogListRspAllOfData {\n"); - sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("rows"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("rows"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserAuthLogListRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserAuthLogListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserAuthLogListRspAllOfData is not found in the empty JSON string", UserAuthLogListRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserAuthLogListRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserAuthLogListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserAuthLogListRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("rows").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rows` to be an array in the JSON string but got `%s`", jsonObj.get("rows").toString())); - } - - JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); - // validate the required field `rows` (array) - for (int i = 0; i < jsonArrayrows.size(); i++) { - UserAuthLog.validateJsonElement(jsonArrayrows.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserAuthLogListRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserAuthLogListRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserAuthLogListRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserAuthLogListRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserAuthLogListRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserAuthLogListRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserAuthLogListRspAllOfData - * @throws IOException if the JSON string is invalid with respect to UserAuthLogListRspAllOfData - */ - public static UserAuthLogListRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserAuthLogListRspAllOfData.class); - } - - /** - * Convert an instance of UserAuthLogListRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserCreateReq.java b/src/main/java/com/corbado/generated/model/UserCreateReq.java index 52f0391..1b73bd2 100644 --- a/src/main/java/com/corbado/generated/model/UserCreateReq.java +++ b/src/main/java/com/corbado/generated/model/UserCreateReq.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,7 +14,7 @@ package com.corbado.generated.model; import java.util.Objects; -import com.corbado.generated.model.ClientInfo; +import com.corbado.generated.model.UserStatus; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -50,63 +50,32 @@ /** * UserCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class UserCreateReq { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; @SerializedName(SERIALIZED_NAME_FULL_NAME) private String fullName; - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; - @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) - private String phoneNumber; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private UserStatus status; - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; + public static final String SERIALIZED_NAME_EXPLICIT_WEBAUTHN_I_D = "explicitWebauthnID"; + @SerializedName(SERIALIZED_NAME_EXPLICIT_WEBAUTHN_I_D) + private String explicitWebauthnID; public UserCreateReq() { } - public UserCreateReq name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public UserCreateReq fullName(String fullName) { this.fullName = fullName; return this; } - /** + /** * Get fullName * @return fullName - **/ + */ @javax.annotation.Nullable public String getFullName() { return fullName; @@ -117,79 +86,41 @@ public void setFullName(String fullName) { } - public UserCreateReq email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - **/ - @javax.annotation.Nullable - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - - public UserCreateReq phoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - /** - * Get phoneNumber - * @return phoneNumber - **/ - @javax.annotation.Nullable - public String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - - - public UserCreateReq requestID(String requestID) { - this.requestID = requestID; + public UserCreateReq status(UserStatus status) { + this.status = status; return this; } - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public UserStatus getStatus() { + return status; } - public void setRequestID(String requestID) { - this.requestID = requestID; + public void setStatus(UserStatus status) { + this.status = status; } - public UserCreateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; + public UserCreateReq explicitWebauthnID(String explicitWebauthnID) { + this.explicitWebauthnID = explicitWebauthnID; return this; } - /** - * Get clientInfo - * @return clientInfo - **/ + /** + * For connect projects, the webauthnID can be explicitly set for a user + * @return explicitWebauthnID + */ @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; + public String getExplicitWebauthnID() { + return explicitWebauthnID; } - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; + public void setExplicitWebauthnID(String explicitWebauthnID) { + this.explicitWebauthnID = explicitWebauthnID; } @@ -203,29 +134,23 @@ public boolean equals(Object o) { return false; } UserCreateReq userCreateReq = (UserCreateReq) o; - return Objects.equals(this.name, userCreateReq.name) && - Objects.equals(this.fullName, userCreateReq.fullName) && - Objects.equals(this.email, userCreateReq.email) && - Objects.equals(this.phoneNumber, userCreateReq.phoneNumber) && - Objects.equals(this.requestID, userCreateReq.requestID) && - Objects.equals(this.clientInfo, userCreateReq.clientInfo); + return Objects.equals(this.fullName, userCreateReq.fullName) && + Objects.equals(this.status, userCreateReq.status) && + Objects.equals(this.explicitWebauthnID, userCreateReq.explicitWebauthnID); } @Override public int hashCode() { - return Objects.hash(name, fullName, email, phoneNumber, requestID, clientInfo); + return Objects.hash(fullName, status, explicitWebauthnID); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UserCreateReq {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" explicitWebauthnID: ").append(toIndentedString(explicitWebauthnID)).append("\n"); sb.append("}"); return sb.toString(); } @@ -248,24 +173,21 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("name"); openapiFields.add("fullName"); - openapiFields.add("email"); - openapiFields.add("phoneNumber"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); + openapiFields.add("status"); + openapiFields.add("explicitWebauthnID"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); + openapiRequiredFields.add("status"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserCreateReq - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserCreateReq + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!UserCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -288,24 +210,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("phoneNumber") != null && !jsonObj.get("phoneNumber").isJsonNull()) && !jsonObj.get("phoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + // validate the required field `status` + UserStatus.validateJsonElement(jsonObj.get("status")); + if ((jsonObj.get("explicitWebauthnID") != null && !jsonObj.get("explicitWebauthnID").isJsonNull()) && !jsonObj.get("explicitWebauthnID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `explicitWebauthnID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("explicitWebauthnID").toString())); } } @@ -338,22 +249,22 @@ public UserCreateReq read(JsonReader in) throws IOException { } } - /** - * Create an instance of UserCreateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserCreateReq - * @throws IOException if the JSON string is invalid with respect to UserCreateReq - */ + /** + * Create an instance of UserCreateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCreateReq + * @throws IOException if the JSON string is invalid with respect to UserCreateReq + */ public static UserCreateReq fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UserCreateReq.class); } - /** - * Convert an instance of UserCreateReq to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UserCreateReq to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/com/corbado/generated/model/UserCreateRsp.java b/src/main/java/com/corbado/generated/model/UserCreateRsp.java deleted file mode 100644 index b59ed5e..0000000 --- a/src/main/java/com/corbado/generated/model/UserCreateRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.UserCreateRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserCreateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserCreateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private UserCreateRspAllOfData data; - - public UserCreateRsp() { - } - - public UserCreateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public UserCreateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public UserCreateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public UserCreateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public UserCreateRsp data(UserCreateRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public UserCreateRspAllOfData getData() { - return data; - } - - public void setData(UserCreateRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserCreateRsp userCreateRsp = (UserCreateRsp) o; - return Objects.equals(this.httpStatusCode, userCreateRsp.httpStatusCode) && - Objects.equals(this.message, userCreateRsp.message) && - Objects.equals(this.requestData, userCreateRsp.requestData) && - Objects.equals(this.runtime, userCreateRsp.runtime) && - Objects.equals(this.data, userCreateRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserCreateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserCreateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserCreateRsp is not found in the empty JSON string", UserCreateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserCreateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserCreateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - UserCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserCreateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserCreateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserCreateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserCreateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserCreateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserCreateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserCreateRsp - * @throws IOException if the JSON string is invalid with respect to UserCreateRsp - */ - public static UserCreateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserCreateRsp.class); - } - - /** - * Convert an instance of UserCreateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserCreateRspAllOfData.java deleted file mode 100644 index de46f56..0000000 --- a/src/main/java/com/corbado/generated/model/UserCreateRspAllOfData.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserCreateRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserCreateRspAllOfData { - public static final String SERIALIZED_NAME_USER_I_D = "userID"; - @SerializedName(SERIALIZED_NAME_USER_I_D) - private String userID; - - public static final String SERIALIZED_NAME_EMAIL_I_D = "emailID"; - @SerializedName(SERIALIZED_NAME_EMAIL_I_D) - private String emailID; - - public static final String SERIALIZED_NAME_PHONE_NUMBER_I_D = "phoneNumberID"; - @SerializedName(SERIALIZED_NAME_PHONE_NUMBER_I_D) - private String phoneNumberID; - - public UserCreateRspAllOfData() { - } - - public UserCreateRspAllOfData userID(String userID) { - this.userID = userID; - return this; - } - - /** - * Get userID - * @return userID - **/ - @javax.annotation.Nonnull - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - - public UserCreateRspAllOfData emailID(String emailID) { - this.emailID = emailID; - return this; - } - - /** - * Get emailID - * @return emailID - **/ - @javax.annotation.Nonnull - public String getEmailID() { - return emailID; - } - - public void setEmailID(String emailID) { - this.emailID = emailID; - } - - - public UserCreateRspAllOfData phoneNumberID(String phoneNumberID) { - this.phoneNumberID = phoneNumberID; - return this; - } - - /** - * Get phoneNumberID - * @return phoneNumberID - **/ - @javax.annotation.Nonnull - public String getPhoneNumberID() { - return phoneNumberID; - } - - public void setPhoneNumberID(String phoneNumberID) { - this.phoneNumberID = phoneNumberID; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserCreateRspAllOfData userCreateRspAllOfData = (UserCreateRspAllOfData) o; - return Objects.equals(this.userID, userCreateRspAllOfData.userID) && - Objects.equals(this.emailID, userCreateRspAllOfData.emailID) && - Objects.equals(this.phoneNumberID, userCreateRspAllOfData.phoneNumberID); - } - - @Override - public int hashCode() { - return Objects.hash(userID, emailID, phoneNumberID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserCreateRspAllOfData {\n"); - sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb.append(" emailID: ").append(toIndentedString(emailID)).append("\n"); - sb.append(" phoneNumberID: ").append(toIndentedString(phoneNumberID)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("userID"); - openapiFields.add("emailID"); - openapiFields.add("phoneNumberID"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("userID"); - openapiRequiredFields.add("emailID"); - openapiRequiredFields.add("phoneNumberID"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserCreateRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserCreateRspAllOfData is not found in the empty JSON string", UserCreateRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserCreateRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserCreateRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("userID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); - } - if (!jsonObj.get("emailID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `emailID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailID").toString())); - } - if (!jsonObj.get("phoneNumberID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `phoneNumberID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumberID").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserCreateRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserCreateRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserCreateRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserCreateRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserCreateRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserCreateRspAllOfData - * @throws IOException if the JSON string is invalid with respect to UserCreateRspAllOfData - */ - public static UserCreateRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserCreateRspAllOfData.class); - } - - /** - * Convert an instance of UserCreateRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateReq.java b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateReq.java deleted file mode 100644 index 3740a3d..0000000 --- a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateReq.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserCustomLoginIdentifierCreateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserCustomLoginIdentifierCreateReq { - public static final String SERIALIZED_NAME_CUSTOM_LOGIN_IDENTIFIER = "customLoginIdentifier"; - @SerializedName(SERIALIZED_NAME_CUSTOM_LOGIN_IDENTIFIER) - private String customLoginIdentifier; - - public static final String SERIALIZED_NAME_ADDITIONAL_DATA = "additionalData"; - @SerializedName(SERIALIZED_NAME_ADDITIONAL_DATA) - private String additionalData; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public UserCustomLoginIdentifierCreateReq() { - } - - public UserCustomLoginIdentifierCreateReq customLoginIdentifier(String customLoginIdentifier) { - this.customLoginIdentifier = customLoginIdentifier; - return this; - } - - /** - * Get customLoginIdentifier - * @return customLoginIdentifier - **/ - @javax.annotation.Nonnull - public String getCustomLoginIdentifier() { - return customLoginIdentifier; - } - - public void setCustomLoginIdentifier(String customLoginIdentifier) { - this.customLoginIdentifier = customLoginIdentifier; - } - - - public UserCustomLoginIdentifierCreateReq additionalData(String additionalData) { - this.additionalData = additionalData; - return this; - } - - /** - * Get additionalData - * @return additionalData - **/ - @javax.annotation.Nullable - public String getAdditionalData() { - return additionalData; - } - - public void setAdditionalData(String additionalData) { - this.additionalData = additionalData; - } - - - public UserCustomLoginIdentifierCreateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public UserCustomLoginIdentifierCreateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserCustomLoginIdentifierCreateReq userCustomLoginIdentifierCreateReq = (UserCustomLoginIdentifierCreateReq) o; - return Objects.equals(this.customLoginIdentifier, userCustomLoginIdentifierCreateReq.customLoginIdentifier) && - Objects.equals(this.additionalData, userCustomLoginIdentifierCreateReq.additionalData) && - Objects.equals(this.requestID, userCustomLoginIdentifierCreateReq.requestID) && - Objects.equals(this.clientInfo, userCustomLoginIdentifierCreateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(customLoginIdentifier, additionalData, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserCustomLoginIdentifierCreateReq {\n"); - sb.append(" customLoginIdentifier: ").append(toIndentedString(customLoginIdentifier)).append("\n"); - sb.append(" additionalData: ").append(toIndentedString(additionalData)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("customLoginIdentifier"); - openapiFields.add("additionalData"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("customLoginIdentifier"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserCustomLoginIdentifierCreateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserCustomLoginIdentifierCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserCustomLoginIdentifierCreateReq is not found in the empty JSON string", UserCustomLoginIdentifierCreateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserCustomLoginIdentifierCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCustomLoginIdentifierCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserCustomLoginIdentifierCreateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("customLoginIdentifier").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `customLoginIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customLoginIdentifier").toString())); - } - if ((jsonObj.get("additionalData") != null && !jsonObj.get("additionalData").isJsonNull()) && !jsonObj.get("additionalData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `additionalData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("additionalData").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserCustomLoginIdentifierCreateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserCustomLoginIdentifierCreateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserCustomLoginIdentifierCreateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserCustomLoginIdentifierCreateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserCustomLoginIdentifierCreateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserCustomLoginIdentifierCreateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserCustomLoginIdentifierCreateReq - * @throws IOException if the JSON string is invalid with respect to UserCustomLoginIdentifierCreateReq - */ - public static UserCustomLoginIdentifierCreateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserCustomLoginIdentifierCreateReq.class); - } - - /** - * Convert an instance of UserCustomLoginIdentifierCreateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRsp.java b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRsp.java deleted file mode 100644 index e689e53..0000000 --- a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.UserCustomLoginIdentifierCreateRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserCustomLoginIdentifierCreateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserCustomLoginIdentifierCreateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private UserCustomLoginIdentifierCreateRspAllOfData data; - - public UserCustomLoginIdentifierCreateRsp() { - } - - public UserCustomLoginIdentifierCreateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public UserCustomLoginIdentifierCreateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public UserCustomLoginIdentifierCreateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public UserCustomLoginIdentifierCreateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public UserCustomLoginIdentifierCreateRsp data(UserCustomLoginIdentifierCreateRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public UserCustomLoginIdentifierCreateRspAllOfData getData() { - return data; - } - - public void setData(UserCustomLoginIdentifierCreateRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserCustomLoginIdentifierCreateRsp userCustomLoginIdentifierCreateRsp = (UserCustomLoginIdentifierCreateRsp) o; - return Objects.equals(this.httpStatusCode, userCustomLoginIdentifierCreateRsp.httpStatusCode) && - Objects.equals(this.message, userCustomLoginIdentifierCreateRsp.message) && - Objects.equals(this.requestData, userCustomLoginIdentifierCreateRsp.requestData) && - Objects.equals(this.runtime, userCustomLoginIdentifierCreateRsp.runtime) && - Objects.equals(this.data, userCustomLoginIdentifierCreateRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserCustomLoginIdentifierCreateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserCustomLoginIdentifierCreateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserCustomLoginIdentifierCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserCustomLoginIdentifierCreateRsp is not found in the empty JSON string", UserCustomLoginIdentifierCreateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserCustomLoginIdentifierCreateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCustomLoginIdentifierCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserCustomLoginIdentifierCreateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - UserCustomLoginIdentifierCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserCustomLoginIdentifierCreateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserCustomLoginIdentifierCreateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserCustomLoginIdentifierCreateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserCustomLoginIdentifierCreateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserCustomLoginIdentifierCreateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserCustomLoginIdentifierCreateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserCustomLoginIdentifierCreateRsp - * @throws IOException if the JSON string is invalid with respect to UserCustomLoginIdentifierCreateRsp - */ - public static UserCustomLoginIdentifierCreateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserCustomLoginIdentifierCreateRsp.class); - } - - /** - * Convert an instance of UserCustomLoginIdentifierCreateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRspAllOfData.java deleted file mode 100644 index afe651a..0000000 --- a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierCreateRspAllOfData.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserCustomLoginIdentifierCreateRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserCustomLoginIdentifierCreateRspAllOfData { - public static final String SERIALIZED_NAME_CUSTOM_LOGIN_IDENTIFIER_I_D = "customLoginIdentifierID"; - @SerializedName(SERIALIZED_NAME_CUSTOM_LOGIN_IDENTIFIER_I_D) - private String customLoginIdentifierID; - - public UserCustomLoginIdentifierCreateRspAllOfData() { - } - - public UserCustomLoginIdentifierCreateRspAllOfData customLoginIdentifierID(String customLoginIdentifierID) { - this.customLoginIdentifierID = customLoginIdentifierID; - return this; - } - - /** - * Get customLoginIdentifierID - * @return customLoginIdentifierID - **/ - @javax.annotation.Nonnull - public String getCustomLoginIdentifierID() { - return customLoginIdentifierID; - } - - public void setCustomLoginIdentifierID(String customLoginIdentifierID) { - this.customLoginIdentifierID = customLoginIdentifierID; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserCustomLoginIdentifierCreateRspAllOfData userCustomLoginIdentifierCreateRspAllOfData = (UserCustomLoginIdentifierCreateRspAllOfData) o; - return Objects.equals(this.customLoginIdentifierID, userCustomLoginIdentifierCreateRspAllOfData.customLoginIdentifierID); - } - - @Override - public int hashCode() { - return Objects.hash(customLoginIdentifierID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserCustomLoginIdentifierCreateRspAllOfData {\n"); - sb.append(" customLoginIdentifierID: ").append(toIndentedString(customLoginIdentifierID)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("customLoginIdentifierID"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("customLoginIdentifierID"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserCustomLoginIdentifierCreateRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserCustomLoginIdentifierCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserCustomLoginIdentifierCreateRspAllOfData is not found in the empty JSON string", UserCustomLoginIdentifierCreateRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserCustomLoginIdentifierCreateRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCustomLoginIdentifierCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserCustomLoginIdentifierCreateRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("customLoginIdentifierID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `customLoginIdentifierID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customLoginIdentifierID").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserCustomLoginIdentifierCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserCustomLoginIdentifierCreateRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserCustomLoginIdentifierCreateRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserCustomLoginIdentifierCreateRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserCustomLoginIdentifierCreateRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserCustomLoginIdentifierCreateRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserCustomLoginIdentifierCreateRspAllOfData - * @throws IOException if the JSON string is invalid with respect to UserCustomLoginIdentifierCreateRspAllOfData - */ - public static UserCustomLoginIdentifierCreateRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserCustomLoginIdentifierCreateRspAllOfData.class); - } - - /** - * Convert an instance of UserCustomLoginIdentifierCreateRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierDeleteReq.java b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierDeleteReq.java deleted file mode 100644 index 8a6431c..0000000 --- a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierDeleteReq.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserCustomLoginIdentifierDeleteReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserCustomLoginIdentifierDeleteReq { - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public UserCustomLoginIdentifierDeleteReq() { - } - - public UserCustomLoginIdentifierDeleteReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public UserCustomLoginIdentifierDeleteReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserCustomLoginIdentifierDeleteReq userCustomLoginIdentifierDeleteReq = (UserCustomLoginIdentifierDeleteReq) o; - return Objects.equals(this.requestID, userCustomLoginIdentifierDeleteReq.requestID) && - Objects.equals(this.clientInfo, userCustomLoginIdentifierDeleteReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserCustomLoginIdentifierDeleteReq {\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserCustomLoginIdentifierDeleteReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserCustomLoginIdentifierDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserCustomLoginIdentifierDeleteReq is not found in the empty JSON string", UserCustomLoginIdentifierDeleteReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserCustomLoginIdentifierDeleteReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCustomLoginIdentifierDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserCustomLoginIdentifierDeleteReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserCustomLoginIdentifierDeleteReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserCustomLoginIdentifierDeleteReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserCustomLoginIdentifierDeleteReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserCustomLoginIdentifierDeleteReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserCustomLoginIdentifierDeleteReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserCustomLoginIdentifierDeleteReq - * @throws IOException if the JSON string is invalid with respect to UserCustomLoginIdentifierDeleteReq - */ - public static UserCustomLoginIdentifierDeleteReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserCustomLoginIdentifierDeleteReq.class); - } - - /** - * Convert an instance of UserCustomLoginIdentifierDeleteReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRsp.java b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRsp.java deleted file mode 100644 index d70a853..0000000 --- a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.UserCustomLoginIdentifierGetRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserCustomLoginIdentifierGetRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserCustomLoginIdentifierGetRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private UserCustomLoginIdentifierGetRspAllOfData data; - - public UserCustomLoginIdentifierGetRsp() { - } - - public UserCustomLoginIdentifierGetRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public UserCustomLoginIdentifierGetRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public UserCustomLoginIdentifierGetRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public UserCustomLoginIdentifierGetRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public UserCustomLoginIdentifierGetRsp data(UserCustomLoginIdentifierGetRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public UserCustomLoginIdentifierGetRspAllOfData getData() { - return data; - } - - public void setData(UserCustomLoginIdentifierGetRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserCustomLoginIdentifierGetRsp userCustomLoginIdentifierGetRsp = (UserCustomLoginIdentifierGetRsp) o; - return Objects.equals(this.httpStatusCode, userCustomLoginIdentifierGetRsp.httpStatusCode) && - Objects.equals(this.message, userCustomLoginIdentifierGetRsp.message) && - Objects.equals(this.requestData, userCustomLoginIdentifierGetRsp.requestData) && - Objects.equals(this.runtime, userCustomLoginIdentifierGetRsp.runtime) && - Objects.equals(this.data, userCustomLoginIdentifierGetRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserCustomLoginIdentifierGetRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserCustomLoginIdentifierGetRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserCustomLoginIdentifierGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserCustomLoginIdentifierGetRsp is not found in the empty JSON string", UserCustomLoginIdentifierGetRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserCustomLoginIdentifierGetRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCustomLoginIdentifierGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserCustomLoginIdentifierGetRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - UserCustomLoginIdentifierGetRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserCustomLoginIdentifierGetRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserCustomLoginIdentifierGetRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserCustomLoginIdentifierGetRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserCustomLoginIdentifierGetRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserCustomLoginIdentifierGetRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserCustomLoginIdentifierGetRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserCustomLoginIdentifierGetRsp - * @throws IOException if the JSON string is invalid with respect to UserCustomLoginIdentifierGetRsp - */ - public static UserCustomLoginIdentifierGetRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserCustomLoginIdentifierGetRsp.class); - } - - /** - * Convert an instance of UserCustomLoginIdentifierGetRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRspAllOfData.java deleted file mode 100644 index 38e53c7..0000000 --- a/src/main/java/com/corbado/generated/model/UserCustomLoginIdentifierGetRspAllOfData.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.CustomLoginIdentifier; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserCustomLoginIdentifierGetRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserCustomLoginIdentifierGetRspAllOfData { - public static final String SERIALIZED_NAME_CUSTOM_LOGIN_IDENTIFIER = "customLoginIdentifier"; - @SerializedName(SERIALIZED_NAME_CUSTOM_LOGIN_IDENTIFIER) - private CustomLoginIdentifier customLoginIdentifier; - - public UserCustomLoginIdentifierGetRspAllOfData() { - } - - public UserCustomLoginIdentifierGetRspAllOfData customLoginIdentifier(CustomLoginIdentifier customLoginIdentifier) { - this.customLoginIdentifier = customLoginIdentifier; - return this; - } - - /** - * Get customLoginIdentifier - * @return customLoginIdentifier - **/ - @javax.annotation.Nonnull - public CustomLoginIdentifier getCustomLoginIdentifier() { - return customLoginIdentifier; - } - - public void setCustomLoginIdentifier(CustomLoginIdentifier customLoginIdentifier) { - this.customLoginIdentifier = customLoginIdentifier; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserCustomLoginIdentifierGetRspAllOfData userCustomLoginIdentifierGetRspAllOfData = (UserCustomLoginIdentifierGetRspAllOfData) o; - return Objects.equals(this.customLoginIdentifier, userCustomLoginIdentifierGetRspAllOfData.customLoginIdentifier); - } - - @Override - public int hashCode() { - return Objects.hash(customLoginIdentifier); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserCustomLoginIdentifierGetRspAllOfData {\n"); - sb.append(" customLoginIdentifier: ").append(toIndentedString(customLoginIdentifier)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("customLoginIdentifier"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("customLoginIdentifier"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserCustomLoginIdentifierGetRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserCustomLoginIdentifierGetRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserCustomLoginIdentifierGetRspAllOfData is not found in the empty JSON string", UserCustomLoginIdentifierGetRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserCustomLoginIdentifierGetRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserCustomLoginIdentifierGetRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserCustomLoginIdentifierGetRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `customLoginIdentifier` - CustomLoginIdentifier.validateJsonElement(jsonObj.get("customLoginIdentifier")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserCustomLoginIdentifierGetRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserCustomLoginIdentifierGetRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserCustomLoginIdentifierGetRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserCustomLoginIdentifierGetRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserCustomLoginIdentifierGetRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserCustomLoginIdentifierGetRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserCustomLoginIdentifierGetRspAllOfData - * @throws IOException if the JSON string is invalid with respect to UserCustomLoginIdentifierGetRspAllOfData - */ - public static UserCustomLoginIdentifierGetRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserCustomLoginIdentifierGetRspAllOfData.class); - } - - /** - * Convert an instance of UserCustomLoginIdentifierGetRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserDeleteReq.java b/src/main/java/com/corbado/generated/model/UserDeleteReq.java deleted file mode 100644 index d5c3975..0000000 --- a/src/main/java/com/corbado/generated/model/UserDeleteReq.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserDeleteReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserDeleteReq { - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public UserDeleteReq() { - } - - public UserDeleteReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public UserDeleteReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserDeleteReq userDeleteReq = (UserDeleteReq) o; - return Objects.equals(this.requestID, userDeleteReq.requestID) && - Objects.equals(this.clientInfo, userDeleteReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserDeleteReq {\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserDeleteReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserDeleteReq is not found in the empty JSON string", UserDeleteReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserDeleteReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserDeleteReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserDeleteReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserDeleteReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserDeleteReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserDeleteReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserDeleteReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserDeleteReq - * @throws IOException if the JSON string is invalid with respect to UserDeleteReq - */ - public static UserDeleteReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserDeleteReq.class); - } - - /** - * Convert an instance of UserDeleteReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserDevice.java b/src/main/java/com/corbado/generated/model/UserDevice.java deleted file mode 100644 index 6ce1af3..0000000 --- a/src/main/java/com/corbado/generated/model/UserDevice.java +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserDevice - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserDevice { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_FINGERPRINT = "fingerprint"; - @SerializedName(SERIALIZED_NAME_FINGERPRINT) - private String fingerprint; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public static final String SERIALIZED_NAME_DEVICE = "device"; - @SerializedName(SERIALIZED_NAME_DEVICE) - private String device; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_BROWSER_NAME = "browserName"; - @SerializedName(SERIALIZED_NAME_BROWSER_NAME) - private String browserName; - - public static final String SERIALIZED_NAME_BROWSER_VERSION = "browserVersion"; - @SerializedName(SERIALIZED_NAME_BROWSER_VERSION) - private String browserVersion; - - public static final String SERIALIZED_NAME_OS_NAME = "osName"; - @SerializedName(SERIALIZED_NAME_OS_NAME) - private String osName; - - public static final String SERIALIZED_NAME_OS_VERSION = "osVersion"; - @SerializedName(SERIALIZED_NAME_OS_VERSION) - private String osVersion; - - public UserDevice() { - } - - public UserDevice name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public UserDevice fingerprint(String fingerprint) { - this.fingerprint = fingerprint; - return this; - } - - /** - * Get fingerprint - * @return fingerprint - **/ - @javax.annotation.Nonnull - public String getFingerprint() { - return fingerprint; - } - - public void setFingerprint(String fingerprint) { - this.fingerprint = fingerprint; - } - - - public UserDevice status(String status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - **/ - @javax.annotation.Nonnull - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - - public UserDevice device(String device) { - this.device = device; - return this; - } - - /** - * Get device - * @return device - **/ - @javax.annotation.Nonnull - public String getDevice() { - return device; - } - - public void setDevice(String device) { - this.device = device; - } - - - public UserDevice created(String created) { - this.created = created; - return this; - } - - /** - * Get created - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public UserDevice browserName(String browserName) { - this.browserName = browserName; - return this; - } - - /** - * Get browserName - * @return browserName - **/ - @javax.annotation.Nonnull - public String getBrowserName() { - return browserName; - } - - public void setBrowserName(String browserName) { - this.browserName = browserName; - } - - - public UserDevice browserVersion(String browserVersion) { - this.browserVersion = browserVersion; - return this; - } - - /** - * Get browserVersion - * @return browserVersion - **/ - @javax.annotation.Nonnull - public String getBrowserVersion() { - return browserVersion; - } - - public void setBrowserVersion(String browserVersion) { - this.browserVersion = browserVersion; - } - - - public UserDevice osName(String osName) { - this.osName = osName; - return this; - } - - /** - * Get osName - * @return osName - **/ - @javax.annotation.Nonnull - public String getOsName() { - return osName; - } - - public void setOsName(String osName) { - this.osName = osName; - } - - - public UserDevice osVersion(String osVersion) { - this.osVersion = osVersion; - return this; - } - - /** - * Get osVersion - * @return osVersion - **/ - @javax.annotation.Nonnull - public String getOsVersion() { - return osVersion; - } - - public void setOsVersion(String osVersion) { - this.osVersion = osVersion; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserDevice userDevice = (UserDevice) o; - return Objects.equals(this.name, userDevice.name) && - Objects.equals(this.fingerprint, userDevice.fingerprint) && - Objects.equals(this.status, userDevice.status) && - Objects.equals(this.device, userDevice.device) && - Objects.equals(this.created, userDevice.created) && - Objects.equals(this.browserName, userDevice.browserName) && - Objects.equals(this.browserVersion, userDevice.browserVersion) && - Objects.equals(this.osName, userDevice.osName) && - Objects.equals(this.osVersion, userDevice.osVersion); - } - - @Override - public int hashCode() { - return Objects.hash(name, fingerprint, status, device, created, browserName, browserVersion, osName, osVersion); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserDevice {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" device: ").append(toIndentedString(device)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" browserName: ").append(toIndentedString(browserName)).append("\n"); - sb.append(" browserVersion: ").append(toIndentedString(browserVersion)).append("\n"); - sb.append(" osName: ").append(toIndentedString(osName)).append("\n"); - sb.append(" osVersion: ").append(toIndentedString(osVersion)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("fingerprint"); - openapiFields.add("status"); - openapiFields.add("device"); - openapiFields.add("created"); - openapiFields.add("browserName"); - openapiFields.add("browserVersion"); - openapiFields.add("osName"); - openapiFields.add("osVersion"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("fingerprint"); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("device"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("browserName"); - openapiRequiredFields.add("browserVersion"); - openapiRequiredFields.add("osName"); - openapiRequiredFields.add("osVersion"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserDevice - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserDevice.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserDevice is not found in the empty JSON string", UserDevice.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserDevice.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserDevice` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserDevice.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("fingerprint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fingerprint").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - if (!jsonObj.get("device").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `device` to be a primitive type in the JSON string but got `%s`", jsonObj.get("device").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("browserName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `browserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("browserName").toString())); - } - if (!jsonObj.get("browserVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `browserVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("browserVersion").toString())); - } - if (!jsonObj.get("osName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `osName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osName").toString())); - } - if (!jsonObj.get("osVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `osVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osVersion").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserDevice.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserDevice' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserDevice.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserDevice value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserDevice read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserDevice given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserDevice - * @throws IOException if the JSON string is invalid with respect to UserDevice - */ - public static UserDevice fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserDevice.class); - } - - /** - * Convert an instance of UserDevice to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserDeviceListRsp.java b/src/main/java/com/corbado/generated/model/UserDeviceListRsp.java deleted file mode 100644 index 4a10311..0000000 --- a/src/main/java/com/corbado/generated/model/UserDeviceListRsp.java +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.UserDevice; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserDeviceListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserDeviceListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DEVICES = "devices"; - @SerializedName(SERIALIZED_NAME_DEVICES) - private List devices = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public UserDeviceListRsp() { - } - - public UserDeviceListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public UserDeviceListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public UserDeviceListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public UserDeviceListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public UserDeviceListRsp devices(List devices) { - this.devices = devices; - return this; - } - - public UserDeviceListRsp addDevicesItem(UserDevice devicesItem) { - if (this.devices == null) { - this.devices = new ArrayList<>(); - } - this.devices.add(devicesItem); - return this; - } - - /** - * Get devices - * @return devices - **/ - @javax.annotation.Nonnull - public List getDevices() { - return devices; - } - - public void setDevices(List devices) { - this.devices = devices; - } - - - public UserDeviceListRsp paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserDeviceListRsp userDeviceListRsp = (UserDeviceListRsp) o; - return Objects.equals(this.httpStatusCode, userDeviceListRsp.httpStatusCode) && - Objects.equals(this.message, userDeviceListRsp.message) && - Objects.equals(this.requestData, userDeviceListRsp.requestData) && - Objects.equals(this.runtime, userDeviceListRsp.runtime) && - Objects.equals(this.devices, userDeviceListRsp.devices) && - Objects.equals(this.paging, userDeviceListRsp.paging); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, devices, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserDeviceListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" devices: ").append(toIndentedString(devices)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("devices"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("devices"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserDeviceListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserDeviceListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserDeviceListRsp is not found in the empty JSON string", UserDeviceListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserDeviceListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserDeviceListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserDeviceListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // ensure the json data is an array - if (!jsonObj.get("devices").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `devices` to be an array in the JSON string but got `%s`", jsonObj.get("devices").toString())); - } - - JsonArray jsonArraydevices = jsonObj.getAsJsonArray("devices"); - // validate the required field `devices` (array) - for (int i = 0; i < jsonArraydevices.size(); i++) { - UserDevice.validateJsonElement(jsonArraydevices.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserDeviceListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserDeviceListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserDeviceListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserDeviceListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserDeviceListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserDeviceListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserDeviceListRsp - * @throws IOException if the JSON string is invalid with respect to UserDeviceListRsp - */ - public static UserDeviceListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserDeviceListRsp.class); - } - - /** - * Convert an instance of UserDeviceListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserEmail.java b/src/main/java/com/corbado/generated/model/UserEmail.java deleted file mode 100644 index 966f1a3..0000000 --- a/src/main/java/com/corbado/generated/model/UserEmail.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Status; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * User's email - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserEmail { - public static final String SERIALIZED_NAME_I_D = "ID"; - @SerializedName(SERIALIZED_NAME_I_D) - private String ID; - - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private Status status; - - public UserEmail() { - } - - public UserEmail ID(String ID) { - this.ID = ID; - return this; - } - - /** - * generic ID - * @return ID - **/ - @javax.annotation.Nonnull - public String getID() { - return ID; - } - - public void setID(String ID) { - this.ID = ID; - } - - - public UserEmail email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - **/ - @javax.annotation.Nonnull - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - - public UserEmail created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public UserEmail updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - public UserEmail status(Status status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - **/ - @javax.annotation.Nonnull - public Status getStatus() { - return status; - } - - public void setStatus(Status status) { - this.status = status; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserEmail userEmail = (UserEmail) o; - return Objects.equals(this.ID, userEmail.ID) && - Objects.equals(this.email, userEmail.email) && - Objects.equals(this.created, userEmail.created) && - Objects.equals(this.updated, userEmail.updated) && - Objects.equals(this.status, userEmail.status); - } - - @Override - public int hashCode() { - return Objects.hash(ID, email, created, updated, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserEmail {\n"); - sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ID"); - openapiFields.add("email"); - openapiFields.add("created"); - openapiFields.add("updated"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("ID"); - openapiRequiredFields.add("email"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserEmail - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserEmail.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserEmail is not found in the empty JSON string", UserEmail.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserEmail.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserEmail` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserEmail.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("ID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); - } - if (!jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - // validate the required field `status` - Status.validateJsonElement(jsonObj.get("status")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserEmail.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserEmail' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserEmail.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserEmail value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserEmail read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserEmail given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserEmail - * @throws IOException if the JSON string is invalid with respect to UserEmail - */ - public static UserEmail fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserEmail.class); - } - - /** - * Convert an instance of UserEmail to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserEmailCreateReq.java b/src/main/java/com/corbado/generated/model/UserEmailCreateReq.java deleted file mode 100644 index 220de9d..0000000 --- a/src/main/java/com/corbado/generated/model/UserEmailCreateReq.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserEmailCreateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserEmailCreateReq { - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public UserEmailCreateReq() { - } - - public UserEmailCreateReq email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - **/ - @javax.annotation.Nonnull - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - - public UserEmailCreateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public UserEmailCreateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserEmailCreateReq userEmailCreateReq = (UserEmailCreateReq) o; - return Objects.equals(this.email, userEmailCreateReq.email) && - Objects.equals(this.requestID, userEmailCreateReq.requestID) && - Objects.equals(this.clientInfo, userEmailCreateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(email, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserEmailCreateReq {\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("email"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("email"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserEmailCreateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserEmailCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserEmailCreateReq is not found in the empty JSON string", UserEmailCreateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserEmailCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserEmailCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserEmailCreateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserEmailCreateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserEmailCreateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserEmailCreateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserEmailCreateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserEmailCreateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserEmailCreateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserEmailCreateReq - * @throws IOException if the JSON string is invalid with respect to UserEmailCreateReq - */ - public static UserEmailCreateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserEmailCreateReq.class); - } - - /** - * Convert an instance of UserEmailCreateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserEmailCreateRsp.java b/src/main/java/com/corbado/generated/model/UserEmailCreateRsp.java deleted file mode 100644 index 3318f0e..0000000 --- a/src/main/java/com/corbado/generated/model/UserEmailCreateRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.UserEmailCreateRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserEmailCreateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserEmailCreateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private UserEmailCreateRspAllOfData data; - - public UserEmailCreateRsp() { - } - - public UserEmailCreateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public UserEmailCreateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public UserEmailCreateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public UserEmailCreateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public UserEmailCreateRsp data(UserEmailCreateRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public UserEmailCreateRspAllOfData getData() { - return data; - } - - public void setData(UserEmailCreateRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserEmailCreateRsp userEmailCreateRsp = (UserEmailCreateRsp) o; - return Objects.equals(this.httpStatusCode, userEmailCreateRsp.httpStatusCode) && - Objects.equals(this.message, userEmailCreateRsp.message) && - Objects.equals(this.requestData, userEmailCreateRsp.requestData) && - Objects.equals(this.runtime, userEmailCreateRsp.runtime) && - Objects.equals(this.data, userEmailCreateRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserEmailCreateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserEmailCreateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserEmailCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserEmailCreateRsp is not found in the empty JSON string", UserEmailCreateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserEmailCreateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserEmailCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserEmailCreateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - UserEmailCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserEmailCreateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserEmailCreateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserEmailCreateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserEmailCreateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserEmailCreateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserEmailCreateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserEmailCreateRsp - * @throws IOException if the JSON string is invalid with respect to UserEmailCreateRsp - */ - public static UserEmailCreateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserEmailCreateRsp.class); - } - - /** - * Convert an instance of UserEmailCreateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserEmailCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserEmailCreateRspAllOfData.java deleted file mode 100644 index 317dc9f..0000000 --- a/src/main/java/com/corbado/generated/model/UserEmailCreateRspAllOfData.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserEmailCreateRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserEmailCreateRspAllOfData { - public static final String SERIALIZED_NAME_EMAIL_I_D = "emailID"; - @SerializedName(SERIALIZED_NAME_EMAIL_I_D) - private String emailID; - - public UserEmailCreateRspAllOfData() { - } - - public UserEmailCreateRspAllOfData emailID(String emailID) { - this.emailID = emailID; - return this; - } - - /** - * Get emailID - * @return emailID - **/ - @javax.annotation.Nonnull - public String getEmailID() { - return emailID; - } - - public void setEmailID(String emailID) { - this.emailID = emailID; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserEmailCreateRspAllOfData userEmailCreateRspAllOfData = (UserEmailCreateRspAllOfData) o; - return Objects.equals(this.emailID, userEmailCreateRspAllOfData.emailID); - } - - @Override - public int hashCode() { - return Objects.hash(emailID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserEmailCreateRspAllOfData {\n"); - sb.append(" emailID: ").append(toIndentedString(emailID)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("emailID"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("emailID"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserEmailCreateRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserEmailCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserEmailCreateRspAllOfData is not found in the empty JSON string", UserEmailCreateRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserEmailCreateRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserEmailCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserEmailCreateRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("emailID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `emailID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailID").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserEmailCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserEmailCreateRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserEmailCreateRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserEmailCreateRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserEmailCreateRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserEmailCreateRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserEmailCreateRspAllOfData - * @throws IOException if the JSON string is invalid with respect to UserEmailCreateRspAllOfData - */ - public static UserEmailCreateRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserEmailCreateRspAllOfData.class); - } - - /** - * Convert an instance of UserEmailCreateRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserEmailDeleteReq.java b/src/main/java/com/corbado/generated/model/UserEmailDeleteReq.java deleted file mode 100644 index e5b4047..0000000 --- a/src/main/java/com/corbado/generated/model/UserEmailDeleteReq.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserEmailDeleteReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserEmailDeleteReq { - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public UserEmailDeleteReq() { - } - - public UserEmailDeleteReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public UserEmailDeleteReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserEmailDeleteReq userEmailDeleteReq = (UserEmailDeleteReq) o; - return Objects.equals(this.requestID, userEmailDeleteReq.requestID) && - Objects.equals(this.clientInfo, userEmailDeleteReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserEmailDeleteReq {\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserEmailDeleteReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserEmailDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserEmailDeleteReq is not found in the empty JSON string", UserEmailDeleteReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserEmailDeleteReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserEmailDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserEmailDeleteReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserEmailDeleteReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserEmailDeleteReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserEmailDeleteReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserEmailDeleteReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserEmailDeleteReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserEmailDeleteReq - * @throws IOException if the JSON string is invalid with respect to UserEmailDeleteReq - */ - public static UserEmailDeleteReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserEmailDeleteReq.class); - } - - /** - * Convert an instance of UserEmailDeleteReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserEmailGetRsp.java b/src/main/java/com/corbado/generated/model/UserEmailGetRsp.java deleted file mode 100644 index 3e25513..0000000 --- a/src/main/java/com/corbado/generated/model/UserEmailGetRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.UserEmailGetRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserEmailGetRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserEmailGetRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private UserEmailGetRspAllOfData data; - - public UserEmailGetRsp() { - } - - public UserEmailGetRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public UserEmailGetRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public UserEmailGetRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public UserEmailGetRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public UserEmailGetRsp data(UserEmailGetRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public UserEmailGetRspAllOfData getData() { - return data; - } - - public void setData(UserEmailGetRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserEmailGetRsp userEmailGetRsp = (UserEmailGetRsp) o; - return Objects.equals(this.httpStatusCode, userEmailGetRsp.httpStatusCode) && - Objects.equals(this.message, userEmailGetRsp.message) && - Objects.equals(this.requestData, userEmailGetRsp.requestData) && - Objects.equals(this.runtime, userEmailGetRsp.runtime) && - Objects.equals(this.data, userEmailGetRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserEmailGetRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserEmailGetRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserEmailGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserEmailGetRsp is not found in the empty JSON string", UserEmailGetRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserEmailGetRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserEmailGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserEmailGetRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - UserEmailGetRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserEmailGetRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserEmailGetRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserEmailGetRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserEmailGetRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserEmailGetRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserEmailGetRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserEmailGetRsp - * @throws IOException if the JSON string is invalid with respect to UserEmailGetRsp - */ - public static UserEmailGetRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserEmailGetRsp.class); - } - - /** - * Convert an instance of UserEmailGetRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserEmailGetRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserEmailGetRspAllOfData.java deleted file mode 100644 index 2639a4b..0000000 --- a/src/main/java/com/corbado/generated/model/UserEmailGetRspAllOfData.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Email; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserEmailGetRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserEmailGetRspAllOfData { - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private Email email; - - public UserEmailGetRspAllOfData() { - } - - public UserEmailGetRspAllOfData email(Email email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - **/ - @javax.annotation.Nonnull - public Email getEmail() { - return email; - } - - public void setEmail(Email email) { - this.email = email; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserEmailGetRspAllOfData userEmailGetRspAllOfData = (UserEmailGetRspAllOfData) o; - return Objects.equals(this.email, userEmailGetRspAllOfData.email); - } - - @Override - public int hashCode() { - return Objects.hash(email); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserEmailGetRspAllOfData {\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("email"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("email"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserEmailGetRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserEmailGetRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserEmailGetRspAllOfData is not found in the empty JSON string", UserEmailGetRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserEmailGetRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserEmailGetRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserEmailGetRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `email` - Email.validateJsonElement(jsonObj.get("email")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserEmailGetRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserEmailGetRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserEmailGetRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserEmailGetRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserEmailGetRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserEmailGetRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserEmailGetRspAllOfData - * @throws IOException if the JSON string is invalid with respect to UserEmailGetRspAllOfData - */ - public static UserEmailGetRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserEmailGetRspAllOfData.class); - } - - /** - * Convert an instance of UserEmailGetRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserExistsReq.java b/src/main/java/com/corbado/generated/model/UserExistsReq.java deleted file mode 100644 index 99f53eb..0000000 --- a/src/main/java/com/corbado/generated/model/UserExistsReq.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.corbado.generated.model.LoginIdentifierType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserExistsReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserExistsReq { - public static final String SERIALIZED_NAME_LOGIN_IDENTIFIER = "loginIdentifier"; - @SerializedName(SERIALIZED_NAME_LOGIN_IDENTIFIER) - private String loginIdentifier; - - public static final String SERIALIZED_NAME_LOGIN_IDENTIFIER_TYPE = "loginIdentifierType"; - @SerializedName(SERIALIZED_NAME_LOGIN_IDENTIFIER_TYPE) - private LoginIdentifierType loginIdentifierType; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public UserExistsReq() { - } - - public UserExistsReq loginIdentifier(String loginIdentifier) { - this.loginIdentifier = loginIdentifier; - return this; - } - - /** - * Get loginIdentifier - * @return loginIdentifier - **/ - @javax.annotation.Nonnull - public String getLoginIdentifier() { - return loginIdentifier; - } - - public void setLoginIdentifier(String loginIdentifier) { - this.loginIdentifier = loginIdentifier; - } - - - public UserExistsReq loginIdentifierType(LoginIdentifierType loginIdentifierType) { - this.loginIdentifierType = loginIdentifierType; - return this; - } - - /** - * Get loginIdentifierType - * @return loginIdentifierType - **/ - @javax.annotation.Nonnull - public LoginIdentifierType getLoginIdentifierType() { - return loginIdentifierType; - } - - public void setLoginIdentifierType(LoginIdentifierType loginIdentifierType) { - this.loginIdentifierType = loginIdentifierType; - } - - - public UserExistsReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public UserExistsReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserExistsReq userExistsReq = (UserExistsReq) o; - return Objects.equals(this.loginIdentifier, userExistsReq.loginIdentifier) && - Objects.equals(this.loginIdentifierType, userExistsReq.loginIdentifierType) && - Objects.equals(this.requestID, userExistsReq.requestID) && - Objects.equals(this.clientInfo, userExistsReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(loginIdentifier, loginIdentifierType, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserExistsReq {\n"); - sb.append(" loginIdentifier: ").append(toIndentedString(loginIdentifier)).append("\n"); - sb.append(" loginIdentifierType: ").append(toIndentedString(loginIdentifierType)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("loginIdentifier"); - openapiFields.add("loginIdentifierType"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("loginIdentifier"); - openapiRequiredFields.add("loginIdentifierType"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserExistsReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserExistsReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserExistsReq is not found in the empty JSON string", UserExistsReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserExistsReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserExistsReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserExistsReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("loginIdentifier").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `loginIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginIdentifier").toString())); - } - // validate the required field `loginIdentifierType` - LoginIdentifierType.validateJsonElement(jsonObj.get("loginIdentifierType")); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserExistsReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserExistsReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserExistsReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserExistsReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserExistsReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserExistsReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserExistsReq - * @throws IOException if the JSON string is invalid with respect to UserExistsReq - */ - public static UserExistsReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserExistsReq.class); - } - - /** - * Convert an instance of UserExistsReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserExistsRsp.java b/src/main/java/com/corbado/generated/model/UserExistsRsp.java deleted file mode 100644 index a7d9548..0000000 --- a/src/main/java/com/corbado/generated/model/UserExistsRsp.java +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserExistsRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserExistsRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_EXISTS = "exists"; - @SerializedName(SERIALIZED_NAME_EXISTS) - private Boolean exists; - - public UserExistsRsp() { - } - - public UserExistsRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public UserExistsRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public UserExistsRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public UserExistsRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public UserExistsRsp exists(Boolean exists) { - this.exists = exists; - return this; - } - - /** - * Get exists - * @return exists - **/ - @javax.annotation.Nonnull - public Boolean getExists() { - return exists; - } - - public void setExists(Boolean exists) { - this.exists = exists; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserExistsRsp userExistsRsp = (UserExistsRsp) o; - return Objects.equals(this.httpStatusCode, userExistsRsp.httpStatusCode) && - Objects.equals(this.message, userExistsRsp.message) && - Objects.equals(this.requestData, userExistsRsp.requestData) && - Objects.equals(this.runtime, userExistsRsp.runtime) && - Objects.equals(this.exists, userExistsRsp.exists); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, exists); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserExistsRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" exists: ").append(toIndentedString(exists)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("exists"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("exists"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserExistsRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserExistsRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserExistsRsp is not found in the empty JSON string", UserExistsRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserExistsRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserExistsRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserExistsRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserExistsRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserExistsRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserExistsRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserExistsRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserExistsRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserExistsRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserExistsRsp - * @throws IOException if the JSON string is invalid with respect to UserExistsRsp - */ - public static UserExistsRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserExistsRsp.class); - } - - /** - * Convert an instance of UserExistsRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserGetRsp.java b/src/main/java/com/corbado/generated/model/UserGetRsp.java deleted file mode 100644 index fa6d3cc..0000000 --- a/src/main/java/com/corbado/generated/model/UserGetRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.FullUser; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserGetRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserGetRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private FullUser data; - - public UserGetRsp() { - } - - public UserGetRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public UserGetRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public UserGetRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public UserGetRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public UserGetRsp data(FullUser data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public FullUser getData() { - return data; - } - - public void setData(FullUser data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserGetRsp userGetRsp = (UserGetRsp) o; - return Objects.equals(this.httpStatusCode, userGetRsp.httpStatusCode) && - Objects.equals(this.message, userGetRsp.message) && - Objects.equals(this.requestData, userGetRsp.requestData) && - Objects.equals(this.runtime, userGetRsp.runtime) && - Objects.equals(this.data, userGetRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserGetRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserGetRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserGetRsp is not found in the empty JSON string", UserGetRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserGetRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserGetRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - FullUser.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserGetRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserGetRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserGetRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserGetRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserGetRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserGetRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserGetRsp - * @throws IOException if the JSON string is invalid with respect to UserGetRsp - */ - public static UserGetRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserGetRsp.class); - } - - /** - * Convert an instance of UserGetRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserListRsp.java b/src/main/java/com/corbado/generated/model/UserListRsp.java deleted file mode 100644 index a8ad760..0000000 --- a/src/main/java/com/corbado/generated/model/UserListRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.UserListRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private UserListRspAllOfData data; - - public UserListRsp() { - } - - public UserListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public UserListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public UserListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public UserListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public UserListRsp data(UserListRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public UserListRspAllOfData getData() { - return data; - } - - public void setData(UserListRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserListRsp userListRsp = (UserListRsp) o; - return Objects.equals(this.httpStatusCode, userListRsp.httpStatusCode) && - Objects.equals(this.message, userListRsp.message) && - Objects.equals(this.requestData, userListRsp.requestData) && - Objects.equals(this.runtime, userListRsp.runtime) && - Objects.equals(this.data, userListRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserListRsp is not found in the empty JSON string", UserListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - UserListRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserListRsp - * @throws IOException if the JSON string is invalid with respect to UserListRsp - */ - public static UserListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserListRsp.class); - } - - /** - * Convert an instance of UserListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserListRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserListRspAllOfData.java deleted file mode 100644 index 560f5db..0000000 --- a/src/main/java/com/corbado/generated/model/UserListRspAllOfData.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.FullUser; -import com.corbado.generated.model.Paging; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserListRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserListRspAllOfData { - public static final String SERIALIZED_NAME_USERS = "users"; - @SerializedName(SERIALIZED_NAME_USERS) - private List users = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public UserListRspAllOfData() { - } - - public UserListRspAllOfData users(List users) { - this.users = users; - return this; - } - - public UserListRspAllOfData addUsersItem(FullUser usersItem) { - if (this.users == null) { - this.users = new ArrayList<>(); - } - this.users.add(usersItem); - return this; - } - - /** - * Get users - * @return users - **/ - @javax.annotation.Nonnull - public List getUsers() { - return users; - } - - public void setUsers(List users) { - this.users = users; - } - - - public UserListRspAllOfData paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserListRspAllOfData userListRspAllOfData = (UserListRspAllOfData) o; - return Objects.equals(this.users, userListRspAllOfData.users) && - Objects.equals(this.paging, userListRspAllOfData.paging); - } - - @Override - public int hashCode() { - return Objects.hash(users, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserListRspAllOfData {\n"); - sb.append(" users: ").append(toIndentedString(users)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("users"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("users"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserListRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserListRspAllOfData is not found in the empty JSON string", UserListRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserListRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserListRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("users").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `users` to be an array in the JSON string but got `%s`", jsonObj.get("users").toString())); - } - - JsonArray jsonArrayusers = jsonObj.getAsJsonArray("users"); - // validate the required field `users` (array) - for (int i = 0; i < jsonArrayusers.size(); i++) { - FullUser.validateJsonElement(jsonArrayusers.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserListRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserListRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserListRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserListRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserListRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserListRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserListRspAllOfData - * @throws IOException if the JSON string is invalid with respect to UserListRspAllOfData - */ - public static UserListRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserListRspAllOfData.class); - } - - /** - * Convert an instance of UserListRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserPhoneNumber.java b/src/main/java/com/corbado/generated/model/UserPhoneNumber.java deleted file mode 100644 index d60154a..0000000 --- a/src/main/java/com/corbado/generated/model/UserPhoneNumber.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Status; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * User's phone number - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserPhoneNumber { - public static final String SERIALIZED_NAME_I_D = "ID"; - @SerializedName(SERIALIZED_NAME_I_D) - private String ID; - - public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; - @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) - private String phoneNumber; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private Status status; - - public UserPhoneNumber() { - } - - public UserPhoneNumber ID(String ID) { - this.ID = ID; - return this; - } - - /** - * generic ID - * @return ID - **/ - @javax.annotation.Nonnull - public String getID() { - return ID; - } - - public void setID(String ID) { - this.ID = ID; - } - - - public UserPhoneNumber phoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - /** - * Get phoneNumber - * @return phoneNumber - **/ - @javax.annotation.Nonnull - public String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - - - public UserPhoneNumber created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public UserPhoneNumber updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - public UserPhoneNumber status(Status status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - **/ - @javax.annotation.Nonnull - public Status getStatus() { - return status; - } - - public void setStatus(Status status) { - this.status = status; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserPhoneNumber userPhoneNumber = (UserPhoneNumber) o; - return Objects.equals(this.ID, userPhoneNumber.ID) && - Objects.equals(this.phoneNumber, userPhoneNumber.phoneNumber) && - Objects.equals(this.created, userPhoneNumber.created) && - Objects.equals(this.updated, userPhoneNumber.updated) && - Objects.equals(this.status, userPhoneNumber.status); - } - - @Override - public int hashCode() { - return Objects.hash(ID, phoneNumber, created, updated, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserPhoneNumber {\n"); - sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); - sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ID"); - openapiFields.add("phoneNumber"); - openapiFields.add("created"); - openapiFields.add("updated"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("ID"); - openapiRequiredFields.add("phoneNumber"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserPhoneNumber - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserPhoneNumber.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserPhoneNumber is not found in the empty JSON string", UserPhoneNumber.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserPhoneNumber.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserPhoneNumber` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserPhoneNumber.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("ID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); - } - if (!jsonObj.get("phoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - // validate the required field `status` - Status.validateJsonElement(jsonObj.get("status")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserPhoneNumber.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserPhoneNumber' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserPhoneNumber.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserPhoneNumber value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserPhoneNumber read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserPhoneNumber given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserPhoneNumber - * @throws IOException if the JSON string is invalid with respect to UserPhoneNumber - */ - public static UserPhoneNumber fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserPhoneNumber.class); - } - - /** - * Convert an instance of UserPhoneNumber to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateReq.java b/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateReq.java deleted file mode 100644 index a7a4b89..0000000 --- a/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateReq.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserPhoneNumberCreateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserPhoneNumberCreateReq { - public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; - @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) - private String phoneNumber; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public UserPhoneNumberCreateReq() { - } - - public UserPhoneNumberCreateReq phoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - /** - * Get phoneNumber - * @return phoneNumber - **/ - @javax.annotation.Nonnull - public String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - - - public UserPhoneNumberCreateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public UserPhoneNumberCreateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserPhoneNumberCreateReq userPhoneNumberCreateReq = (UserPhoneNumberCreateReq) o; - return Objects.equals(this.phoneNumber, userPhoneNumberCreateReq.phoneNumber) && - Objects.equals(this.requestID, userPhoneNumberCreateReq.requestID) && - Objects.equals(this.clientInfo, userPhoneNumberCreateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(phoneNumber, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserPhoneNumberCreateReq {\n"); - sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("phoneNumber"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("phoneNumber"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserPhoneNumberCreateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserPhoneNumberCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserPhoneNumberCreateReq is not found in the empty JSON string", UserPhoneNumberCreateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserPhoneNumberCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserPhoneNumberCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserPhoneNumberCreateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("phoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserPhoneNumberCreateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserPhoneNumberCreateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserPhoneNumberCreateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserPhoneNumberCreateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserPhoneNumberCreateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserPhoneNumberCreateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserPhoneNumberCreateReq - * @throws IOException if the JSON string is invalid with respect to UserPhoneNumberCreateReq - */ - public static UserPhoneNumberCreateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserPhoneNumberCreateReq.class); - } - - /** - * Convert an instance of UserPhoneNumberCreateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRsp.java b/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRsp.java deleted file mode 100644 index 4ce19a6..0000000 --- a/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.UserPhoneNumberCreateRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserPhoneNumberCreateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserPhoneNumberCreateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private UserPhoneNumberCreateRspAllOfData data; - - public UserPhoneNumberCreateRsp() { - } - - public UserPhoneNumberCreateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public UserPhoneNumberCreateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public UserPhoneNumberCreateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public UserPhoneNumberCreateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public UserPhoneNumberCreateRsp data(UserPhoneNumberCreateRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public UserPhoneNumberCreateRspAllOfData getData() { - return data; - } - - public void setData(UserPhoneNumberCreateRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserPhoneNumberCreateRsp userPhoneNumberCreateRsp = (UserPhoneNumberCreateRsp) o; - return Objects.equals(this.httpStatusCode, userPhoneNumberCreateRsp.httpStatusCode) && - Objects.equals(this.message, userPhoneNumberCreateRsp.message) && - Objects.equals(this.requestData, userPhoneNumberCreateRsp.requestData) && - Objects.equals(this.runtime, userPhoneNumberCreateRsp.runtime) && - Objects.equals(this.data, userPhoneNumberCreateRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserPhoneNumberCreateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserPhoneNumberCreateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserPhoneNumberCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserPhoneNumberCreateRsp is not found in the empty JSON string", UserPhoneNumberCreateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserPhoneNumberCreateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserPhoneNumberCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserPhoneNumberCreateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - UserPhoneNumberCreateRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserPhoneNumberCreateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserPhoneNumberCreateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserPhoneNumberCreateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserPhoneNumberCreateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserPhoneNumberCreateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserPhoneNumberCreateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserPhoneNumberCreateRsp - * @throws IOException if the JSON string is invalid with respect to UserPhoneNumberCreateRsp - */ - public static UserPhoneNumberCreateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserPhoneNumberCreateRsp.class); - } - - /** - * Convert an instance of UserPhoneNumberCreateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRspAllOfData.java deleted file mode 100644 index 4388bd9..0000000 --- a/src/main/java/com/corbado/generated/model/UserPhoneNumberCreateRspAllOfData.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserPhoneNumberCreateRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserPhoneNumberCreateRspAllOfData { - public static final String SERIALIZED_NAME_PHONE_NUMBER_I_D = "phoneNumberID"; - @SerializedName(SERIALIZED_NAME_PHONE_NUMBER_I_D) - private String phoneNumberID; - - public UserPhoneNumberCreateRspAllOfData() { - } - - public UserPhoneNumberCreateRspAllOfData phoneNumberID(String phoneNumberID) { - this.phoneNumberID = phoneNumberID; - return this; - } - - /** - * Get phoneNumberID - * @return phoneNumberID - **/ - @javax.annotation.Nonnull - public String getPhoneNumberID() { - return phoneNumberID; - } - - public void setPhoneNumberID(String phoneNumberID) { - this.phoneNumberID = phoneNumberID; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserPhoneNumberCreateRspAllOfData userPhoneNumberCreateRspAllOfData = (UserPhoneNumberCreateRspAllOfData) o; - return Objects.equals(this.phoneNumberID, userPhoneNumberCreateRspAllOfData.phoneNumberID); - } - - @Override - public int hashCode() { - return Objects.hash(phoneNumberID); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserPhoneNumberCreateRspAllOfData {\n"); - sb.append(" phoneNumberID: ").append(toIndentedString(phoneNumberID)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("phoneNumberID"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("phoneNumberID"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserPhoneNumberCreateRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserPhoneNumberCreateRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserPhoneNumberCreateRspAllOfData is not found in the empty JSON string", UserPhoneNumberCreateRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserPhoneNumberCreateRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserPhoneNumberCreateRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserPhoneNumberCreateRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("phoneNumberID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `phoneNumberID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumberID").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserPhoneNumberCreateRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserPhoneNumberCreateRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserPhoneNumberCreateRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserPhoneNumberCreateRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserPhoneNumberCreateRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserPhoneNumberCreateRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserPhoneNumberCreateRspAllOfData - * @throws IOException if the JSON string is invalid with respect to UserPhoneNumberCreateRspAllOfData - */ - public static UserPhoneNumberCreateRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserPhoneNumberCreateRspAllOfData.class); - } - - /** - * Convert an instance of UserPhoneNumberCreateRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserPhoneNumberDeleteReq.java b/src/main/java/com/corbado/generated/model/UserPhoneNumberDeleteReq.java deleted file mode 100644 index a5265bd..0000000 --- a/src/main/java/com/corbado/generated/model/UserPhoneNumberDeleteReq.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserPhoneNumberDeleteReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserPhoneNumberDeleteReq { - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public UserPhoneNumberDeleteReq() { - } - - public UserPhoneNumberDeleteReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public UserPhoneNumberDeleteReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserPhoneNumberDeleteReq userPhoneNumberDeleteReq = (UserPhoneNumberDeleteReq) o; - return Objects.equals(this.requestID, userPhoneNumberDeleteReq.requestID) && - Objects.equals(this.clientInfo, userPhoneNumberDeleteReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserPhoneNumberDeleteReq {\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserPhoneNumberDeleteReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserPhoneNumberDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserPhoneNumberDeleteReq is not found in the empty JSON string", UserPhoneNumberDeleteReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserPhoneNumberDeleteReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserPhoneNumberDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserPhoneNumberDeleteReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserPhoneNumberDeleteReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserPhoneNumberDeleteReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserPhoneNumberDeleteReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserPhoneNumberDeleteReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserPhoneNumberDeleteReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserPhoneNumberDeleteReq - * @throws IOException if the JSON string is invalid with respect to UserPhoneNumberDeleteReq - */ - public static UserPhoneNumberDeleteReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserPhoneNumberDeleteReq.class); - } - - /** - * Convert an instance of UserPhoneNumberDeleteReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserPhoneNumberGetRsp.java b/src/main/java/com/corbado/generated/model/UserPhoneNumberGetRsp.java deleted file mode 100644 index eb27924..0000000 --- a/src/main/java/com/corbado/generated/model/UserPhoneNumberGetRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.UserPhoneNumberGetRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserPhoneNumberGetRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserPhoneNumberGetRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private UserPhoneNumberGetRspAllOfData data; - - public UserPhoneNumberGetRsp() { - } - - public UserPhoneNumberGetRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public UserPhoneNumberGetRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public UserPhoneNumberGetRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public UserPhoneNumberGetRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public UserPhoneNumberGetRsp data(UserPhoneNumberGetRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public UserPhoneNumberGetRspAllOfData getData() { - return data; - } - - public void setData(UserPhoneNumberGetRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserPhoneNumberGetRsp userPhoneNumberGetRsp = (UserPhoneNumberGetRsp) o; - return Objects.equals(this.httpStatusCode, userPhoneNumberGetRsp.httpStatusCode) && - Objects.equals(this.message, userPhoneNumberGetRsp.message) && - Objects.equals(this.requestData, userPhoneNumberGetRsp.requestData) && - Objects.equals(this.runtime, userPhoneNumberGetRsp.runtime) && - Objects.equals(this.data, userPhoneNumberGetRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserPhoneNumberGetRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserPhoneNumberGetRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserPhoneNumberGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserPhoneNumberGetRsp is not found in the empty JSON string", UserPhoneNumberGetRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserPhoneNumberGetRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserPhoneNumberGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserPhoneNumberGetRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - UserPhoneNumberGetRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserPhoneNumberGetRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserPhoneNumberGetRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserPhoneNumberGetRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserPhoneNumberGetRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserPhoneNumberGetRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserPhoneNumberGetRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserPhoneNumberGetRsp - * @throws IOException if the JSON string is invalid with respect to UserPhoneNumberGetRsp - */ - public static UserPhoneNumberGetRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserPhoneNumberGetRsp.class); - } - - /** - * Convert an instance of UserPhoneNumberGetRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserPhoneNumberGetRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserPhoneNumberGetRspAllOfData.java deleted file mode 100644 index c44d487..0000000 --- a/src/main/java/com/corbado/generated/model/UserPhoneNumberGetRspAllOfData.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.PhoneNumber; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserPhoneNumberGetRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserPhoneNumberGetRspAllOfData { - public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; - @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) - private PhoneNumber phoneNumber; - - public UserPhoneNumberGetRspAllOfData() { - } - - public UserPhoneNumberGetRspAllOfData phoneNumber(PhoneNumber phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - /** - * Get phoneNumber - * @return phoneNumber - **/ - @javax.annotation.Nonnull - public PhoneNumber getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(PhoneNumber phoneNumber) { - this.phoneNumber = phoneNumber; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserPhoneNumberGetRspAllOfData userPhoneNumberGetRspAllOfData = (UserPhoneNumberGetRspAllOfData) o; - return Objects.equals(this.phoneNumber, userPhoneNumberGetRspAllOfData.phoneNumber); - } - - @Override - public int hashCode() { - return Objects.hash(phoneNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserPhoneNumberGetRspAllOfData {\n"); - sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("phoneNumber"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("phoneNumber"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserPhoneNumberGetRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserPhoneNumberGetRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserPhoneNumberGetRspAllOfData is not found in the empty JSON string", UserPhoneNumberGetRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserPhoneNumberGetRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserPhoneNumberGetRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserPhoneNumberGetRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `phoneNumber` - PhoneNumber.validateJsonElement(jsonObj.get("phoneNumber")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserPhoneNumberGetRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserPhoneNumberGetRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserPhoneNumberGetRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserPhoneNumberGetRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserPhoneNumberGetRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserPhoneNumberGetRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserPhoneNumberGetRspAllOfData - * @throws IOException if the JSON string is invalid with respect to UserPhoneNumberGetRspAllOfData - */ - public static UserPhoneNumberGetRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserPhoneNumberGetRspAllOfData.class); - } - - /** - * Convert an instance of UserPhoneNumberGetRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserSocialAccount.java b/src/main/java/com/corbado/generated/model/UserSocialAccount.java deleted file mode 100644 index 5e945e7..0000000 --- a/src/main/java/com/corbado/generated/model/UserSocialAccount.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.SocialProviderType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * User's social account - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserSocialAccount { - public static final String SERIALIZED_NAME_PROVIDER_TYPE = "providerType"; - @SerializedName(SERIALIZED_NAME_PROVIDER_TYPE) - private SocialProviderType providerType; - - public static final String SERIALIZED_NAME_IDENTIFIER_VALUE = "identifierValue"; - @SerializedName(SERIALIZED_NAME_IDENTIFIER_VALUE) - private String identifierValue; - - public static final String SERIALIZED_NAME_AVATAR_URL = "avatarUrl"; - @SerializedName(SERIALIZED_NAME_AVATAR_URL) - private String avatarUrl; - - public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; - @SerializedName(SERIALIZED_NAME_FULL_NAME) - private String fullName; - - public UserSocialAccount() { - } - - public UserSocialAccount providerType(SocialProviderType providerType) { - this.providerType = providerType; - return this; - } - - /** - * Get providerType - * @return providerType - **/ - @javax.annotation.Nonnull - public SocialProviderType getProviderType() { - return providerType; - } - - public void setProviderType(SocialProviderType providerType) { - this.providerType = providerType; - } - - - public UserSocialAccount identifierValue(String identifierValue) { - this.identifierValue = identifierValue; - return this; - } - - /** - * Get identifierValue - * @return identifierValue - **/ - @javax.annotation.Nonnull - public String getIdentifierValue() { - return identifierValue; - } - - public void setIdentifierValue(String identifierValue) { - this.identifierValue = identifierValue; - } - - - public UserSocialAccount avatarUrl(String avatarUrl) { - this.avatarUrl = avatarUrl; - return this; - } - - /** - * Get avatarUrl - * @return avatarUrl - **/ - @javax.annotation.Nonnull - public String getAvatarUrl() { - return avatarUrl; - } - - public void setAvatarUrl(String avatarUrl) { - this.avatarUrl = avatarUrl; - } - - - public UserSocialAccount fullName(String fullName) { - this.fullName = fullName; - return this; - } - - /** - * Get fullName - * @return fullName - **/ - @javax.annotation.Nonnull - public String getFullName() { - return fullName; - } - - public void setFullName(String fullName) { - this.fullName = fullName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserSocialAccount userSocialAccount = (UserSocialAccount) o; - return Objects.equals(this.providerType, userSocialAccount.providerType) && - Objects.equals(this.identifierValue, userSocialAccount.identifierValue) && - Objects.equals(this.avatarUrl, userSocialAccount.avatarUrl) && - Objects.equals(this.fullName, userSocialAccount.fullName); - } - - @Override - public int hashCode() { - return Objects.hash(providerType, identifierValue, avatarUrl, fullName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserSocialAccount {\n"); - sb.append(" providerType: ").append(toIndentedString(providerType)).append("\n"); - sb.append(" identifierValue: ").append(toIndentedString(identifierValue)).append("\n"); - sb.append(" avatarUrl: ").append(toIndentedString(avatarUrl)).append("\n"); - sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("providerType"); - openapiFields.add("identifierValue"); - openapiFields.add("avatarUrl"); - openapiFields.add("fullName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("providerType"); - openapiRequiredFields.add("identifierValue"); - openapiRequiredFields.add("avatarUrl"); - openapiRequiredFields.add("fullName"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserSocialAccount - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserSocialAccount.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserSocialAccount is not found in the empty JSON string", UserSocialAccount.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserSocialAccount.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserSocialAccount` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserSocialAccount.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // validate the required field `providerType` - SocialProviderType.validateJsonElement(jsonObj.get("providerType")); - if (!jsonObj.get("identifierValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `identifierValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifierValue").toString())); - } - if (!jsonObj.get("avatarUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `avatarUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avatarUrl").toString())); - } - if (!jsonObj.get("fullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserSocialAccount.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserSocialAccount' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserSocialAccount.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserSocialAccount value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserSocialAccount read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserSocialAccount given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserSocialAccount - * @throws IOException if the JSON string is invalid with respect to UserSocialAccount - */ - public static UserSocialAccount fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserSocialAccount.class); - } - - /** - * Convert an instance of UserSocialAccount to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserStats.java b/src/main/java/com/corbado/generated/model/UserStats.java deleted file mode 100644 index a821fe6..0000000 --- a/src/main/java/com/corbado/generated/model/UserStats.java +++ /dev/null @@ -1,430 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserStats - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserStats { - public static final String SERIALIZED_NAME_TIME_POINT = "timePoint"; - @SerializedName(SERIALIZED_NAME_TIME_POINT) - private String timePoint; - - public static final String SERIALIZED_NAME_TOTAL_USERS = "totalUsers"; - @SerializedName(SERIALIZED_NAME_TOTAL_USERS) - private Integer totalUsers; - - public static final String SERIALIZED_NAME_SIGN_UPS = "signUps"; - @SerializedName(SERIALIZED_NAME_SIGN_UPS) - private Integer signUps; - - public static final String SERIALIZED_NAME_ACTIVE_USERS = "activeUsers"; - @SerializedName(SERIALIZED_NAME_ACTIVE_USERS) - private Integer activeUsers; - - public static final String SERIALIZED_NAME_COUNT_PASSKEY_LOGIN = "countPasskeyLogin"; - @SerializedName(SERIALIZED_NAME_COUNT_PASSKEY_LOGIN) - private Integer countPasskeyLogin; - - public static final String SERIALIZED_NAME_COUNT_EMAIL_LOGIN = "countEmailLogin"; - @SerializedName(SERIALIZED_NAME_COUNT_EMAIL_LOGIN) - private Integer countEmailLogin; - - public static final String SERIALIZED_NAME_COUNT_PASSWORD_LOGIN = "countPasswordLogin"; - @SerializedName(SERIALIZED_NAME_COUNT_PASSWORD_LOGIN) - private Integer countPasswordLogin; - - public static final String SERIALIZED_NAME_SUCCESSFUL_LOGINS = "successfulLogins"; - @SerializedName(SERIALIZED_NAME_SUCCESSFUL_LOGINS) - private Integer successfulLogins; - - public static final String SERIALIZED_NAME_FAILED_LOGINS = "failedLogins"; - @SerializedName(SERIALIZED_NAME_FAILED_LOGINS) - private Integer failedLogins; - - public UserStats() { - } - - public UserStats timePoint(String timePoint) { - this.timePoint = timePoint; - return this; - } - - /** - * Get timePoint - * @return timePoint - **/ - @javax.annotation.Nonnull - public String getTimePoint() { - return timePoint; - } - - public void setTimePoint(String timePoint) { - this.timePoint = timePoint; - } - - - public UserStats totalUsers(Integer totalUsers) { - this.totalUsers = totalUsers; - return this; - } - - /** - * Get totalUsers - * @return totalUsers - **/ - @javax.annotation.Nonnull - public Integer getTotalUsers() { - return totalUsers; - } - - public void setTotalUsers(Integer totalUsers) { - this.totalUsers = totalUsers; - } - - - public UserStats signUps(Integer signUps) { - this.signUps = signUps; - return this; - } - - /** - * Get signUps - * @return signUps - **/ - @javax.annotation.Nonnull - public Integer getSignUps() { - return signUps; - } - - public void setSignUps(Integer signUps) { - this.signUps = signUps; - } - - - public UserStats activeUsers(Integer activeUsers) { - this.activeUsers = activeUsers; - return this; - } - - /** - * Get activeUsers - * @return activeUsers - **/ - @javax.annotation.Nonnull - public Integer getActiveUsers() { - return activeUsers; - } - - public void setActiveUsers(Integer activeUsers) { - this.activeUsers = activeUsers; - } - - - public UserStats countPasskeyLogin(Integer countPasskeyLogin) { - this.countPasskeyLogin = countPasskeyLogin; - return this; - } - - /** - * Get countPasskeyLogin - * @return countPasskeyLogin - **/ - @javax.annotation.Nonnull - public Integer getCountPasskeyLogin() { - return countPasskeyLogin; - } - - public void setCountPasskeyLogin(Integer countPasskeyLogin) { - this.countPasskeyLogin = countPasskeyLogin; - } - - - public UserStats countEmailLogin(Integer countEmailLogin) { - this.countEmailLogin = countEmailLogin; - return this; - } - - /** - * Get countEmailLogin - * @return countEmailLogin - **/ - @javax.annotation.Nonnull - public Integer getCountEmailLogin() { - return countEmailLogin; - } - - public void setCountEmailLogin(Integer countEmailLogin) { - this.countEmailLogin = countEmailLogin; - } - - - public UserStats countPasswordLogin(Integer countPasswordLogin) { - this.countPasswordLogin = countPasswordLogin; - return this; - } - - /** - * Get countPasswordLogin - * @return countPasswordLogin - **/ - @javax.annotation.Nonnull - public Integer getCountPasswordLogin() { - return countPasswordLogin; - } - - public void setCountPasswordLogin(Integer countPasswordLogin) { - this.countPasswordLogin = countPasswordLogin; - } - - - public UserStats successfulLogins(Integer successfulLogins) { - this.successfulLogins = successfulLogins; - return this; - } - - /** - * Get successfulLogins - * @return successfulLogins - **/ - @javax.annotation.Nonnull - public Integer getSuccessfulLogins() { - return successfulLogins; - } - - public void setSuccessfulLogins(Integer successfulLogins) { - this.successfulLogins = successfulLogins; - } - - - public UserStats failedLogins(Integer failedLogins) { - this.failedLogins = failedLogins; - return this; - } - - /** - * Get failedLogins - * @return failedLogins - **/ - @javax.annotation.Nonnull - public Integer getFailedLogins() { - return failedLogins; - } - - public void setFailedLogins(Integer failedLogins) { - this.failedLogins = failedLogins; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserStats userStats = (UserStats) o; - return Objects.equals(this.timePoint, userStats.timePoint) && - Objects.equals(this.totalUsers, userStats.totalUsers) && - Objects.equals(this.signUps, userStats.signUps) && - Objects.equals(this.activeUsers, userStats.activeUsers) && - Objects.equals(this.countPasskeyLogin, userStats.countPasskeyLogin) && - Objects.equals(this.countEmailLogin, userStats.countEmailLogin) && - Objects.equals(this.countPasswordLogin, userStats.countPasswordLogin) && - Objects.equals(this.successfulLogins, userStats.successfulLogins) && - Objects.equals(this.failedLogins, userStats.failedLogins); - } - - @Override - public int hashCode() { - return Objects.hash(timePoint, totalUsers, signUps, activeUsers, countPasskeyLogin, countEmailLogin, countPasswordLogin, successfulLogins, failedLogins); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserStats {\n"); - sb.append(" timePoint: ").append(toIndentedString(timePoint)).append("\n"); - sb.append(" totalUsers: ").append(toIndentedString(totalUsers)).append("\n"); - sb.append(" signUps: ").append(toIndentedString(signUps)).append("\n"); - sb.append(" activeUsers: ").append(toIndentedString(activeUsers)).append("\n"); - sb.append(" countPasskeyLogin: ").append(toIndentedString(countPasskeyLogin)).append("\n"); - sb.append(" countEmailLogin: ").append(toIndentedString(countEmailLogin)).append("\n"); - sb.append(" countPasswordLogin: ").append(toIndentedString(countPasswordLogin)).append("\n"); - sb.append(" successfulLogins: ").append(toIndentedString(successfulLogins)).append("\n"); - sb.append(" failedLogins: ").append(toIndentedString(failedLogins)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("timePoint"); - openapiFields.add("totalUsers"); - openapiFields.add("signUps"); - openapiFields.add("activeUsers"); - openapiFields.add("countPasskeyLogin"); - openapiFields.add("countEmailLogin"); - openapiFields.add("countPasswordLogin"); - openapiFields.add("successfulLogins"); - openapiFields.add("failedLogins"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("timePoint"); - openapiRequiredFields.add("totalUsers"); - openapiRequiredFields.add("signUps"); - openapiRequiredFields.add("activeUsers"); - openapiRequiredFields.add("countPasskeyLogin"); - openapiRequiredFields.add("countEmailLogin"); - openapiRequiredFields.add("countPasswordLogin"); - openapiRequiredFields.add("successfulLogins"); - openapiRequiredFields.add("failedLogins"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserStats - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserStats is not found in the empty JSON string", UserStats.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserStats.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserStats` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserStats.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("timePoint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timePoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timePoint").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserStats.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserStats' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserStats.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserStats value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserStats read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserStats given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserStats - * @throws IOException if the JSON string is invalid with respect to UserStats - */ - public static UserStats fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserStats.class); - } - - /** - * Convert an instance of UserStats to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserStatsListRsp.java b/src/main/java/com/corbado/generated/model/UserStatsListRsp.java deleted file mode 100644 index c0ab5d5..0000000 --- a/src/main/java/com/corbado/generated/model/UserStatsListRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.UserStatsListRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserStatsListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserStatsListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private UserStatsListRspAllOfData data; - - public UserStatsListRsp() { - } - - public UserStatsListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public UserStatsListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public UserStatsListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public UserStatsListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public UserStatsListRsp data(UserStatsListRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public UserStatsListRspAllOfData getData() { - return data; - } - - public void setData(UserStatsListRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserStatsListRsp userStatsListRsp = (UserStatsListRsp) o; - return Objects.equals(this.httpStatusCode, userStatsListRsp.httpStatusCode) && - Objects.equals(this.message, userStatsListRsp.message) && - Objects.equals(this.requestData, userStatsListRsp.requestData) && - Objects.equals(this.runtime, userStatsListRsp.runtime) && - Objects.equals(this.data, userStatsListRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserStatsListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserStatsListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserStatsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserStatsListRsp is not found in the empty JSON string", UserStatsListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserStatsListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserStatsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserStatsListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - UserStatsListRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserStatsListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserStatsListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserStatsListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserStatsListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserStatsListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserStatsListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserStatsListRsp - * @throws IOException if the JSON string is invalid with respect to UserStatsListRsp - */ - public static UserStatsListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserStatsListRsp.class); - } - - /** - * Convert an instance of UserStatsListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserStatsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/UserStatsListRspAllOfData.java deleted file mode 100644 index fa26939..0000000 --- a/src/main/java/com/corbado/generated/model/UserStatsListRspAllOfData.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.UserStats; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserStatsListRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserStatsListRspAllOfData { - public static final String SERIALIZED_NAME_STATS = "stats"; - @SerializedName(SERIALIZED_NAME_STATS) - private List stats = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public UserStatsListRspAllOfData() { - } - - public UserStatsListRspAllOfData stats(List stats) { - this.stats = stats; - return this; - } - - public UserStatsListRspAllOfData addStatsItem(UserStats statsItem) { - if (this.stats == null) { - this.stats = new ArrayList<>(); - } - this.stats.add(statsItem); - return this; - } - - /** - * Get stats - * @return stats - **/ - @javax.annotation.Nonnull - public List getStats() { - return stats; - } - - public void setStats(List stats) { - this.stats = stats; - } - - - public UserStatsListRspAllOfData paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserStatsListRspAllOfData userStatsListRspAllOfData = (UserStatsListRspAllOfData) o; - return Objects.equals(this.stats, userStatsListRspAllOfData.stats) && - Objects.equals(this.paging, userStatsListRspAllOfData.paging); - } - - @Override - public int hashCode() { - return Objects.hash(stats, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserStatsListRspAllOfData {\n"); - sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("stats"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("stats"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserStatsListRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserStatsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserStatsListRspAllOfData is not found in the empty JSON string", UserStatsListRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserStatsListRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserStatsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserStatsListRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("stats").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); - } - - JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); - // validate the required field `stats` (array) - for (int i = 0; i < jsonArraystats.size(); i++) { - UserStats.validateJsonElement(jsonArraystats.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserStatsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserStatsListRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserStatsListRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserStatsListRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserStatsListRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserStatsListRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserStatsListRspAllOfData - * @throws IOException if the JSON string is invalid with respect to UserStatsListRspAllOfData - */ - public static UserStatsListRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserStatsListRspAllOfData.class); - } - - /** - * Convert an instance of UserStatsListRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserStatus.java b/src/main/java/com/corbado/generated/model/UserStatus.java new file mode 100644 index 0000000..b4bc2c4 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/UserStatus.java @@ -0,0 +1,80 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets userStatus + */ +@JsonAdapter(UserStatus.Adapter.class) +public enum UserStatus { + + PENDING("pending"), + + ACTIVE("active"), + + DISABLED("disabled"); + + private String value; + + UserStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static UserStatus fromValue(String value) { + for (UserStatus b : UserStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final UserStatus enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public UserStatus read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return UserStatus.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + UserStatus.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/UserUpdateReq.java b/src/main/java/com/corbado/generated/model/UserUpdateReq.java index f4965c4..de34094 100644 --- a/src/main/java/com/corbado/generated/model/UserUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/UserUpdateReq.java @@ -1,8 +1,8 @@ /* * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. * - * The version of the OpenAPI document: 1.0.0 + * The version of the OpenAPI document: 2.0.0 * Contact: support@corbado.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,7 +14,7 @@ package com.corbado.generated.model; import java.util.Objects; -import com.corbado.generated.model.ClientInfo; +import com.corbado.generated.model.UserStatus; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -50,111 +50,28 @@ /** * UserUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class UserUpdateReq { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; @SerializedName(SERIALIZED_NAME_FULL_NAME) private String fullName; - /** - * Gets or Sets status - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - ACTIVE("active"), - - DISABLED("disabled"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StatusEnum.fromValue(value); - } - } - public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; + private UserStatus status; public UserUpdateReq() { } - public UserUpdateReq name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public UserUpdateReq fullName(String fullName) { this.fullName = fullName; return this; } - /** + /** * Get fullName * @return fullName - **/ + */ @javax.annotation.Nullable public String getFullName() { return fullName; @@ -165,63 +82,25 @@ public void setFullName(String fullName) { } - public UserUpdateReq status(StatusEnum status) { + public UserUpdateReq status(UserStatus status) { this.status = status; return this; } - /** + /** * Get status * @return status - **/ + */ @javax.annotation.Nullable - public StatusEnum getStatus() { + public UserStatus getStatus() { return status; } - public void setStatus(StatusEnum status) { + public void setStatus(UserStatus status) { this.status = status; } - public UserUpdateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public UserUpdateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - @Override public boolean equals(Object o) { @@ -232,27 +111,21 @@ public boolean equals(Object o) { return false; } UserUpdateReq userUpdateReq = (UserUpdateReq) o; - return Objects.equals(this.name, userUpdateReq.name) && - Objects.equals(this.fullName, userUpdateReq.fullName) && - Objects.equals(this.status, userUpdateReq.status) && - Objects.equals(this.requestID, userUpdateReq.requestID) && - Objects.equals(this.clientInfo, userUpdateReq.clientInfo); + return Objects.equals(this.fullName, userUpdateReq.fullName) && + Objects.equals(this.status, userUpdateReq.status); } @Override public int hashCode() { - return Objects.hash(name, fullName, status, requestID, clientInfo); + return Objects.hash(fullName, status); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UserUpdateReq {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); sb.append("}"); return sb.toString(); } @@ -275,22 +148,19 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("name"); openapiFields.add("fullName"); openapiFields.add("status"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserUpdateReq - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserUpdateReq + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!UserUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -306,25 +176,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } if ((jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonNull()) && !jsonObj.get("fullName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } // validate the optional field `status` if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { - StatusEnum.validateJsonElement(jsonObj.get("status")); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); + UserStatus.validateJsonElement(jsonObj.get("status")); } } @@ -357,22 +214,22 @@ public UserUpdateReq read(JsonReader in) throws IOException { } } - /** - * Create an instance of UserUpdateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserUpdateReq - * @throws IOException if the JSON string is invalid with respect to UserUpdateReq - */ + /** + * Create an instance of UserUpdateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserUpdateReq + * @throws IOException if the JSON string is invalid with respect to UserUpdateReq + */ public static UserUpdateReq fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UserUpdateReq.class); } - /** - * Convert an instance of UserUpdateReq to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UserUpdateReq to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/com/corbado/generated/model/UserUpdateRsp.java b/src/main/java/com/corbado/generated/model/UserUpdateRsp.java deleted file mode 100644 index 8eccc1b..0000000 --- a/src/main/java/com/corbado/generated/model/UserUpdateRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.User; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * UserUpdateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserUpdateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private User data; - - public UserUpdateRsp() { - } - - public UserUpdateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public UserUpdateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public UserUpdateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public UserUpdateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public UserUpdateRsp data(User data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public User getData() { - return data; - } - - public void setData(User data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserUpdateRsp userUpdateRsp = (UserUpdateRsp) o; - return Objects.equals(this.httpStatusCode, userUpdateRsp.httpStatusCode) && - Objects.equals(this.message, userUpdateRsp.message) && - Objects.equals(this.requestData, userUpdateRsp.requestData) && - Objects.equals(this.runtime, userUpdateRsp.runtime) && - Objects.equals(this.data, userUpdateRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserUpdateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserUpdateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserUpdateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserUpdateRsp is not found in the empty JSON string", UserUpdateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserUpdateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserUpdateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserUpdateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - User.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserUpdateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserUpdateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserUpdateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserUpdateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserUpdateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserUpdateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserUpdateRsp - * @throws IOException if the JSON string is invalid with respect to UserUpdateRsp - */ - public static UserUpdateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserUpdateRsp.class); - } - - /** - * Convert an instance of UserUpdateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/UserUsername.java b/src/main/java/com/corbado/generated/model/UserUsername.java deleted file mode 100644 index e7a2aa1..0000000 --- a/src/main/java/com/corbado/generated/model/UserUsername.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Status; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * User's username - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class UserUsername { - public static final String SERIALIZED_NAME_I_D = "ID"; - @SerializedName(SERIALIZED_NAME_I_D) - private String ID; - - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private String username; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private Status status; - - public UserUsername() { - } - - public UserUsername ID(String ID) { - this.ID = ID; - return this; - } - - /** - * generic ID - * @return ID - **/ - @javax.annotation.Nonnull - public String getID() { - return ID; - } - - public void setID(String ID) { - this.ID = ID; - } - - - public UserUsername username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @javax.annotation.Nonnull - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - - public UserUsername created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public UserUsername updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - public UserUsername status(Status status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - **/ - @javax.annotation.Nonnull - public Status getStatus() { - return status; - } - - public void setStatus(Status status) { - this.status = status; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserUsername userUsername = (UserUsername) o; - return Objects.equals(this.ID, userUsername.ID) && - Objects.equals(this.username, userUsername.username) && - Objects.equals(this.created, userUsername.created) && - Objects.equals(this.updated, userUsername.updated) && - Objects.equals(this.status, userUsername.status); - } - - @Override - public int hashCode() { - return Objects.hash(ID, username, created, updated, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UserUsername {\n"); - sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("ID"); - openapiFields.add("username"); - openapiFields.add("created"); - openapiFields.add("updated"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("ID"); - openapiRequiredFields.add("username"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserUsername - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!UserUsername.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in UserUsername is not found in the empty JSON string", UserUsername.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!UserUsername.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UserUsername` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UserUsername.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("ID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ID").toString())); - } - if (!jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - // validate the required field `status` - Status.validateJsonElement(jsonObj.get("status")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!UserUsername.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'UserUsername' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(UserUsername.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, UserUsername value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public UserUsername read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of UserUsername given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserUsername - * @throws IOException if the JSON string is invalid with respect to UserUsername - */ - public static UserUsername fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, UserUsername.class); - } - - /** - * Convert an instance of UserUsername to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ValidateEmailReq.java b/src/main/java/com/corbado/generated/model/ValidateEmailReq.java deleted file mode 100644 index 4c5a36e..0000000 --- a/src/main/java/com/corbado/generated/model/ValidateEmailReq.java +++ /dev/null @@ -1,326 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ValidateEmailReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ValidateEmailReq { - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_SMTP_CHECK = "smtpCheck"; - @SerializedName(SERIALIZED_NAME_SMTP_CHECK) - private Boolean smtpCheck; - - public static final String SERIALIZED_NAME_SUGGEST_DOMAIN = "suggestDomain"; - @SerializedName(SERIALIZED_NAME_SUGGEST_DOMAIN) - private Boolean suggestDomain; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public ValidateEmailReq() { - } - - public ValidateEmailReq email(String email) { - this.email = email; - return this; - } - - /** - * Email to validate - * @return email - **/ - @javax.annotation.Nonnull - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - - public ValidateEmailReq smtpCheck(Boolean smtpCheck) { - this.smtpCheck = smtpCheck; - return this; - } - - /** - * perform SMTP check for domain - * @return smtpCheck - **/ - @javax.annotation.Nullable - public Boolean getSmtpCheck() { - return smtpCheck; - } - - public void setSmtpCheck(Boolean smtpCheck) { - this.smtpCheck = smtpCheck; - } - - - public ValidateEmailReq suggestDomain(Boolean suggestDomain) { - this.suggestDomain = suggestDomain; - return this; - } - - /** - * enables domain suggestion for misspelled domains - * @return suggestDomain - **/ - @javax.annotation.Nullable - public Boolean getSuggestDomain() { - return suggestDomain; - } - - public void setSuggestDomain(Boolean suggestDomain) { - this.suggestDomain = suggestDomain; - } - - - public ValidateEmailReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public ValidateEmailReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ValidateEmailReq validateEmailReq = (ValidateEmailReq) o; - return Objects.equals(this.email, validateEmailReq.email) && - Objects.equals(this.smtpCheck, validateEmailReq.smtpCheck) && - Objects.equals(this.suggestDomain, validateEmailReq.suggestDomain) && - Objects.equals(this.requestID, validateEmailReq.requestID) && - Objects.equals(this.clientInfo, validateEmailReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(email, smtpCheck, suggestDomain, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ValidateEmailReq {\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" smtpCheck: ").append(toIndentedString(smtpCheck)).append("\n"); - sb.append(" suggestDomain: ").append(toIndentedString(suggestDomain)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("email"); - openapiFields.add("smtpCheck"); - openapiFields.add("suggestDomain"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("email"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ValidateEmailReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ValidateEmailReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ValidateEmailReq is not found in the empty JSON string", ValidateEmailReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ValidateEmailReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidateEmailReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ValidateEmailReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ValidateEmailReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ValidateEmailReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ValidateEmailReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ValidateEmailReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ValidateEmailReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ValidateEmailReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of ValidateEmailReq - * @throws IOException if the JSON string is invalid with respect to ValidateEmailReq - */ - public static ValidateEmailReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ValidateEmailReq.class); - } - - /** - * Convert an instance of ValidateEmailReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ValidateEmailRsp.java b/src/main/java/com/corbado/generated/model/ValidateEmailRsp.java deleted file mode 100644 index 717ff59..0000000 --- a/src/main/java/com/corbado/generated/model/ValidateEmailRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.EmailValidationResult; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ValidateEmailRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ValidateEmailRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private EmailValidationResult data; - - public ValidateEmailRsp() { - } - - public ValidateEmailRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public ValidateEmailRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public ValidateEmailRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public ValidateEmailRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public ValidateEmailRsp data(EmailValidationResult data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public EmailValidationResult getData() { - return data; - } - - public void setData(EmailValidationResult data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ValidateEmailRsp validateEmailRsp = (ValidateEmailRsp) o; - return Objects.equals(this.httpStatusCode, validateEmailRsp.httpStatusCode) && - Objects.equals(this.message, validateEmailRsp.message) && - Objects.equals(this.requestData, validateEmailRsp.requestData) && - Objects.equals(this.runtime, validateEmailRsp.runtime) && - Objects.equals(this.data, validateEmailRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ValidateEmailRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ValidateEmailRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ValidateEmailRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ValidateEmailRsp is not found in the empty JSON string", ValidateEmailRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ValidateEmailRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidateEmailRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ValidateEmailRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - EmailValidationResult.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ValidateEmailRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ValidateEmailRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ValidateEmailRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ValidateEmailRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ValidateEmailRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ValidateEmailRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of ValidateEmailRsp - * @throws IOException if the JSON string is invalid with respect to ValidateEmailRsp - */ - public static ValidateEmailRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ValidateEmailRsp.class); - } - - /** - * Convert an instance of ValidateEmailRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ValidatePhoneNumberReq.java b/src/main/java/com/corbado/generated/model/ValidatePhoneNumberReq.java deleted file mode 100644 index 21fbe91..0000000 --- a/src/main/java/com/corbado/generated/model/ValidatePhoneNumberReq.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ValidatePhoneNumberReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ValidatePhoneNumberReq { - public static final String SERIALIZED_NAME_REGION_CODE = "regionCode"; - @SerializedName(SERIALIZED_NAME_REGION_CODE) - private String regionCode; - - public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; - @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) - private String phoneNumber; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public ValidatePhoneNumberReq() { - } - - public ValidatePhoneNumberReq regionCode(String regionCode) { - this.regionCode = regionCode; - return this; - } - - /** - * ISO country or region code - * @return regionCode - **/ - @javax.annotation.Nullable - public String getRegionCode() { - return regionCode; - } - - public void setRegionCode(String regionCode) { - this.regionCode = regionCode; - } - - - public ValidatePhoneNumberReq phoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - /** - * Phone number to validate - * @return phoneNumber - **/ - @javax.annotation.Nonnull - public String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - - - public ValidatePhoneNumberReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public ValidatePhoneNumberReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ValidatePhoneNumberReq validatePhoneNumberReq = (ValidatePhoneNumberReq) o; - return Objects.equals(this.regionCode, validatePhoneNumberReq.regionCode) && - Objects.equals(this.phoneNumber, validatePhoneNumberReq.phoneNumber) && - Objects.equals(this.requestID, validatePhoneNumberReq.requestID) && - Objects.equals(this.clientInfo, validatePhoneNumberReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(regionCode, phoneNumber, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ValidatePhoneNumberReq {\n"); - sb.append(" regionCode: ").append(toIndentedString(regionCode)).append("\n"); - sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("regionCode"); - openapiFields.add("phoneNumber"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("phoneNumber"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ValidatePhoneNumberReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ValidatePhoneNumberReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ValidatePhoneNumberReq is not found in the empty JSON string", ValidatePhoneNumberReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ValidatePhoneNumberReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidatePhoneNumberReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ValidatePhoneNumberReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("regionCode") != null && !jsonObj.get("regionCode").isJsonNull()) && !jsonObj.get("regionCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `regionCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("regionCode").toString())); - } - if (!jsonObj.get("phoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ValidatePhoneNumberReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ValidatePhoneNumberReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ValidatePhoneNumberReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ValidatePhoneNumberReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ValidatePhoneNumberReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ValidatePhoneNumberReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of ValidatePhoneNumberReq - * @throws IOException if the JSON string is invalid with respect to ValidatePhoneNumberReq - */ - public static ValidatePhoneNumberReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ValidatePhoneNumberReq.class); - } - - /** - * Convert an instance of ValidatePhoneNumberReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ValidatePhoneNumberRsp.java b/src/main/java/com/corbado/generated/model/ValidatePhoneNumberRsp.java deleted file mode 100644 index c3ad8f6..0000000 --- a/src/main/java/com/corbado/generated/model/ValidatePhoneNumberRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.PhoneNumberValidationResult; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ValidatePhoneNumberRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ValidatePhoneNumberRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private PhoneNumberValidationResult data; - - public ValidatePhoneNumberRsp() { - } - - public ValidatePhoneNumberRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public ValidatePhoneNumberRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public ValidatePhoneNumberRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public ValidatePhoneNumberRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public ValidatePhoneNumberRsp data(PhoneNumberValidationResult data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public PhoneNumberValidationResult getData() { - return data; - } - - public void setData(PhoneNumberValidationResult data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ValidatePhoneNumberRsp validatePhoneNumberRsp = (ValidatePhoneNumberRsp) o; - return Objects.equals(this.httpStatusCode, validatePhoneNumberRsp.httpStatusCode) && - Objects.equals(this.message, validatePhoneNumberRsp.message) && - Objects.equals(this.requestData, validatePhoneNumberRsp.requestData) && - Objects.equals(this.runtime, validatePhoneNumberRsp.runtime) && - Objects.equals(this.data, validatePhoneNumberRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ValidatePhoneNumberRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ValidatePhoneNumberRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ValidatePhoneNumberRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ValidatePhoneNumberRsp is not found in the empty JSON string", ValidatePhoneNumberRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ValidatePhoneNumberRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidatePhoneNumberRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ValidatePhoneNumberRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - PhoneNumberValidationResult.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ValidatePhoneNumberRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ValidatePhoneNumberRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ValidatePhoneNumberRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ValidatePhoneNumberRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ValidatePhoneNumberRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ValidatePhoneNumberRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of ValidatePhoneNumberRsp - * @throws IOException if the JSON string is invalid with respect to ValidatePhoneNumberRsp - */ - public static ValidatePhoneNumberRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ValidatePhoneNumberRsp.class); - } - - /** - * Convert an instance of ValidatePhoneNumberRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ValidationEmail.java b/src/main/java/com/corbado/generated/model/ValidationEmail.java deleted file mode 100644 index f8ea36b..0000000 --- a/src/main/java/com/corbado/generated/model/ValidationEmail.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ValidationEmail - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ValidationEmail { - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private String username; - - public static final String SERIALIZED_NAME_DOMAIN = "domain"; - @SerializedName(SERIALIZED_NAME_DOMAIN) - private String domain; - - public static final String SERIALIZED_NAME_REACHABLE = "reachable"; - @SerializedName(SERIALIZED_NAME_REACHABLE) - private String reachable; - - public static final String SERIALIZED_NAME_DISPOSABLE = "disposable"; - @SerializedName(SERIALIZED_NAME_DISPOSABLE) - private Boolean disposable; - - public static final String SERIALIZED_NAME_FREE = "free"; - @SerializedName(SERIALIZED_NAME_FREE) - private Boolean free; - - public static final String SERIALIZED_NAME_HAS_MX_RECORDS = "hasMxRecords"; - @SerializedName(SERIALIZED_NAME_HAS_MX_RECORDS) - private Boolean hasMxRecords; - - public ValidationEmail() { - } - - public ValidationEmail username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @javax.annotation.Nonnull - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - - public ValidationEmail domain(String domain) { - this.domain = domain; - return this; - } - - /** - * Get domain - * @return domain - **/ - @javax.annotation.Nonnull - public String getDomain() { - return domain; - } - - public void setDomain(String domain) { - this.domain = domain; - } - - - public ValidationEmail reachable(String reachable) { - this.reachable = reachable; - return this; - } - - /** - * Get reachable - * @return reachable - **/ - @javax.annotation.Nonnull - public String getReachable() { - return reachable; - } - - public void setReachable(String reachable) { - this.reachable = reachable; - } - - - public ValidationEmail disposable(Boolean disposable) { - this.disposable = disposable; - return this; - } - - /** - * Get disposable - * @return disposable - **/ - @javax.annotation.Nonnull - public Boolean getDisposable() { - return disposable; - } - - public void setDisposable(Boolean disposable) { - this.disposable = disposable; - } - - - public ValidationEmail free(Boolean free) { - this.free = free; - return this; - } - - /** - * Get free - * @return free - **/ - @javax.annotation.Nonnull - public Boolean getFree() { - return free; - } - - public void setFree(Boolean free) { - this.free = free; - } - - - public ValidationEmail hasMxRecords(Boolean hasMxRecords) { - this.hasMxRecords = hasMxRecords; - return this; - } - - /** - * Get hasMxRecords - * @return hasMxRecords - **/ - @javax.annotation.Nonnull - public Boolean getHasMxRecords() { - return hasMxRecords; - } - - public void setHasMxRecords(Boolean hasMxRecords) { - this.hasMxRecords = hasMxRecords; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ValidationEmail validationEmail = (ValidationEmail) o; - return Objects.equals(this.username, validationEmail.username) && - Objects.equals(this.domain, validationEmail.domain) && - Objects.equals(this.reachable, validationEmail.reachable) && - Objects.equals(this.disposable, validationEmail.disposable) && - Objects.equals(this.free, validationEmail.free) && - Objects.equals(this.hasMxRecords, validationEmail.hasMxRecords); - } - - @Override - public int hashCode() { - return Objects.hash(username, domain, reachable, disposable, free, hasMxRecords); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ValidationEmail {\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); - sb.append(" reachable: ").append(toIndentedString(reachable)).append("\n"); - sb.append(" disposable: ").append(toIndentedString(disposable)).append("\n"); - sb.append(" free: ").append(toIndentedString(free)).append("\n"); - sb.append(" hasMxRecords: ").append(toIndentedString(hasMxRecords)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("username"); - openapiFields.add("domain"); - openapiFields.add("reachable"); - openapiFields.add("disposable"); - openapiFields.add("free"); - openapiFields.add("hasMxRecords"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("username"); - openapiRequiredFields.add("domain"); - openapiRequiredFields.add("reachable"); - openapiRequiredFields.add("disposable"); - openapiRequiredFields.add("free"); - openapiRequiredFields.add("hasMxRecords"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ValidationEmail - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ValidationEmail.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ValidationEmail is not found in the empty JSON string", ValidationEmail.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ValidationEmail.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidationEmail` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ValidationEmail.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); - } - if (!jsonObj.get("domain").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domain").toString())); - } - if (!jsonObj.get("reachable").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `reachable` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reachable").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ValidationEmail.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ValidationEmail' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ValidationEmail.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ValidationEmail value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ValidationEmail read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ValidationEmail given an JSON string - * - * @param jsonString JSON string - * @return An instance of ValidationEmail - * @throws IOException if the JSON string is invalid with respect to ValidationEmail - */ - public static ValidationEmail fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ValidationEmail.class); - } - - /** - * Convert an instance of ValidationEmail to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/ValidationPhoneNumber.java b/src/main/java/com/corbado/generated/model/ValidationPhoneNumber.java deleted file mode 100644 index c214786..0000000 --- a/src/main/java/com/corbado/generated/model/ValidationPhoneNumber.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * ValidationPhoneNumber - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class ValidationPhoneNumber { - public static final String SERIALIZED_NAME_NATIONAL_NUMBER = "nationalNumber"; - @SerializedName(SERIALIZED_NAME_NATIONAL_NUMBER) - private Integer nationalNumber; - - public static final String SERIALIZED_NAME_COUNTRY_CODE = "countryCode"; - @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) - private Integer countryCode; - - public static final String SERIALIZED_NAME_REGION_CODE = "regionCode"; - @SerializedName(SERIALIZED_NAME_REGION_CODE) - private String regionCode; - - public static final String SERIALIZED_NAME_NATIONAL_FORMATTED = "nationalFormatted"; - @SerializedName(SERIALIZED_NAME_NATIONAL_FORMATTED) - private String nationalFormatted; - - public static final String SERIALIZED_NAME_INTERNATIONAL_FORMATTED = "internationalFormatted"; - @SerializedName(SERIALIZED_NAME_INTERNATIONAL_FORMATTED) - private String internationalFormatted; - - public ValidationPhoneNumber() { - } - - public ValidationPhoneNumber nationalNumber(Integer nationalNumber) { - this.nationalNumber = nationalNumber; - return this; - } - - /** - * Get nationalNumber - * @return nationalNumber - **/ - @javax.annotation.Nonnull - public Integer getNationalNumber() { - return nationalNumber; - } - - public void setNationalNumber(Integer nationalNumber) { - this.nationalNumber = nationalNumber; - } - - - public ValidationPhoneNumber countryCode(Integer countryCode) { - this.countryCode = countryCode; - return this; - } - - /** - * Get countryCode - * @return countryCode - **/ - @javax.annotation.Nonnull - public Integer getCountryCode() { - return countryCode; - } - - public void setCountryCode(Integer countryCode) { - this.countryCode = countryCode; - } - - - public ValidationPhoneNumber regionCode(String regionCode) { - this.regionCode = regionCode; - return this; - } - - /** - * Get regionCode - * @return regionCode - **/ - @javax.annotation.Nonnull - public String getRegionCode() { - return regionCode; - } - - public void setRegionCode(String regionCode) { - this.regionCode = regionCode; - } - - - public ValidationPhoneNumber nationalFormatted(String nationalFormatted) { - this.nationalFormatted = nationalFormatted; - return this; - } - - /** - * Get nationalFormatted - * @return nationalFormatted - **/ - @javax.annotation.Nonnull - public String getNationalFormatted() { - return nationalFormatted; - } - - public void setNationalFormatted(String nationalFormatted) { - this.nationalFormatted = nationalFormatted; - } - - - public ValidationPhoneNumber internationalFormatted(String internationalFormatted) { - this.internationalFormatted = internationalFormatted; - return this; - } - - /** - * Get internationalFormatted - * @return internationalFormatted - **/ - @javax.annotation.Nonnull - public String getInternationalFormatted() { - return internationalFormatted; - } - - public void setInternationalFormatted(String internationalFormatted) { - this.internationalFormatted = internationalFormatted; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ValidationPhoneNumber validationPhoneNumber = (ValidationPhoneNumber) o; - return Objects.equals(this.nationalNumber, validationPhoneNumber.nationalNumber) && - Objects.equals(this.countryCode, validationPhoneNumber.countryCode) && - Objects.equals(this.regionCode, validationPhoneNumber.regionCode) && - Objects.equals(this.nationalFormatted, validationPhoneNumber.nationalFormatted) && - Objects.equals(this.internationalFormatted, validationPhoneNumber.internationalFormatted); - } - - @Override - public int hashCode() { - return Objects.hash(nationalNumber, countryCode, regionCode, nationalFormatted, internationalFormatted); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ValidationPhoneNumber {\n"); - sb.append(" nationalNumber: ").append(toIndentedString(nationalNumber)).append("\n"); - sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); - sb.append(" regionCode: ").append(toIndentedString(regionCode)).append("\n"); - sb.append(" nationalFormatted: ").append(toIndentedString(nationalFormatted)).append("\n"); - sb.append(" internationalFormatted: ").append(toIndentedString(internationalFormatted)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("nationalNumber"); - openapiFields.add("countryCode"); - openapiFields.add("regionCode"); - openapiFields.add("nationalFormatted"); - openapiFields.add("internationalFormatted"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("nationalNumber"); - openapiRequiredFields.add("countryCode"); - openapiRequiredFields.add("regionCode"); - openapiRequiredFields.add("nationalFormatted"); - openapiRequiredFields.add("internationalFormatted"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ValidationPhoneNumber - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ValidationPhoneNumber.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ValidationPhoneNumber is not found in the empty JSON string", ValidationPhoneNumber.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ValidationPhoneNumber.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidationPhoneNumber` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ValidationPhoneNumber.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("regionCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `regionCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("regionCode").toString())); - } - if (!jsonObj.get("nationalFormatted").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `nationalFormatted` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nationalFormatted").toString())); - } - if (!jsonObj.get("internationalFormatted").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `internationalFormatted` to be a primitive type in the JSON string but got `%s`", jsonObj.get("internationalFormatted").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ValidationPhoneNumber.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ValidationPhoneNumber' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ValidationPhoneNumber.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ValidationPhoneNumber value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ValidationPhoneNumber read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ValidationPhoneNumber given an JSON string - * - * @param jsonString JSON string - * @return An instance of ValidationPhoneNumber - * @throws IOException if the JSON string is invalid with respect to ValidationPhoneNumber - */ - public static ValidationPhoneNumber fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ValidationPhoneNumber.class); - } - - /** - * Convert an instance of ValidationPhoneNumber to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnAssociateStartReq.java b/src/main/java/com/corbado/generated/model/WebAuthnAssociateStartReq.java deleted file mode 100644 index eac493f..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnAssociateStartReq.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnAssociateStartReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnAssociateStartReq { - public static final String SERIALIZED_NAME_ASSOCIATION_TOKEN = "associationToken"; - @SerializedName(SERIALIZED_NAME_ASSOCIATION_TOKEN) - private String associationToken; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public WebAuthnAssociateStartReq() { - } - - public WebAuthnAssociateStartReq associationToken(String associationToken) { - this.associationToken = associationToken; - return this; - } - - /** - * Get associationToken - * @return associationToken - **/ - @javax.annotation.Nonnull - public String getAssociationToken() { - return associationToken; - } - - public void setAssociationToken(String associationToken) { - this.associationToken = associationToken; - } - - - public WebAuthnAssociateStartReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public WebAuthnAssociateStartReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnAssociateStartReq webAuthnAssociateStartReq = (WebAuthnAssociateStartReq) o; - return Objects.equals(this.associationToken, webAuthnAssociateStartReq.associationToken) && - Objects.equals(this.requestID, webAuthnAssociateStartReq.requestID) && - Objects.equals(this.clientInfo, webAuthnAssociateStartReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(associationToken, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnAssociateStartReq {\n"); - sb.append(" associationToken: ").append(toIndentedString(associationToken)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("associationToken"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("associationToken"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnAssociateStartReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnAssociateStartReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnAssociateStartReq is not found in the empty JSON string", WebAuthnAssociateStartReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnAssociateStartReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnAssociateStartReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnAssociateStartReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("associationToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `associationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("associationToken").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnAssociateStartReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnAssociateStartReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnAssociateStartReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnAssociateStartReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnAssociateStartReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnAssociateStartReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnAssociateStartReq - * @throws IOException if the JSON string is invalid with respect to WebAuthnAssociateStartReq - */ - public static WebAuthnAssociateStartReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnAssociateStartReq.class); - } - - /** - * Convert an instance of WebAuthnAssociateStartReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnAssociateStartRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnAssociateStartRsp.java deleted file mode 100644 index 6a64efa..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnAssociateStartRsp.java +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnAssociateStartRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnAssociateStartRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - /** - * Status represents information if user signup was successful or the user with its credentials already exists - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("success"), - - DUPLICATE("duplicate"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StatusEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL_CREATION_OPTIONS = "publicKeyCredentialCreationOptions"; - @SerializedName(SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL_CREATION_OPTIONS) - private String publicKeyCredentialCreationOptions; - - public WebAuthnAssociateStartRsp() { - } - - public WebAuthnAssociateStartRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebAuthnAssociateStartRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebAuthnAssociateStartRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebAuthnAssociateStartRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebAuthnAssociateStartRsp status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Status represents information if user signup was successful or the user with its credentials already exists - * @return status - **/ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - - public WebAuthnAssociateStartRsp publicKeyCredentialCreationOptions(String publicKeyCredentialCreationOptions) { - this.publicKeyCredentialCreationOptions = publicKeyCredentialCreationOptions; - return this; - } - - /** - * Contains JSON payload data to start Passkeys (Biometrics) sign up challenge - * @return publicKeyCredentialCreationOptions - **/ - @javax.annotation.Nonnull - public String getPublicKeyCredentialCreationOptions() { - return publicKeyCredentialCreationOptions; - } - - public void setPublicKeyCredentialCreationOptions(String publicKeyCredentialCreationOptions) { - this.publicKeyCredentialCreationOptions = publicKeyCredentialCreationOptions; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnAssociateStartRsp webAuthnAssociateStartRsp = (WebAuthnAssociateStartRsp) o; - return Objects.equals(this.httpStatusCode, webAuthnAssociateStartRsp.httpStatusCode) && - Objects.equals(this.message, webAuthnAssociateStartRsp.message) && - Objects.equals(this.requestData, webAuthnAssociateStartRsp.requestData) && - Objects.equals(this.runtime, webAuthnAssociateStartRsp.runtime) && - Objects.equals(this.status, webAuthnAssociateStartRsp.status) && - Objects.equals(this.publicKeyCredentialCreationOptions, webAuthnAssociateStartRsp.publicKeyCredentialCreationOptions); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, status, publicKeyCredentialCreationOptions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnAssociateStartRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" publicKeyCredentialCreationOptions: ").append(toIndentedString(publicKeyCredentialCreationOptions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("status"); - openapiFields.add("publicKeyCredentialCreationOptions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("publicKeyCredentialCreationOptions"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnAssociateStartRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnAssociateStartRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnAssociateStartRsp is not found in the empty JSON string", WebAuthnAssociateStartRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnAssociateStartRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnAssociateStartRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnAssociateStartRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // validate the required field `status` - StatusEnum.validateJsonElement(jsonObj.get("status")); - if (!jsonObj.get("publicKeyCredentialCreationOptions").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `publicKeyCredentialCreationOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKeyCredentialCreationOptions").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnAssociateStartRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnAssociateStartRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnAssociateStartRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnAssociateStartRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnAssociateStartRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnAssociateStartRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnAssociateStartRsp - * @throws IOException if the JSON string is invalid with respect to WebAuthnAssociateStartRsp - */ - public static WebAuthnAssociateStartRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnAssociateStartRsp.class); - } - - /** - * Convert an instance of WebAuthnAssociateStartRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateFinishRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateFinishRsp.java deleted file mode 100644 index d340ddb..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateFinishRsp.java +++ /dev/null @@ -1,503 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnAuthenticateFinishRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnAuthenticateFinishRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_USER_I_D = "userID"; - @SerializedName(SERIALIZED_NAME_USER_I_D) - private String userID; - - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private String username; - - public static final String SERIALIZED_NAME_CREDENTIAL_I_D = "credentialID"; - @SerializedName(SERIALIZED_NAME_CREDENTIAL_I_D) - private String credentialID; - - public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; - @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) - private String userFullName; - - /** - * Status represents information if user signup was successful or the user with its credentials already exists - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("success"), - - UNCONFIRMED_CREDENTIAL("unconfirmedCredential"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StatusEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public WebAuthnAuthenticateFinishRsp() { - } - - public WebAuthnAuthenticateFinishRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebAuthnAuthenticateFinishRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebAuthnAuthenticateFinishRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebAuthnAuthenticateFinishRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebAuthnAuthenticateFinishRsp userID(String userID) { - this.userID = userID; - return this; - } - - /** - * ID of the user - * @return userID - **/ - @javax.annotation.Nonnull - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - - public WebAuthnAuthenticateFinishRsp username(String username) { - this.username = username; - return this; - } - - /** - * Username of current challenge - * @return username - **/ - @javax.annotation.Nonnull - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - - public WebAuthnAuthenticateFinishRsp credentialID(String credentialID) { - this.credentialID = credentialID; - return this; - } - - /** - * Used credential ID - * @return credentialID - **/ - @javax.annotation.Nonnull - public String getCredentialID() { - return credentialID; - } - - public void setCredentialID(String credentialID) { - this.credentialID = credentialID; - } - - - public WebAuthnAuthenticateFinishRsp userFullName(String userFullName) { - this.userFullName = userFullName; - return this; - } - - /** - * Optional user's full name to be used if the user wasn't found and needs to be created first - * @return userFullName - **/ - @javax.annotation.Nullable - public String getUserFullName() { - return userFullName; - } - - public void setUserFullName(String userFullName) { - this.userFullName = userFullName; - } - - - public WebAuthnAuthenticateFinishRsp status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Status represents information if user signup was successful or the user with its credentials already exists - * @return status - **/ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnAuthenticateFinishRsp webAuthnAuthenticateFinishRsp = (WebAuthnAuthenticateFinishRsp) o; - return Objects.equals(this.httpStatusCode, webAuthnAuthenticateFinishRsp.httpStatusCode) && - Objects.equals(this.message, webAuthnAuthenticateFinishRsp.message) && - Objects.equals(this.requestData, webAuthnAuthenticateFinishRsp.requestData) && - Objects.equals(this.runtime, webAuthnAuthenticateFinishRsp.runtime) && - Objects.equals(this.userID, webAuthnAuthenticateFinishRsp.userID) && - Objects.equals(this.username, webAuthnAuthenticateFinishRsp.username) && - Objects.equals(this.credentialID, webAuthnAuthenticateFinishRsp.credentialID) && - Objects.equals(this.userFullName, webAuthnAuthenticateFinishRsp.userFullName) && - Objects.equals(this.status, webAuthnAuthenticateFinishRsp.status); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, userID, username, credentialID, userFullName, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnAuthenticateFinishRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" credentialID: ").append(toIndentedString(credentialID)).append("\n"); - sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("userID"); - openapiFields.add("username"); - openapiFields.add("credentialID"); - openapiFields.add("userFullName"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("userID"); - openapiRequiredFields.add("username"); - openapiRequiredFields.add("credentialID"); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnAuthenticateFinishRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnAuthenticateFinishRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnAuthenticateFinishRsp is not found in the empty JSON string", WebAuthnAuthenticateFinishRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnAuthenticateFinishRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnAuthenticateFinishRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnAuthenticateFinishRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("userID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); - } - if (!jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); - } - if (!jsonObj.get("credentialID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `credentialID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialID").toString())); - } - if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // validate the required field `status` - StatusEnum.validateJsonElement(jsonObj.get("status")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnAuthenticateFinishRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnAuthenticateFinishRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnAuthenticateFinishRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnAuthenticateFinishRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnAuthenticateFinishRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnAuthenticateFinishRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnAuthenticateFinishRsp - * @throws IOException if the JSON string is invalid with respect to WebAuthnAuthenticateFinishRsp - */ - public static WebAuthnAuthenticateFinishRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnAuthenticateFinishRsp.class); - } - - /** - * Convert an instance of WebAuthnAuthenticateFinishRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartReq.java b/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartReq.java deleted file mode 100644 index 076ac38..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartReq.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnAuthenticateStartReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnAuthenticateStartReq { - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private String username; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public WebAuthnAuthenticateStartReq() { - } - - public WebAuthnAuthenticateStartReq username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @javax.annotation.Nonnull - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - - public WebAuthnAuthenticateStartReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public WebAuthnAuthenticateStartReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nonnull - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnAuthenticateStartReq webAuthnAuthenticateStartReq = (WebAuthnAuthenticateStartReq) o; - return Objects.equals(this.username, webAuthnAuthenticateStartReq.username) && - Objects.equals(this.requestID, webAuthnAuthenticateStartReq.requestID) && - Objects.equals(this.clientInfo, webAuthnAuthenticateStartReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(username, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnAuthenticateStartReq {\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("username"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("username"); - openapiRequiredFields.add("clientInfo"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnAuthenticateStartReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnAuthenticateStartReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnAuthenticateStartReq is not found in the empty JSON string", WebAuthnAuthenticateStartReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnAuthenticateStartReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnAuthenticateStartReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnAuthenticateStartReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the required field `clientInfo` - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnAuthenticateStartReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnAuthenticateStartReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnAuthenticateStartReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnAuthenticateStartReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnAuthenticateStartReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnAuthenticateStartReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnAuthenticateStartReq - * @throws IOException if the JSON string is invalid with respect to WebAuthnAuthenticateStartReq - */ - public static WebAuthnAuthenticateStartReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnAuthenticateStartReq.class); - } - - /** - * Convert an instance of WebAuthnAuthenticateStartReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartRsp.java deleted file mode 100644 index 365d012..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateStartRsp.java +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnAuthenticateStartRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnAuthenticateStartRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL_REQUEST_OPTIONS = "publicKeyCredentialRequestOptions"; - @SerializedName(SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL_REQUEST_OPTIONS) - private String publicKeyCredentialRequestOptions; - - /** - * Status represents information if authenticate start was successful or device is unknown - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("success"), - - UNKNOWN_DEVICE("unknownDevice"), - - UNCONFIRMED_DEVICE("unconfirmedDevice"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StatusEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public WebAuthnAuthenticateStartRsp() { - } - - public WebAuthnAuthenticateStartRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebAuthnAuthenticateStartRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebAuthnAuthenticateStartRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebAuthnAuthenticateStartRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebAuthnAuthenticateStartRsp publicKeyCredentialRequestOptions(String publicKeyCredentialRequestOptions) { - this.publicKeyCredentialRequestOptions = publicKeyCredentialRequestOptions; - return this; - } - - /** - * Contains JSON payload data to start Passkeys (Biometrics) login challenge - * @return publicKeyCredentialRequestOptions - **/ - @javax.annotation.Nonnull - public String getPublicKeyCredentialRequestOptions() { - return publicKeyCredentialRequestOptions; - } - - public void setPublicKeyCredentialRequestOptions(String publicKeyCredentialRequestOptions) { - this.publicKeyCredentialRequestOptions = publicKeyCredentialRequestOptions; - } - - - public WebAuthnAuthenticateStartRsp status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Status represents information if authenticate start was successful or device is unknown - * @return status - **/ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnAuthenticateStartRsp webAuthnAuthenticateStartRsp = (WebAuthnAuthenticateStartRsp) o; - return Objects.equals(this.httpStatusCode, webAuthnAuthenticateStartRsp.httpStatusCode) && - Objects.equals(this.message, webAuthnAuthenticateStartRsp.message) && - Objects.equals(this.requestData, webAuthnAuthenticateStartRsp.requestData) && - Objects.equals(this.runtime, webAuthnAuthenticateStartRsp.runtime) && - Objects.equals(this.publicKeyCredentialRequestOptions, webAuthnAuthenticateStartRsp.publicKeyCredentialRequestOptions) && - Objects.equals(this.status, webAuthnAuthenticateStartRsp.status); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, publicKeyCredentialRequestOptions, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnAuthenticateStartRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" publicKeyCredentialRequestOptions: ").append(toIndentedString(publicKeyCredentialRequestOptions)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("publicKeyCredentialRequestOptions"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("publicKeyCredentialRequestOptions"); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnAuthenticateStartRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnAuthenticateStartRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnAuthenticateStartRsp is not found in the empty JSON string", WebAuthnAuthenticateStartRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnAuthenticateStartRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnAuthenticateStartRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnAuthenticateStartRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("publicKeyCredentialRequestOptions").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `publicKeyCredentialRequestOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKeyCredentialRequestOptions").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // validate the required field `status` - StatusEnum.validateJsonElement(jsonObj.get("status")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnAuthenticateStartRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnAuthenticateStartRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnAuthenticateStartRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnAuthenticateStartRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnAuthenticateStartRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnAuthenticateStartRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnAuthenticateStartRsp - * @throws IOException if the JSON string is invalid with respect to WebAuthnAuthenticateStartRsp - */ - public static WebAuthnAuthenticateStartRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnAuthenticateStartRsp.class); - } - - /** - * Convert an instance of WebAuthnAuthenticateStartRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateSuccess.java b/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateSuccess.java deleted file mode 100644 index d76e19f..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnAuthenticateSuccess.java +++ /dev/null @@ -1,419 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnAuthenticateSuccess - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnAuthenticateSuccess { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_USER_I_D = "userID"; - @SerializedName(SERIALIZED_NAME_USER_I_D) - private String userID; - - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private String username; - - public static final String SERIALIZED_NAME_CREDENTIAL_I_D = "credentialID"; - @SerializedName(SERIALIZED_NAME_CREDENTIAL_I_D) - private String credentialID; - - public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; - @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) - private String userFullName; - - public WebAuthnAuthenticateSuccess() { - } - - public WebAuthnAuthenticateSuccess httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebAuthnAuthenticateSuccess message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebAuthnAuthenticateSuccess requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebAuthnAuthenticateSuccess runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebAuthnAuthenticateSuccess userID(String userID) { - this.userID = userID; - return this; - } - - /** - * ID of the user - * @return userID - **/ - @javax.annotation.Nonnull - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - - public WebAuthnAuthenticateSuccess username(String username) { - this.username = username; - return this; - } - - /** - * Username of current challenge - * @return username - **/ - @javax.annotation.Nonnull - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - - public WebAuthnAuthenticateSuccess credentialID(String credentialID) { - this.credentialID = credentialID; - return this; - } - - /** - * Used credential ID - * @return credentialID - **/ - @javax.annotation.Nonnull - public String getCredentialID() { - return credentialID; - } - - public void setCredentialID(String credentialID) { - this.credentialID = credentialID; - } - - - public WebAuthnAuthenticateSuccess userFullName(String userFullName) { - this.userFullName = userFullName; - return this; - } - - /** - * Optional user's full name to be used if the user wasn't found and needs to be created first - * @return userFullName - **/ - @javax.annotation.Nullable - public String getUserFullName() { - return userFullName; - } - - public void setUserFullName(String userFullName) { - this.userFullName = userFullName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnAuthenticateSuccess webAuthnAuthenticateSuccess = (WebAuthnAuthenticateSuccess) o; - return Objects.equals(this.httpStatusCode, webAuthnAuthenticateSuccess.httpStatusCode) && - Objects.equals(this.message, webAuthnAuthenticateSuccess.message) && - Objects.equals(this.requestData, webAuthnAuthenticateSuccess.requestData) && - Objects.equals(this.runtime, webAuthnAuthenticateSuccess.runtime) && - Objects.equals(this.userID, webAuthnAuthenticateSuccess.userID) && - Objects.equals(this.username, webAuthnAuthenticateSuccess.username) && - Objects.equals(this.credentialID, webAuthnAuthenticateSuccess.credentialID) && - Objects.equals(this.userFullName, webAuthnAuthenticateSuccess.userFullName); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, userID, username, credentialID, userFullName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnAuthenticateSuccess {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" credentialID: ").append(toIndentedString(credentialID)).append("\n"); - sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("userID"); - openapiFields.add("username"); - openapiFields.add("credentialID"); - openapiFields.add("userFullName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("userID"); - openapiRequiredFields.add("username"); - openapiRequiredFields.add("credentialID"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnAuthenticateSuccess - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnAuthenticateSuccess.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnAuthenticateSuccess is not found in the empty JSON string", WebAuthnAuthenticateSuccess.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnAuthenticateSuccess.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnAuthenticateSuccess` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnAuthenticateSuccess.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("userID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); - } - if (!jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); - } - if (!jsonObj.get("credentialID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `credentialID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialID").toString())); - } - if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnAuthenticateSuccess.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnAuthenticateSuccess' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnAuthenticateSuccess.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnAuthenticateSuccess value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnAuthenticateSuccess read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnAuthenticateSuccess given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnAuthenticateSuccess - * @throws IOException if the JSON string is invalid with respect to WebAuthnAuthenticateSuccess - */ - public static WebAuthnAuthenticateSuccess fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnAuthenticateSuccess.class); - } - - /** - * Convert an instance of WebAuthnAuthenticateSuccess to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnAuthenticatorUpdateReq.java b/src/main/java/com/corbado/generated/model/WebAuthnAuthenticatorUpdateReq.java deleted file mode 100644 index d67d607..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnAuthenticatorUpdateReq.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnAuthenticatorUpdateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnAuthenticatorUpdateReq { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public WebAuthnAuthenticatorUpdateReq() { - } - - public WebAuthnAuthenticatorUpdateReq name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public WebAuthnAuthenticatorUpdateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public WebAuthnAuthenticatorUpdateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnAuthenticatorUpdateReq webAuthnAuthenticatorUpdateReq = (WebAuthnAuthenticatorUpdateReq) o; - return Objects.equals(this.name, webAuthnAuthenticatorUpdateReq.name) && - Objects.equals(this.requestID, webAuthnAuthenticatorUpdateReq.requestID) && - Objects.equals(this.clientInfo, webAuthnAuthenticatorUpdateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(name, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnAuthenticatorUpdateReq {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnAuthenticatorUpdateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnAuthenticatorUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnAuthenticatorUpdateReq is not found in the empty JSON string", WebAuthnAuthenticatorUpdateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnAuthenticatorUpdateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnAuthenticatorUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnAuthenticatorUpdateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnAuthenticatorUpdateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnAuthenticatorUpdateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnAuthenticatorUpdateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnAuthenticatorUpdateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnAuthenticatorUpdateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnAuthenticatorUpdateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnAuthenticatorUpdateReq - * @throws IOException if the JSON string is invalid with respect to WebAuthnAuthenticatorUpdateReq - */ - public static WebAuthnAuthenticatorUpdateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnAuthenticatorUpdateReq.class); - } - - /** - * Convert an instance of WebAuthnAuthenticatorUpdateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsReq.java b/src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsReq.java deleted file mode 100644 index 75abd00..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsReq.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.corbado.generated.model.LoginIdentifierType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnCredentialExistsReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnCredentialExistsReq { - public static final String SERIALIZED_NAME_LOGIN_IDENTIFIER = "loginIdentifier"; - @SerializedName(SERIALIZED_NAME_LOGIN_IDENTIFIER) - private String loginIdentifier; - - public static final String SERIALIZED_NAME_LOGIN_IDENTIFIER_TYPE = "loginIdentifierType"; - @SerializedName(SERIALIZED_NAME_LOGIN_IDENTIFIER_TYPE) - private LoginIdentifierType loginIdentifierType; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public WebAuthnCredentialExistsReq() { - } - - public WebAuthnCredentialExistsReq loginIdentifier(String loginIdentifier) { - this.loginIdentifier = loginIdentifier; - return this; - } - - /** - * Get loginIdentifier - * @return loginIdentifier - **/ - @javax.annotation.Nonnull - public String getLoginIdentifier() { - return loginIdentifier; - } - - public void setLoginIdentifier(String loginIdentifier) { - this.loginIdentifier = loginIdentifier; - } - - - public WebAuthnCredentialExistsReq loginIdentifierType(LoginIdentifierType loginIdentifierType) { - this.loginIdentifierType = loginIdentifierType; - return this; - } - - /** - * Get loginIdentifierType - * @return loginIdentifierType - **/ - @javax.annotation.Nonnull - public LoginIdentifierType getLoginIdentifierType() { - return loginIdentifierType; - } - - public void setLoginIdentifierType(LoginIdentifierType loginIdentifierType) { - this.loginIdentifierType = loginIdentifierType; - } - - - public WebAuthnCredentialExistsReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public WebAuthnCredentialExistsReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nonnull - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnCredentialExistsReq webAuthnCredentialExistsReq = (WebAuthnCredentialExistsReq) o; - return Objects.equals(this.loginIdentifier, webAuthnCredentialExistsReq.loginIdentifier) && - Objects.equals(this.loginIdentifierType, webAuthnCredentialExistsReq.loginIdentifierType) && - Objects.equals(this.requestID, webAuthnCredentialExistsReq.requestID) && - Objects.equals(this.clientInfo, webAuthnCredentialExistsReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(loginIdentifier, loginIdentifierType, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnCredentialExistsReq {\n"); - sb.append(" loginIdentifier: ").append(toIndentedString(loginIdentifier)).append("\n"); - sb.append(" loginIdentifierType: ").append(toIndentedString(loginIdentifierType)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("loginIdentifier"); - openapiFields.add("loginIdentifierType"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("loginIdentifier"); - openapiRequiredFields.add("loginIdentifierType"); - openapiRequiredFields.add("clientInfo"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnCredentialExistsReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnCredentialExistsReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnCredentialExistsReq is not found in the empty JSON string", WebAuthnCredentialExistsReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnCredentialExistsReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnCredentialExistsReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnCredentialExistsReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("loginIdentifier").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `loginIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginIdentifier").toString())); - } - // validate the required field `loginIdentifierType` - LoginIdentifierType.validateJsonElement(jsonObj.get("loginIdentifierType")); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the required field `clientInfo` - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnCredentialExistsReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnCredentialExistsReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnCredentialExistsReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnCredentialExistsReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnCredentialExistsReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnCredentialExistsReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnCredentialExistsReq - * @throws IOException if the JSON string is invalid with respect to WebAuthnCredentialExistsReq - */ - public static WebAuthnCredentialExistsReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnCredentialExistsReq.class); - } - - /** - * Convert an instance of WebAuthnCredentialExistsReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsRsp.java deleted file mode 100644 index 4e56360..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnCredentialExistsRsp.java +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnCredentialExistsRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnCredentialExistsRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_EXISTS = "exists"; - @SerializedName(SERIALIZED_NAME_EXISTS) - private Boolean exists; - - public WebAuthnCredentialExistsRsp() { - } - - public WebAuthnCredentialExistsRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebAuthnCredentialExistsRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebAuthnCredentialExistsRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebAuthnCredentialExistsRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebAuthnCredentialExistsRsp exists(Boolean exists) { - this.exists = exists; - return this; - } - - /** - * Get exists - * @return exists - **/ - @javax.annotation.Nonnull - public Boolean getExists() { - return exists; - } - - public void setExists(Boolean exists) { - this.exists = exists; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnCredentialExistsRsp webAuthnCredentialExistsRsp = (WebAuthnCredentialExistsRsp) o; - return Objects.equals(this.httpStatusCode, webAuthnCredentialExistsRsp.httpStatusCode) && - Objects.equals(this.message, webAuthnCredentialExistsRsp.message) && - Objects.equals(this.requestData, webAuthnCredentialExistsRsp.requestData) && - Objects.equals(this.runtime, webAuthnCredentialExistsRsp.runtime) && - Objects.equals(this.exists, webAuthnCredentialExistsRsp.exists); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, exists); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnCredentialExistsRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" exists: ").append(toIndentedString(exists)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("exists"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("exists"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnCredentialExistsRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnCredentialExistsRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnCredentialExistsRsp is not found in the empty JSON string", WebAuthnCredentialExistsRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnCredentialExistsRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnCredentialExistsRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnCredentialExistsRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnCredentialExistsRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnCredentialExistsRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnCredentialExistsRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnCredentialExistsRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnCredentialExistsRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnCredentialExistsRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnCredentialExistsRsp - * @throws IOException if the JSON string is invalid with respect to WebAuthnCredentialExistsRsp - */ - public static WebAuthnCredentialExistsRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnCredentialExistsRsp.class); - } - - /** - * Convert an instance of WebAuthnCredentialExistsRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnCredentialItemRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnCredentialItemRsp.java deleted file mode 100644 index 03195a2..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnCredentialItemRsp.java +++ /dev/null @@ -1,840 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnCredentialItemRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnCredentialItemRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_CREDENTIAL_HASH = "credentialHash"; - @SerializedName(SERIALIZED_NAME_CREDENTIAL_HASH) - private String credentialHash; - - public static final String SERIALIZED_NAME_AAGUID = "aaguid"; - @SerializedName(SERIALIZED_NAME_AAGUID) - private String aaguid; - - public static final String SERIALIZED_NAME_ATTESTATION_TYPE = "attestationType"; - @SerializedName(SERIALIZED_NAME_ATTESTATION_TYPE) - private String attestationType; - - public static final String SERIALIZED_NAME_BACKUP_STATE = "backupState"; - @SerializedName(SERIALIZED_NAME_BACKUP_STATE) - private Boolean backupState; - - public static final String SERIALIZED_NAME_BACKUP_ELIGIBLE = "backupEligible"; - @SerializedName(SERIALIZED_NAME_BACKUP_ELIGIBLE) - private Boolean backupEligible; - - /** - * Gets or Sets transport - */ - @JsonAdapter(TransportEnum.Adapter.class) - public enum TransportEnum { - USB("usb"), - - NFC("nfc"), - - BLE("ble"), - - INTERNAL("internal"), - - HYBRID("hybrid"), - - SMART_CARD("smart-card"); - - private String value; - - TransportEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TransportEnum fromValue(String value) { - for (TransportEnum b : TransportEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TransportEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TransportEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TransportEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TransportEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TRANSPORT = "transport"; - @SerializedName(SERIALIZED_NAME_TRANSPORT) - private List transport = new ArrayList<>(); - - /** - * Status - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - PENDING("pending"), - - ACTIVE("active"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StatusEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_USER_AGENT = "userAgent"; - @SerializedName(SERIALIZED_NAME_USER_AGENT) - private String userAgent; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_AUTHENTICATOR_I_D = "authenticatorID"; - @SerializedName(SERIALIZED_NAME_AUTHENTICATOR_I_D) - private String authenticatorID; - - public static final String SERIALIZED_NAME_AUTHENTICATOR_NAME = "authenticatorName"; - @SerializedName(SERIALIZED_NAME_AUTHENTICATOR_NAME) - private String authenticatorName; - - public static final String SERIALIZED_NAME_LAST_USED = "lastUsed"; - @SerializedName(SERIALIZED_NAME_LAST_USED) - private String lastUsed; - - public static final String SERIALIZED_NAME_LAST_USED_DEVICE_NAME = "lastUsedDeviceName"; - @SerializedName(SERIALIZED_NAME_LAST_USED_DEVICE_NAME) - private String lastUsedDeviceName; - - public WebAuthnCredentialItemRsp() { - } - - public WebAuthnCredentialItemRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebAuthnCredentialItemRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebAuthnCredentialItemRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebAuthnCredentialItemRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebAuthnCredentialItemRsp id(String id) { - this.id = id; - return this; - } - - /** - * Credential ID - * @return id - **/ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public WebAuthnCredentialItemRsp credentialHash(String credentialHash) { - this.credentialHash = credentialHash; - return this; - } - - /** - * Get credentialHash - * @return credentialHash - **/ - @javax.annotation.Nonnull - public String getCredentialHash() { - return credentialHash; - } - - public void setCredentialHash(String credentialHash) { - this.credentialHash = credentialHash; - } - - - public WebAuthnCredentialItemRsp aaguid(String aaguid) { - this.aaguid = aaguid; - return this; - } - - /** - * Get aaguid - * @return aaguid - **/ - @javax.annotation.Nonnull - public String getAaguid() { - return aaguid; - } - - public void setAaguid(String aaguid) { - this.aaguid = aaguid; - } - - - public WebAuthnCredentialItemRsp attestationType(String attestationType) { - this.attestationType = attestationType; - return this; - } - - /** - * Get attestationType - * @return attestationType - **/ - @javax.annotation.Nonnull - public String getAttestationType() { - return attestationType; - } - - public void setAttestationType(String attestationType) { - this.attestationType = attestationType; - } - - - public WebAuthnCredentialItemRsp backupState(Boolean backupState) { - this.backupState = backupState; - return this; - } - - /** - * Backup state - * @return backupState - **/ - @javax.annotation.Nullable - public Boolean getBackupState() { - return backupState; - } - - public void setBackupState(Boolean backupState) { - this.backupState = backupState; - } - - - public WebAuthnCredentialItemRsp backupEligible(Boolean backupEligible) { - this.backupEligible = backupEligible; - return this; - } - - /** - * Backup eligible - * @return backupEligible - **/ - @javax.annotation.Nonnull - public Boolean getBackupEligible() { - return backupEligible; - } - - public void setBackupEligible(Boolean backupEligible) { - this.backupEligible = backupEligible; - } - - - public WebAuthnCredentialItemRsp transport(List transport) { - this.transport = transport; - return this; - } - - public WebAuthnCredentialItemRsp addTransportItem(TransportEnum transportItem) { - if (this.transport == null) { - this.transport = new ArrayList<>(); - } - this.transport.add(transportItem); - return this; - } - - /** - * Transport - * @return transport - **/ - @javax.annotation.Nonnull - public List getTransport() { - return transport; - } - - public void setTransport(List transport) { - this.transport = transport; - } - - - public WebAuthnCredentialItemRsp status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Status - * @return status - **/ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - - public WebAuthnCredentialItemRsp userAgent(String userAgent) { - this.userAgent = userAgent; - return this; - } - - /** - * User agent - * @return userAgent - **/ - @javax.annotation.Nonnull - public String getUserAgent() { - return userAgent; - } - - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } - - - public WebAuthnCredentialItemRsp created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public WebAuthnCredentialItemRsp authenticatorID(String authenticatorID) { - this.authenticatorID = authenticatorID; - return this; - } - - /** - * Authenticator ID - * @return authenticatorID - **/ - @javax.annotation.Nonnull - public String getAuthenticatorID() { - return authenticatorID; - } - - public void setAuthenticatorID(String authenticatorID) { - this.authenticatorID = authenticatorID; - } - - - public WebAuthnCredentialItemRsp authenticatorName(String authenticatorName) { - this.authenticatorName = authenticatorName; - return this; - } - - /** - * Get authenticatorName - * @return authenticatorName - **/ - @javax.annotation.Nonnull - public String getAuthenticatorName() { - return authenticatorName; - } - - public void setAuthenticatorName(String authenticatorName) { - this.authenticatorName = authenticatorName; - } - - - public WebAuthnCredentialItemRsp lastUsed(String lastUsed) { - this.lastUsed = lastUsed; - return this; - } - - /** - * Timestamp of when the passkey was last used in yyyy-MM-dd'T'HH:mm:ss format - * @return lastUsed - **/ - @javax.annotation.Nonnull - public String getLastUsed() { - return lastUsed; - } - - public void setLastUsed(String lastUsed) { - this.lastUsed = lastUsed; - } - - - public WebAuthnCredentialItemRsp lastUsedDeviceName(String lastUsedDeviceName) { - this.lastUsedDeviceName = lastUsedDeviceName; - return this; - } - - /** - * Get lastUsedDeviceName - * @return lastUsedDeviceName - **/ - @javax.annotation.Nonnull - public String getLastUsedDeviceName() { - return lastUsedDeviceName; - } - - public void setLastUsedDeviceName(String lastUsedDeviceName) { - this.lastUsedDeviceName = lastUsedDeviceName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnCredentialItemRsp webAuthnCredentialItemRsp = (WebAuthnCredentialItemRsp) o; - return Objects.equals(this.httpStatusCode, webAuthnCredentialItemRsp.httpStatusCode) && - Objects.equals(this.message, webAuthnCredentialItemRsp.message) && - Objects.equals(this.requestData, webAuthnCredentialItemRsp.requestData) && - Objects.equals(this.runtime, webAuthnCredentialItemRsp.runtime) && - Objects.equals(this.id, webAuthnCredentialItemRsp.id) && - Objects.equals(this.credentialHash, webAuthnCredentialItemRsp.credentialHash) && - Objects.equals(this.aaguid, webAuthnCredentialItemRsp.aaguid) && - Objects.equals(this.attestationType, webAuthnCredentialItemRsp.attestationType) && - Objects.equals(this.backupState, webAuthnCredentialItemRsp.backupState) && - Objects.equals(this.backupEligible, webAuthnCredentialItemRsp.backupEligible) && - Objects.equals(this.transport, webAuthnCredentialItemRsp.transport) && - Objects.equals(this.status, webAuthnCredentialItemRsp.status) && - Objects.equals(this.userAgent, webAuthnCredentialItemRsp.userAgent) && - Objects.equals(this.created, webAuthnCredentialItemRsp.created) && - Objects.equals(this.authenticatorID, webAuthnCredentialItemRsp.authenticatorID) && - Objects.equals(this.authenticatorName, webAuthnCredentialItemRsp.authenticatorName) && - Objects.equals(this.lastUsed, webAuthnCredentialItemRsp.lastUsed) && - Objects.equals(this.lastUsedDeviceName, webAuthnCredentialItemRsp.lastUsedDeviceName); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, id, credentialHash, aaguid, attestationType, backupState, backupEligible, transport, status, userAgent, created, authenticatorID, authenticatorName, lastUsed, lastUsedDeviceName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnCredentialItemRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" credentialHash: ").append(toIndentedString(credentialHash)).append("\n"); - sb.append(" aaguid: ").append(toIndentedString(aaguid)).append("\n"); - sb.append(" attestationType: ").append(toIndentedString(attestationType)).append("\n"); - sb.append(" backupState: ").append(toIndentedString(backupState)).append("\n"); - sb.append(" backupEligible: ").append(toIndentedString(backupEligible)).append("\n"); - sb.append(" transport: ").append(toIndentedString(transport)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" userAgent: ").append(toIndentedString(userAgent)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" authenticatorID: ").append(toIndentedString(authenticatorID)).append("\n"); - sb.append(" authenticatorName: ").append(toIndentedString(authenticatorName)).append("\n"); - sb.append(" lastUsed: ").append(toIndentedString(lastUsed)).append("\n"); - sb.append(" lastUsedDeviceName: ").append(toIndentedString(lastUsedDeviceName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("id"); - openapiFields.add("credentialHash"); - openapiFields.add("aaguid"); - openapiFields.add("attestationType"); - openapiFields.add("backupState"); - openapiFields.add("backupEligible"); - openapiFields.add("transport"); - openapiFields.add("status"); - openapiFields.add("userAgent"); - openapiFields.add("created"); - openapiFields.add("authenticatorID"); - openapiFields.add("authenticatorName"); - openapiFields.add("lastUsed"); - openapiFields.add("lastUsedDeviceName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("credentialHash"); - openapiRequiredFields.add("aaguid"); - openapiRequiredFields.add("attestationType"); - openapiRequiredFields.add("backupEligible"); - openapiRequiredFields.add("transport"); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("userAgent"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("authenticatorID"); - openapiRequiredFields.add("authenticatorName"); - openapiRequiredFields.add("lastUsed"); - openapiRequiredFields.add("lastUsedDeviceName"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnCredentialItemRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnCredentialItemRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnCredentialItemRsp is not found in the empty JSON string", WebAuthnCredentialItemRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnCredentialItemRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnCredentialItemRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnCredentialItemRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("credentialHash").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `credentialHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialHash").toString())); - } - if (!jsonObj.get("aaguid").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `aaguid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aaguid").toString())); - } - if (!jsonObj.get("attestationType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `attestationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attestationType").toString())); - } - // ensure the required json array is present - if (jsonObj.get("transport") == null) { - throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); - } else if (!jsonObj.get("transport").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `transport` to be an array in the JSON string but got `%s`", jsonObj.get("transport").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // validate the required field `status` - StatusEnum.validateJsonElement(jsonObj.get("status")); - if (!jsonObj.get("userAgent").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userAgent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userAgent").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("authenticatorID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authenticatorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticatorID").toString())); - } - if (!jsonObj.get("authenticatorName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authenticatorName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticatorName").toString())); - } - if (!jsonObj.get("lastUsed").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastUsed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUsed").toString())); - } - if (!jsonObj.get("lastUsedDeviceName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastUsedDeviceName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastUsedDeviceName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnCredentialItemRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnCredentialItemRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnCredentialItemRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnCredentialItemRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnCredentialItemRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnCredentialItemRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnCredentialItemRsp - * @throws IOException if the JSON string is invalid with respect to WebAuthnCredentialItemRsp - */ - public static WebAuthnCredentialItemRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnCredentialItemRsp.class); - } - - /** - * Convert an instance of WebAuthnCredentialItemRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnCredentialListRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnCredentialListRsp.java deleted file mode 100644 index d636758..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnCredentialListRsp.java +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.WebAuthnCredentialItemRsp; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnCredentialListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnCredentialListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_ROWS = "rows"; - @SerializedName(SERIALIZED_NAME_ROWS) - private List rows = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public WebAuthnCredentialListRsp() { - } - - public WebAuthnCredentialListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebAuthnCredentialListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebAuthnCredentialListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebAuthnCredentialListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebAuthnCredentialListRsp rows(List rows) { - this.rows = rows; - return this; - } - - public WebAuthnCredentialListRsp addRowsItem(WebAuthnCredentialItemRsp rowsItem) { - if (this.rows == null) { - this.rows = new ArrayList<>(); - } - this.rows.add(rowsItem); - return this; - } - - /** - * Get rows - * @return rows - **/ - @javax.annotation.Nonnull - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - - public WebAuthnCredentialListRsp paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnCredentialListRsp webAuthnCredentialListRsp = (WebAuthnCredentialListRsp) o; - return Objects.equals(this.httpStatusCode, webAuthnCredentialListRsp.httpStatusCode) && - Objects.equals(this.message, webAuthnCredentialListRsp.message) && - Objects.equals(this.requestData, webAuthnCredentialListRsp.requestData) && - Objects.equals(this.runtime, webAuthnCredentialListRsp.runtime) && - Objects.equals(this.rows, webAuthnCredentialListRsp.rows) && - Objects.equals(this.paging, webAuthnCredentialListRsp.paging); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, rows, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnCredentialListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("rows"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("rows"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnCredentialListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnCredentialListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnCredentialListRsp is not found in the empty JSON string", WebAuthnCredentialListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnCredentialListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnCredentialListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnCredentialListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // ensure the json data is an array - if (!jsonObj.get("rows").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rows` to be an array in the JSON string but got `%s`", jsonObj.get("rows").toString())); - } - - JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); - // validate the required field `rows` (array) - for (int i = 0; i < jsonArrayrows.size(); i++) { - WebAuthnCredentialItemRsp.validateJsonElement(jsonArrayrows.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnCredentialListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnCredentialListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnCredentialListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnCredentialListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnCredentialListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnCredentialListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnCredentialListRsp - * @throws IOException if the JSON string is invalid with respect to WebAuthnCredentialListRsp - */ - public static WebAuthnCredentialListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnCredentialListRsp.class); - } - - /** - * Convert an instance of WebAuthnCredentialListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnCredentialReq.java b/src/main/java/com/corbado/generated/model/WebAuthnCredentialReq.java deleted file mode 100644 index 565e335..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnCredentialReq.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnCredentialReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnCredentialReq { - /** - * Gets or Sets status - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - PENDING("pending"), - - ACTIVE("active"), - - DELETED("deleted"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StatusEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public WebAuthnCredentialReq() { - } - - public WebAuthnCredentialReq status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Get status - * @return status - **/ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - - public WebAuthnCredentialReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public WebAuthnCredentialReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnCredentialReq webAuthnCredentialReq = (WebAuthnCredentialReq) o; - return Objects.equals(this.status, webAuthnCredentialReq.status) && - Objects.equals(this.requestID, webAuthnCredentialReq.requestID) && - Objects.equals(this.clientInfo, webAuthnCredentialReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(status, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnCredentialReq {\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("status"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnCredentialReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnCredentialReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnCredentialReq is not found in the empty JSON string", WebAuthnCredentialReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnCredentialReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnCredentialReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnCredentialReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // validate the required field `status` - StatusEnum.validateJsonElement(jsonObj.get("status")); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnCredentialReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnCredentialReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnCredentialReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnCredentialReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnCredentialReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnCredentialReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnCredentialReq - * @throws IOException if the JSON string is invalid with respect to WebAuthnCredentialReq - */ - public static WebAuthnCredentialReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnCredentialReq.class); - } - - /** - * Convert an instance of WebAuthnCredentialReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnCredentialRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnCredentialRsp.java deleted file mode 100644 index a985f4b..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnCredentialRsp.java +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnCredentialRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnCredentialRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - /** - * Status - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - PENDING("pending"), - - ACTIVE("active"), - - DELETED("deleted"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StatusEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public WebAuthnCredentialRsp() { - } - - public WebAuthnCredentialRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebAuthnCredentialRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebAuthnCredentialRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebAuthnCredentialRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebAuthnCredentialRsp status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Status - * @return status - **/ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnCredentialRsp webAuthnCredentialRsp = (WebAuthnCredentialRsp) o; - return Objects.equals(this.httpStatusCode, webAuthnCredentialRsp.httpStatusCode) && - Objects.equals(this.message, webAuthnCredentialRsp.message) && - Objects.equals(this.requestData, webAuthnCredentialRsp.requestData) && - Objects.equals(this.runtime, webAuthnCredentialRsp.runtime) && - Objects.equals(this.status, webAuthnCredentialRsp.status); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnCredentialRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnCredentialRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnCredentialRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnCredentialRsp is not found in the empty JSON string", WebAuthnCredentialRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnCredentialRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnCredentialRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnCredentialRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // validate the required field `status` - StatusEnum.validateJsonElement(jsonObj.get("status")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnCredentialRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnCredentialRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnCredentialRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnCredentialRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnCredentialRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnCredentialRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnCredentialRsp - * @throws IOException if the JSON string is invalid with respect to WebAuthnCredentialRsp - */ - public static WebAuthnCredentialRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnCredentialRsp.class); - } - - /** - * Convert an instance of WebAuthnCredentialRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnFinishReq.java b/src/main/java/com/corbado/generated/model/WebAuthnFinishReq.java deleted file mode 100644 index 54369d7..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnFinishReq.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnFinishReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnFinishReq { - public static final String SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL = "publicKeyCredential"; - @SerializedName(SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL) - private String publicKeyCredential; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public WebAuthnFinishReq() { - } - - public WebAuthnFinishReq publicKeyCredential(String publicKeyCredential) { - this.publicKeyCredential = publicKeyCredential; - return this; - } - - /** - * Contains JSON payload data for Passkeys (Biometrics) login finish challenge - * @return publicKeyCredential - **/ - @javax.annotation.Nonnull - public String getPublicKeyCredential() { - return publicKeyCredential; - } - - public void setPublicKeyCredential(String publicKeyCredential) { - this.publicKeyCredential = publicKeyCredential; - } - - - public WebAuthnFinishReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public WebAuthnFinishReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nonnull - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnFinishReq webAuthnFinishReq = (WebAuthnFinishReq) o; - return Objects.equals(this.publicKeyCredential, webAuthnFinishReq.publicKeyCredential) && - Objects.equals(this.requestID, webAuthnFinishReq.requestID) && - Objects.equals(this.clientInfo, webAuthnFinishReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(publicKeyCredential, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnFinishReq {\n"); - sb.append(" publicKeyCredential: ").append(toIndentedString(publicKeyCredential)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("publicKeyCredential"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("publicKeyCredential"); - openapiRequiredFields.add("clientInfo"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnFinishReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnFinishReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnFinishReq is not found in the empty JSON string", WebAuthnFinishReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnFinishReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnFinishReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnFinishReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("publicKeyCredential").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `publicKeyCredential` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKeyCredential").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the required field `clientInfo` - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnFinishReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnFinishReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnFinishReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnFinishReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnFinishReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnFinishReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnFinishReq - * @throws IOException if the JSON string is invalid with respect to WebAuthnFinishReq - */ - public static WebAuthnFinishReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnFinishReq.class); - } - - /** - * Convert an instance of WebAuthnFinishReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnMediationStartReq.java b/src/main/java/com/corbado/generated/model/WebAuthnMediationStartReq.java deleted file mode 100644 index 2f5a22d..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnMediationStartReq.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnMediationStartReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnMediationStartReq { - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private String username; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public WebAuthnMediationStartReq() { - } - - public WebAuthnMediationStartReq username(String username) { - this.username = username; - return this; - } - - /** - * Optional limits possible credentials matching to username - * @return username - **/ - @javax.annotation.Nullable - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - - public WebAuthnMediationStartReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public WebAuthnMediationStartReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nonnull - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnMediationStartReq webAuthnMediationStartReq = (WebAuthnMediationStartReq) o; - return Objects.equals(this.username, webAuthnMediationStartReq.username) && - Objects.equals(this.requestID, webAuthnMediationStartReq.requestID) && - Objects.equals(this.clientInfo, webAuthnMediationStartReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(username, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnMediationStartReq {\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("username"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("clientInfo"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnMediationStartReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnMediationStartReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnMediationStartReq is not found in the empty JSON string", WebAuthnMediationStartReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnMediationStartReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnMediationStartReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnMediationStartReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the required field `clientInfo` - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnMediationStartReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnMediationStartReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnMediationStartReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnMediationStartReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnMediationStartReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnMediationStartReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnMediationStartReq - * @throws IOException if the JSON string is invalid with respect to WebAuthnMediationStartReq - */ - public static WebAuthnMediationStartReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnMediationStartReq.class); - } - - /** - * Convert an instance of WebAuthnMediationStartReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnMediationStartRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnMediationStartRsp.java deleted file mode 100644 index 61b5b6b..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnMediationStartRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnMediationStartRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnMediationStartRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_CHALLENGE = "challenge"; - @SerializedName(SERIALIZED_NAME_CHALLENGE) - private String challenge; - - public WebAuthnMediationStartRsp() { - } - - public WebAuthnMediationStartRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebAuthnMediationStartRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebAuthnMediationStartRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebAuthnMediationStartRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebAuthnMediationStartRsp challenge(String challenge) { - this.challenge = challenge; - return this; - } - - /** - * Contains JSON payload data to start Passkeys (Biometrics) login challenge - * @return challenge - **/ - @javax.annotation.Nonnull - public String getChallenge() { - return challenge; - } - - public void setChallenge(String challenge) { - this.challenge = challenge; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnMediationStartRsp webAuthnMediationStartRsp = (WebAuthnMediationStartRsp) o; - return Objects.equals(this.httpStatusCode, webAuthnMediationStartRsp.httpStatusCode) && - Objects.equals(this.message, webAuthnMediationStartRsp.message) && - Objects.equals(this.requestData, webAuthnMediationStartRsp.requestData) && - Objects.equals(this.runtime, webAuthnMediationStartRsp.runtime) && - Objects.equals(this.challenge, webAuthnMediationStartRsp.challenge); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, challenge); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnMediationStartRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" challenge: ").append(toIndentedString(challenge)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("challenge"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("challenge"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnMediationStartRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnMediationStartRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnMediationStartRsp is not found in the empty JSON string", WebAuthnMediationStartRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnMediationStartRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnMediationStartRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnMediationStartRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("challenge").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `challenge` to be a primitive type in the JSON string but got `%s`", jsonObj.get("challenge").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnMediationStartRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnMediationStartRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnMediationStartRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnMediationStartRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnMediationStartRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnMediationStartRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnMediationStartRsp - * @throws IOException if the JSON string is invalid with respect to WebAuthnMediationStartRsp - */ - public static WebAuthnMediationStartRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnMediationStartRsp.class); - } - - /** - * Convert an instance of WebAuthnMediationStartRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnRegisterFinishRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnRegisterFinishRsp.java deleted file mode 100644 index 0ba5ad3..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnRegisterFinishRsp.java +++ /dev/null @@ -1,503 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnRegisterFinishRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnRegisterFinishRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_USER_I_D = "userID"; - @SerializedName(SERIALIZED_NAME_USER_I_D) - private String userID; - - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private String username; - - public static final String SERIALIZED_NAME_CREDENTIAL_I_D = "credentialID"; - @SerializedName(SERIALIZED_NAME_CREDENTIAL_I_D) - private String credentialID; - - public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; - @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) - private String userFullName; - - /** - * Status represents information if user sign up was successful or if the user with provided credentials already exists - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("success"), - - DUPLICATE("duplicate"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StatusEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public WebAuthnRegisterFinishRsp() { - } - - public WebAuthnRegisterFinishRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebAuthnRegisterFinishRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebAuthnRegisterFinishRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebAuthnRegisterFinishRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebAuthnRegisterFinishRsp userID(String userID) { - this.userID = userID; - return this; - } - - /** - * ID of the user - * @return userID - **/ - @javax.annotation.Nonnull - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - - public WebAuthnRegisterFinishRsp username(String username) { - this.username = username; - return this; - } - - /** - * Username of current challenge - * @return username - **/ - @javax.annotation.Nonnull - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - - public WebAuthnRegisterFinishRsp credentialID(String credentialID) { - this.credentialID = credentialID; - return this; - } - - /** - * Used credential ID - * @return credentialID - **/ - @javax.annotation.Nonnull - public String getCredentialID() { - return credentialID; - } - - public void setCredentialID(String credentialID) { - this.credentialID = credentialID; - } - - - public WebAuthnRegisterFinishRsp userFullName(String userFullName) { - this.userFullName = userFullName; - return this; - } - - /** - * Optional user's full name to be used if the user wasn't found and needs to be created first - * @return userFullName - **/ - @javax.annotation.Nullable - public String getUserFullName() { - return userFullName; - } - - public void setUserFullName(String userFullName) { - this.userFullName = userFullName; - } - - - public WebAuthnRegisterFinishRsp status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Status represents information if user sign up was successful or if the user with provided credentials already exists - * @return status - **/ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnRegisterFinishRsp webAuthnRegisterFinishRsp = (WebAuthnRegisterFinishRsp) o; - return Objects.equals(this.httpStatusCode, webAuthnRegisterFinishRsp.httpStatusCode) && - Objects.equals(this.message, webAuthnRegisterFinishRsp.message) && - Objects.equals(this.requestData, webAuthnRegisterFinishRsp.requestData) && - Objects.equals(this.runtime, webAuthnRegisterFinishRsp.runtime) && - Objects.equals(this.userID, webAuthnRegisterFinishRsp.userID) && - Objects.equals(this.username, webAuthnRegisterFinishRsp.username) && - Objects.equals(this.credentialID, webAuthnRegisterFinishRsp.credentialID) && - Objects.equals(this.userFullName, webAuthnRegisterFinishRsp.userFullName) && - Objects.equals(this.status, webAuthnRegisterFinishRsp.status); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, userID, username, credentialID, userFullName, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnRegisterFinishRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" credentialID: ").append(toIndentedString(credentialID)).append("\n"); - sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("userID"); - openapiFields.add("username"); - openapiFields.add("credentialID"); - openapiFields.add("userFullName"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("userID"); - openapiRequiredFields.add("username"); - openapiRequiredFields.add("credentialID"); - openapiRequiredFields.add("status"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnRegisterFinishRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnRegisterFinishRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnRegisterFinishRsp is not found in the empty JSON string", WebAuthnRegisterFinishRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnRegisterFinishRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnRegisterFinishRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnRegisterFinishRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("userID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userID").toString())); - } - if (!jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); - } - if (!jsonObj.get("credentialID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `credentialID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialID").toString())); - } - if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); - } - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // validate the required field `status` - StatusEnum.validateJsonElement(jsonObj.get("status")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnRegisterFinishRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnRegisterFinishRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnRegisterFinishRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnRegisterFinishRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnRegisterFinishRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnRegisterFinishRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnRegisterFinishRsp - * @throws IOException if the JSON string is invalid with respect to WebAuthnRegisterFinishRsp - */ - public static WebAuthnRegisterFinishRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnRegisterFinishRsp.class); - } - - /** - * Convert an instance of WebAuthnRegisterFinishRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnRegisterStartReq.java b/src/main/java/com/corbado/generated/model/WebAuthnRegisterStartReq.java deleted file mode 100644 index 55e4291..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnRegisterStartReq.java +++ /dev/null @@ -1,387 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnRegisterStartReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnRegisterStartReq { - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private String username; - - public static final String SERIALIZED_NAME_USER_FULL_NAME = "userFullName"; - @SerializedName(SERIALIZED_NAME_USER_FULL_NAME) - private String userFullName; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - /** - * Sets credential status into active and pending. Pending status dont allow a login until the credential gets confirmed by an api call. - */ - @JsonAdapter(CredentialStatusEnum.Adapter.class) - public enum CredentialStatusEnum { - ACTIVE("active"), - - PENDING("pending"); - - private String value; - - CredentialStatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static CredentialStatusEnum fromValue(String value) { - for (CredentialStatusEnum b : CredentialStatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final CredentialStatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CredentialStatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return CredentialStatusEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - CredentialStatusEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_CREDENTIAL_STATUS = "credentialStatus"; - @SerializedName(SERIALIZED_NAME_CREDENTIAL_STATUS) - private CredentialStatusEnum credentialStatus = CredentialStatusEnum.PENDING; - - public WebAuthnRegisterStartReq() { - } - - public WebAuthnRegisterStartReq username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @javax.annotation.Nonnull - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - - public WebAuthnRegisterStartReq userFullName(String userFullName) { - this.userFullName = userFullName; - return this; - } - - /** - * Optional user's full name to be used if the user wasn't found and needs to be created first - * @return userFullName - **/ - @javax.annotation.Nullable - public String getUserFullName() { - return userFullName; - } - - public void setUserFullName(String userFullName) { - this.userFullName = userFullName; - } - - - public WebAuthnRegisterStartReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public WebAuthnRegisterStartReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nonnull - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - public WebAuthnRegisterStartReq credentialStatus(CredentialStatusEnum credentialStatus) { - this.credentialStatus = credentialStatus; - return this; - } - - /** - * Sets credential status into active and pending. Pending status dont allow a login until the credential gets confirmed by an api call. - * @return credentialStatus - **/ - @javax.annotation.Nullable - public CredentialStatusEnum getCredentialStatus() { - return credentialStatus; - } - - public void setCredentialStatus(CredentialStatusEnum credentialStatus) { - this.credentialStatus = credentialStatus; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnRegisterStartReq webAuthnRegisterStartReq = (WebAuthnRegisterStartReq) o; - return Objects.equals(this.username, webAuthnRegisterStartReq.username) && - Objects.equals(this.userFullName, webAuthnRegisterStartReq.userFullName) && - Objects.equals(this.requestID, webAuthnRegisterStartReq.requestID) && - Objects.equals(this.clientInfo, webAuthnRegisterStartReq.clientInfo) && - Objects.equals(this.credentialStatus, webAuthnRegisterStartReq.credentialStatus); - } - - @Override - public int hashCode() { - return Objects.hash(username, userFullName, requestID, clientInfo, credentialStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnRegisterStartReq {\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" userFullName: ").append(toIndentedString(userFullName)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append(" credentialStatus: ").append(toIndentedString(credentialStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("username"); - openapiFields.add("userFullName"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - openapiFields.add("credentialStatus"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("username"); - openapiRequiredFields.add("clientInfo"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnRegisterStartReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnRegisterStartReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnRegisterStartReq is not found in the empty JSON string", WebAuthnRegisterStartReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnRegisterStartReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnRegisterStartReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnRegisterStartReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); - } - if ((jsonObj.get("userFullName") != null && !jsonObj.get("userFullName").isJsonNull()) && !jsonObj.get("userFullName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userFullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userFullName").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the required field `clientInfo` - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - if ((jsonObj.get("credentialStatus") != null && !jsonObj.get("credentialStatus").isJsonNull()) && !jsonObj.get("credentialStatus").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `credentialStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialStatus").toString())); - } - // validate the optional field `credentialStatus` - if (jsonObj.get("credentialStatus") != null && !jsonObj.get("credentialStatus").isJsonNull()) { - CredentialStatusEnum.validateJsonElement(jsonObj.get("credentialStatus")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnRegisterStartReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnRegisterStartReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnRegisterStartReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnRegisterStartReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnRegisterStartReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnRegisterStartReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnRegisterStartReq - * @throws IOException if the JSON string is invalid with respect to WebAuthnRegisterStartReq - */ - public static WebAuthnRegisterStartReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnRegisterStartReq.class); - } - - /** - * Convert an instance of WebAuthnRegisterStartReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebAuthnRegisterStartRsp.java b/src/main/java/com/corbado/generated/model/WebAuthnRegisterStartRsp.java deleted file mode 100644 index 2a5a841..0000000 --- a/src/main/java/com/corbado/generated/model/WebAuthnRegisterStartRsp.java +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebAuthnRegisterStartRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebAuthnRegisterStartRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - /** - * Status represents information if user signup was successful or the user with its credentials already exists - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - SUCCESS("success"), - - DUPLICATE("duplicate"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - StatusEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public static final String SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL_CREATION_OPTIONS = "publicKeyCredentialCreationOptions"; - @SerializedName(SERIALIZED_NAME_PUBLIC_KEY_CREDENTIAL_CREATION_OPTIONS) - private String publicKeyCredentialCreationOptions; - - public WebAuthnRegisterStartRsp() { - } - - public WebAuthnRegisterStartRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebAuthnRegisterStartRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebAuthnRegisterStartRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebAuthnRegisterStartRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebAuthnRegisterStartRsp status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Status represents information if user signup was successful or the user with its credentials already exists - * @return status - **/ - @javax.annotation.Nonnull - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - - public WebAuthnRegisterStartRsp publicKeyCredentialCreationOptions(String publicKeyCredentialCreationOptions) { - this.publicKeyCredentialCreationOptions = publicKeyCredentialCreationOptions; - return this; - } - - /** - * Contains JSON payload data to start Passkeys (Biometrics) sign up challenge - * @return publicKeyCredentialCreationOptions - **/ - @javax.annotation.Nonnull - public String getPublicKeyCredentialCreationOptions() { - return publicKeyCredentialCreationOptions; - } - - public void setPublicKeyCredentialCreationOptions(String publicKeyCredentialCreationOptions) { - this.publicKeyCredentialCreationOptions = publicKeyCredentialCreationOptions; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebAuthnRegisterStartRsp webAuthnRegisterStartRsp = (WebAuthnRegisterStartRsp) o; - return Objects.equals(this.httpStatusCode, webAuthnRegisterStartRsp.httpStatusCode) && - Objects.equals(this.message, webAuthnRegisterStartRsp.message) && - Objects.equals(this.requestData, webAuthnRegisterStartRsp.requestData) && - Objects.equals(this.runtime, webAuthnRegisterStartRsp.runtime) && - Objects.equals(this.status, webAuthnRegisterStartRsp.status) && - Objects.equals(this.publicKeyCredentialCreationOptions, webAuthnRegisterStartRsp.publicKeyCredentialCreationOptions); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, status, publicKeyCredentialCreationOptions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebAuthnRegisterStartRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" publicKeyCredentialCreationOptions: ").append(toIndentedString(publicKeyCredentialCreationOptions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("status"); - openapiFields.add("publicKeyCredentialCreationOptions"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("publicKeyCredentialCreationOptions"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebAuthnRegisterStartRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebAuthnRegisterStartRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebAuthnRegisterStartRsp is not found in the empty JSON string", WebAuthnRegisterStartRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebAuthnRegisterStartRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebAuthnRegisterStartRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebAuthnRegisterStartRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - // validate the required field `status` - StatusEnum.validateJsonElement(jsonObj.get("status")); - if (!jsonObj.get("publicKeyCredentialCreationOptions").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `publicKeyCredentialCreationOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKeyCredentialCreationOptions").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebAuthnRegisterStartRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebAuthnRegisterStartRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebAuthnRegisterStartRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebAuthnRegisterStartRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebAuthnRegisterStartRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebAuthnRegisterStartRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebAuthnRegisterStartRsp - * @throws IOException if the JSON string is invalid with respect to WebAuthnRegisterStartRsp - */ - public static WebAuthnRegisterStartRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebAuthnRegisterStartRsp.class); - } - - /** - * Convert an instance of WebAuthnRegisterStartRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingCreate.java b/src/main/java/com/corbado/generated/model/WebauthnSettingCreate.java deleted file mode 100644 index 5a06738..0000000 --- a/src/main/java/com/corbado/generated/model/WebauthnSettingCreate.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebauthnSettingCreate - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebauthnSettingCreate { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ORIGIN = "origin"; - @SerializedName(SERIALIZED_NAME_ORIGIN) - private String origin; - - public WebauthnSettingCreate() { - } - - public WebauthnSettingCreate name(String name) { - this.name = name; - return this; - } - - /** - * Name of this setting - * @return name - **/ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public WebauthnSettingCreate origin(String origin) { - this.origin = origin; - return this; - } - - /** - * Define here either a url incl. schema or an android-apk-key-hash - * @return origin - **/ - @javax.annotation.Nonnull - public String getOrigin() { - return origin; - } - - public void setOrigin(String origin) { - this.origin = origin; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebauthnSettingCreate webauthnSettingCreate = (WebauthnSettingCreate) o; - return Objects.equals(this.name, webauthnSettingCreate.name) && - Objects.equals(this.origin, webauthnSettingCreate.origin); - } - - @Override - public int hashCode() { - return Objects.hash(name, origin); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebauthnSettingCreate {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("origin"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("origin"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingCreate - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebauthnSettingCreate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingCreate is not found in the empty JSON string", WebauthnSettingCreate.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebauthnSettingCreate.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingCreate` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebauthnSettingCreate.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("origin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebauthnSettingCreate.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebauthnSettingCreate' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingCreate.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebauthnSettingCreate value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebauthnSettingCreate read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebauthnSettingCreate given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebauthnSettingCreate - * @throws IOException if the JSON string is invalid with respect to WebauthnSettingCreate - */ - public static WebauthnSettingCreate fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebauthnSettingCreate.class); - } - - /** - * Convert an instance of WebauthnSettingCreate to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingCreateReq.java b/src/main/java/com/corbado/generated/model/WebauthnSettingCreateReq.java deleted file mode 100644 index 1b226a5..0000000 --- a/src/main/java/com/corbado/generated/model/WebauthnSettingCreateReq.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebauthnSettingCreateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebauthnSettingCreateReq { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ORIGIN = "origin"; - @SerializedName(SERIALIZED_NAME_ORIGIN) - private String origin; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public WebauthnSettingCreateReq() { - } - - public WebauthnSettingCreateReq name(String name) { - this.name = name; - return this; - } - - /** - * Name of this setting - * @return name - **/ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public WebauthnSettingCreateReq origin(String origin) { - this.origin = origin; - return this; - } - - /** - * Define here either a url incl. schema or an android-apk-key-hash - * @return origin - **/ - @javax.annotation.Nonnull - public String getOrigin() { - return origin; - } - - public void setOrigin(String origin) { - this.origin = origin; - } - - - public WebauthnSettingCreateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public WebauthnSettingCreateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebauthnSettingCreateReq webauthnSettingCreateReq = (WebauthnSettingCreateReq) o; - return Objects.equals(this.name, webauthnSettingCreateReq.name) && - Objects.equals(this.origin, webauthnSettingCreateReq.origin) && - Objects.equals(this.requestID, webauthnSettingCreateReq.requestID) && - Objects.equals(this.clientInfo, webauthnSettingCreateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(name, origin, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebauthnSettingCreateReq {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("origin"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("origin"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingCreateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebauthnSettingCreateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingCreateReq is not found in the empty JSON string", WebauthnSettingCreateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebauthnSettingCreateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingCreateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebauthnSettingCreateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("origin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebauthnSettingCreateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebauthnSettingCreateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingCreateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebauthnSettingCreateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebauthnSettingCreateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebauthnSettingCreateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebauthnSettingCreateReq - * @throws IOException if the JSON string is invalid with respect to WebauthnSettingCreateReq - */ - public static WebauthnSettingCreateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebauthnSettingCreateReq.class); - } - - /** - * Convert an instance of WebauthnSettingCreateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingCreateRsp.java b/src/main/java/com/corbado/generated/model/WebauthnSettingCreateRsp.java deleted file mode 100644 index 100b011..0000000 --- a/src/main/java/com/corbado/generated/model/WebauthnSettingCreateRsp.java +++ /dev/null @@ -1,450 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebauthnSettingCreateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebauthnSettingCreateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ORIGIN = "origin"; - @SerializedName(SERIALIZED_NAME_ORIGIN) - private String origin; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public WebauthnSettingCreateRsp() { - } - - public WebauthnSettingCreateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebauthnSettingCreateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebauthnSettingCreateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebauthnSettingCreateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebauthnSettingCreateRsp name(String name) { - this.name = name; - return this; - } - - /** - * Name of this setting - * @return name - **/ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public WebauthnSettingCreateRsp origin(String origin) { - this.origin = origin; - return this; - } - - /** - * Define here either a url incl. schema or an android-apk-key-hash - * @return origin - **/ - @javax.annotation.Nonnull - public String getOrigin() { - return origin; - } - - public void setOrigin(String origin) { - this.origin = origin; - } - - - public WebauthnSettingCreateRsp id(String id) { - this.id = id; - return this; - } - - /** - * ID of WebAuthn setting - * @return id - **/ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public WebauthnSettingCreateRsp created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public WebauthnSettingCreateRsp updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebauthnSettingCreateRsp webauthnSettingCreateRsp = (WebauthnSettingCreateRsp) o; - return Objects.equals(this.httpStatusCode, webauthnSettingCreateRsp.httpStatusCode) && - Objects.equals(this.message, webauthnSettingCreateRsp.message) && - Objects.equals(this.requestData, webauthnSettingCreateRsp.requestData) && - Objects.equals(this.runtime, webauthnSettingCreateRsp.runtime) && - Objects.equals(this.name, webauthnSettingCreateRsp.name) && - Objects.equals(this.origin, webauthnSettingCreateRsp.origin) && - Objects.equals(this.id, webauthnSettingCreateRsp.id) && - Objects.equals(this.created, webauthnSettingCreateRsp.created) && - Objects.equals(this.updated, webauthnSettingCreateRsp.updated); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, name, origin, id, created, updated); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebauthnSettingCreateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("name"); - openapiFields.add("origin"); - openapiFields.add("id"); - openapiFields.add("created"); - openapiFields.add("updated"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("origin"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingCreateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebauthnSettingCreateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingCreateRsp is not found in the empty JSON string", WebauthnSettingCreateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebauthnSettingCreateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingCreateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebauthnSettingCreateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("origin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebauthnSettingCreateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebauthnSettingCreateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingCreateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebauthnSettingCreateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebauthnSettingCreateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebauthnSettingCreateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebauthnSettingCreateRsp - * @throws IOException if the JSON string is invalid with respect to WebauthnSettingCreateRsp - */ - public static WebauthnSettingCreateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebauthnSettingCreateRsp.class); - } - - /** - * Convert an instance of WebauthnSettingCreateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingDeleteReq.java b/src/main/java/com/corbado/generated/model/WebauthnSettingDeleteReq.java deleted file mode 100644 index 2d11133..0000000 --- a/src/main/java/com/corbado/generated/model/WebauthnSettingDeleteReq.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebauthnSettingDeleteReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebauthnSettingDeleteReq { - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public WebauthnSettingDeleteReq() { - } - - public WebauthnSettingDeleteReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public WebauthnSettingDeleteReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebauthnSettingDeleteReq webauthnSettingDeleteReq = (WebauthnSettingDeleteReq) o; - return Objects.equals(this.requestID, webauthnSettingDeleteReq.requestID) && - Objects.equals(this.clientInfo, webauthnSettingDeleteReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebauthnSettingDeleteReq {\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingDeleteReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebauthnSettingDeleteReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingDeleteReq is not found in the empty JSON string", WebauthnSettingDeleteReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebauthnSettingDeleteReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingDeleteReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebauthnSettingDeleteReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebauthnSettingDeleteReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingDeleteReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebauthnSettingDeleteReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebauthnSettingDeleteReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebauthnSettingDeleteReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebauthnSettingDeleteReq - * @throws IOException if the JSON string is invalid with respect to WebauthnSettingDeleteReq - */ - public static WebauthnSettingDeleteReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebauthnSettingDeleteReq.class); - } - - /** - * Convert an instance of WebauthnSettingDeleteReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingGetRsp.java b/src/main/java/com/corbado/generated/model/WebauthnSettingGetRsp.java deleted file mode 100644 index 254ac0c..0000000 --- a/src/main/java/com/corbado/generated/model/WebauthnSettingGetRsp.java +++ /dev/null @@ -1,450 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebauthnSettingGetRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebauthnSettingGetRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ORIGIN = "origin"; - @SerializedName(SERIALIZED_NAME_ORIGIN) - private String origin; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public WebauthnSettingGetRsp() { - } - - public WebauthnSettingGetRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebauthnSettingGetRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebauthnSettingGetRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebauthnSettingGetRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebauthnSettingGetRsp name(String name) { - this.name = name; - return this; - } - - /** - * Name of this setting - * @return name - **/ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public WebauthnSettingGetRsp origin(String origin) { - this.origin = origin; - return this; - } - - /** - * Define here either a url incl. schema or an android-apk-key-hash - * @return origin - **/ - @javax.annotation.Nonnull - public String getOrigin() { - return origin; - } - - public void setOrigin(String origin) { - this.origin = origin; - } - - - public WebauthnSettingGetRsp id(String id) { - this.id = id; - return this; - } - - /** - * ID of WebAuthn setting - * @return id - **/ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public WebauthnSettingGetRsp created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public WebauthnSettingGetRsp updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebauthnSettingGetRsp webauthnSettingGetRsp = (WebauthnSettingGetRsp) o; - return Objects.equals(this.httpStatusCode, webauthnSettingGetRsp.httpStatusCode) && - Objects.equals(this.message, webauthnSettingGetRsp.message) && - Objects.equals(this.requestData, webauthnSettingGetRsp.requestData) && - Objects.equals(this.runtime, webauthnSettingGetRsp.runtime) && - Objects.equals(this.name, webauthnSettingGetRsp.name) && - Objects.equals(this.origin, webauthnSettingGetRsp.origin) && - Objects.equals(this.id, webauthnSettingGetRsp.id) && - Objects.equals(this.created, webauthnSettingGetRsp.created) && - Objects.equals(this.updated, webauthnSettingGetRsp.updated); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, name, origin, id, created, updated); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebauthnSettingGetRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("name"); - openapiFields.add("origin"); - openapiFields.add("id"); - openapiFields.add("created"); - openapiFields.add("updated"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("origin"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingGetRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebauthnSettingGetRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingGetRsp is not found in the empty JSON string", WebauthnSettingGetRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebauthnSettingGetRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingGetRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebauthnSettingGetRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("origin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebauthnSettingGetRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebauthnSettingGetRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingGetRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebauthnSettingGetRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebauthnSettingGetRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebauthnSettingGetRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebauthnSettingGetRsp - * @throws IOException if the JSON string is invalid with respect to WebauthnSettingGetRsp - */ - public static WebauthnSettingGetRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebauthnSettingGetRsp.class); - } - - /** - * Convert an instance of WebauthnSettingGetRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingItem.java b/src/main/java/com/corbado/generated/model/WebauthnSettingItem.java deleted file mode 100644 index 2248692..0000000 --- a/src/main/java/com/corbado/generated/model/WebauthnSettingItem.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebauthnSettingItem - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebauthnSettingItem { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ORIGIN = "origin"; - @SerializedName(SERIALIZED_NAME_ORIGIN) - private String origin; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public WebauthnSettingItem() { - } - - public WebauthnSettingItem name(String name) { - this.name = name; - return this; - } - - /** - * Name of this setting - * @return name - **/ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public WebauthnSettingItem origin(String origin) { - this.origin = origin; - return this; - } - - /** - * Define here either a url incl. schema or an android-apk-key-hash - * @return origin - **/ - @javax.annotation.Nonnull - public String getOrigin() { - return origin; - } - - public void setOrigin(String origin) { - this.origin = origin; - } - - - public WebauthnSettingItem id(String id) { - this.id = id; - return this; - } - - /** - * ID of WebAuthn setting - * @return id - **/ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public WebauthnSettingItem created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public WebauthnSettingItem updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebauthnSettingItem webauthnSettingItem = (WebauthnSettingItem) o; - return Objects.equals(this.name, webauthnSettingItem.name) && - Objects.equals(this.origin, webauthnSettingItem.origin) && - Objects.equals(this.id, webauthnSettingItem.id) && - Objects.equals(this.created, webauthnSettingItem.created) && - Objects.equals(this.updated, webauthnSettingItem.updated); - } - - @Override - public int hashCode() { - return Objects.hash(name, origin, id, created, updated); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebauthnSettingItem {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("origin"); - openapiFields.add("id"); - openapiFields.add("created"); - openapiFields.add("updated"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("origin"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingItem - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebauthnSettingItem.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingItem is not found in the empty JSON string", WebauthnSettingItem.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebauthnSettingItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingItem` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebauthnSettingItem.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("origin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebauthnSettingItem.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebauthnSettingItem' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingItem.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebauthnSettingItem value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebauthnSettingItem read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebauthnSettingItem given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebauthnSettingItem - * @throws IOException if the JSON string is invalid with respect to WebauthnSettingItem - */ - public static WebauthnSettingItem fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebauthnSettingItem.class); - } - - /** - * Convert an instance of WebauthnSettingItem to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingListRsp.java b/src/main/java/com/corbado/generated/model/WebauthnSettingListRsp.java deleted file mode 100644 index 0841c61..0000000 --- a/src/main/java/com/corbado/generated/model/WebauthnSettingListRsp.java +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.WebauthnSettingItem; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebauthnSettingListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebauthnSettingListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_ROWS = "rows"; - @SerializedName(SERIALIZED_NAME_ROWS) - private List rows = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public WebauthnSettingListRsp() { - } - - public WebauthnSettingListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebauthnSettingListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebauthnSettingListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebauthnSettingListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebauthnSettingListRsp rows(List rows) { - this.rows = rows; - return this; - } - - public WebauthnSettingListRsp addRowsItem(WebauthnSettingItem rowsItem) { - if (this.rows == null) { - this.rows = new ArrayList<>(); - } - this.rows.add(rowsItem); - return this; - } - - /** - * Get rows - * @return rows - **/ - @javax.annotation.Nonnull - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - - public WebauthnSettingListRsp paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebauthnSettingListRsp webauthnSettingListRsp = (WebauthnSettingListRsp) o; - return Objects.equals(this.httpStatusCode, webauthnSettingListRsp.httpStatusCode) && - Objects.equals(this.message, webauthnSettingListRsp.message) && - Objects.equals(this.requestData, webauthnSettingListRsp.requestData) && - Objects.equals(this.runtime, webauthnSettingListRsp.runtime) && - Objects.equals(this.rows, webauthnSettingListRsp.rows) && - Objects.equals(this.paging, webauthnSettingListRsp.paging); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, rows, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebauthnSettingListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("rows"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("rows"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebauthnSettingListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingListRsp is not found in the empty JSON string", WebauthnSettingListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebauthnSettingListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebauthnSettingListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // ensure the json data is an array - if (!jsonObj.get("rows").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `rows` to be an array in the JSON string but got `%s`", jsonObj.get("rows").toString())); - } - - JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); - // validate the required field `rows` (array) - for (int i = 0; i < jsonArrayrows.size(); i++) { - WebauthnSettingItem.validateJsonElement(jsonArrayrows.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebauthnSettingListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebauthnSettingListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebauthnSettingListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebauthnSettingListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebauthnSettingListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebauthnSettingListRsp - * @throws IOException if the JSON string is invalid with respect to WebauthnSettingListRsp - */ - public static WebauthnSettingListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebauthnSettingListRsp.class); - } - - /** - * Convert an instance of WebauthnSettingListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingUpdateReq.java b/src/main/java/com/corbado/generated/model/WebauthnSettingUpdateReq.java deleted file mode 100644 index 4a842e6..0000000 --- a/src/main/java/com/corbado/generated/model/WebauthnSettingUpdateReq.java +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.ClientInfo; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebauthnSettingUpdateReq - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebauthnSettingUpdateReq { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ORIGIN = "origin"; - @SerializedName(SERIALIZED_NAME_ORIGIN) - private String origin; - - public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; - @SerializedName(SERIALIZED_NAME_REQUEST_I_D) - private String requestID; - - public static final String SERIALIZED_NAME_CLIENT_INFO = "clientInfo"; - @SerializedName(SERIALIZED_NAME_CLIENT_INFO) - private ClientInfo clientInfo; - - public WebauthnSettingUpdateReq() { - } - - public WebauthnSettingUpdateReq name(String name) { - this.name = name; - return this; - } - - /** - * Name of this setting - * @return name - **/ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public WebauthnSettingUpdateReq origin(String origin) { - this.origin = origin; - return this; - } - - /** - * Define here either a url incl. schema or an android-apk-key-hash - * @return origin - **/ - @javax.annotation.Nonnull - public String getOrigin() { - return origin; - } - - public void setOrigin(String origin) { - this.origin = origin; - } - - - public WebauthnSettingUpdateReq requestID(String requestID) { - this.requestID = requestID; - return this; - } - - /** - * Unique ID of request, you can provide your own while making the request, if not the ID will be randomly generated on server side - * @return requestID - **/ - @javax.annotation.Nullable - public String getRequestID() { - return requestID; - } - - public void setRequestID(String requestID) { - this.requestID = requestID; - } - - - public WebauthnSettingUpdateReq clientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - return this; - } - - /** - * Get clientInfo - * @return clientInfo - **/ - @javax.annotation.Nullable - public ClientInfo getClientInfo() { - return clientInfo; - } - - public void setClientInfo(ClientInfo clientInfo) { - this.clientInfo = clientInfo; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebauthnSettingUpdateReq webauthnSettingUpdateReq = (WebauthnSettingUpdateReq) o; - return Objects.equals(this.name, webauthnSettingUpdateReq.name) && - Objects.equals(this.origin, webauthnSettingUpdateReq.origin) && - Objects.equals(this.requestID, webauthnSettingUpdateReq.requestID) && - Objects.equals(this.clientInfo, webauthnSettingUpdateReq.clientInfo); - } - - @Override - public int hashCode() { - return Objects.hash(name, origin, requestID, clientInfo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebauthnSettingUpdateReq {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); - sb.append(" requestID: ").append(toIndentedString(requestID)).append("\n"); - sb.append(" clientInfo: ").append(toIndentedString(clientInfo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("name"); - openapiFields.add("origin"); - openapiFields.add("requestID"); - openapiFields.add("clientInfo"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("origin"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingUpdateReq - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebauthnSettingUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingUpdateReq is not found in the empty JSON string", WebauthnSettingUpdateReq.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebauthnSettingUpdateReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebauthnSettingUpdateReq.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("origin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); - } - if ((jsonObj.get("requestID") != null && !jsonObj.get("requestID").isJsonNull()) && !jsonObj.get("requestID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestID").toString())); - } - // validate the optional field `clientInfo` - if (jsonObj.get("clientInfo") != null && !jsonObj.get("clientInfo").isJsonNull()) { - ClientInfo.validateJsonElement(jsonObj.get("clientInfo")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebauthnSettingUpdateReq.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebauthnSettingUpdateReq' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingUpdateReq.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebauthnSettingUpdateReq value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebauthnSettingUpdateReq read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebauthnSettingUpdateReq given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebauthnSettingUpdateReq - * @throws IOException if the JSON string is invalid with respect to WebauthnSettingUpdateReq - */ - public static WebauthnSettingUpdateReq fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebauthnSettingUpdateReq.class); - } - - /** - * Convert an instance of WebauthnSettingUpdateReq to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebauthnSettingUpdateRsp.java b/src/main/java/com/corbado/generated/model/WebauthnSettingUpdateRsp.java deleted file mode 100644 index 5ced0f3..0000000 --- a/src/main/java/com/corbado/generated/model/WebauthnSettingUpdateRsp.java +++ /dev/null @@ -1,450 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebauthnSettingUpdateRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebauthnSettingUpdateRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ORIGIN = "origin"; - @SerializedName(SERIALIZED_NAME_ORIGIN) - private String origin; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public static final String SERIALIZED_NAME_UPDATED = "updated"; - @SerializedName(SERIALIZED_NAME_UPDATED) - private String updated; - - public WebauthnSettingUpdateRsp() { - } - - public WebauthnSettingUpdateRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebauthnSettingUpdateRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebauthnSettingUpdateRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebauthnSettingUpdateRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebauthnSettingUpdateRsp name(String name) { - this.name = name; - return this; - } - - /** - * Name of this setting - * @return name - **/ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - public WebauthnSettingUpdateRsp origin(String origin) { - this.origin = origin; - return this; - } - - /** - * Define here either a url incl. schema or an android-apk-key-hash - * @return origin - **/ - @javax.annotation.Nonnull - public String getOrigin() { - return origin; - } - - public void setOrigin(String origin) { - this.origin = origin; - } - - - public WebauthnSettingUpdateRsp id(String id) { - this.id = id; - return this; - } - - /** - * ID of WebAuthn setting - * @return id - **/ - @javax.annotation.Nonnull - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public WebauthnSettingUpdateRsp created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the entity was created in yyyy-MM-dd'T'HH:mm:ss format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - public WebauthnSettingUpdateRsp updated(String updated) { - this.updated = updated; - return this; - } - - /** - * Timestamp of when the entity was last updated in yyyy-MM-dd'T'HH:mm:ss format - * @return updated - **/ - @javax.annotation.Nonnull - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebauthnSettingUpdateRsp webauthnSettingUpdateRsp = (WebauthnSettingUpdateRsp) o; - return Objects.equals(this.httpStatusCode, webauthnSettingUpdateRsp.httpStatusCode) && - Objects.equals(this.message, webauthnSettingUpdateRsp.message) && - Objects.equals(this.requestData, webauthnSettingUpdateRsp.requestData) && - Objects.equals(this.runtime, webauthnSettingUpdateRsp.runtime) && - Objects.equals(this.name, webauthnSettingUpdateRsp.name) && - Objects.equals(this.origin, webauthnSettingUpdateRsp.origin) && - Objects.equals(this.id, webauthnSettingUpdateRsp.id) && - Objects.equals(this.created, webauthnSettingUpdateRsp.created) && - Objects.equals(this.updated, webauthnSettingUpdateRsp.updated); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, name, origin, id, created, updated); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebauthnSettingUpdateRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append(" updated: ").append(toIndentedString(updated)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("name"); - openapiFields.add("origin"); - openapiFields.add("id"); - openapiFields.add("created"); - openapiFields.add("updated"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("origin"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("created"); - openapiRequiredFields.add("updated"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebauthnSettingUpdateRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebauthnSettingUpdateRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnSettingUpdateRsp is not found in the empty JSON string", WebauthnSettingUpdateRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebauthnSettingUpdateRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnSettingUpdateRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebauthnSettingUpdateRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("origin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); - } - if (!jsonObj.get("id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - if (!jsonObj.get("updated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `updated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebauthnSettingUpdateRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebauthnSettingUpdateRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebauthnSettingUpdateRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebauthnSettingUpdateRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebauthnSettingUpdateRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebauthnSettingUpdateRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebauthnSettingUpdateRsp - * @throws IOException if the JSON string is invalid with respect to WebauthnSettingUpdateRsp - */ - public static WebauthnSettingUpdateRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebauthnSettingUpdateRsp.class); - } - - /** - * Convert an instance of WebauthnSettingUpdateRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticator.java b/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticator.java deleted file mode 100644 index a208b83..0000000 --- a/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticator.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebauthnStatsAuthenticator - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebauthnStatsAuthenticator { - public static final String SERIALIZED_NAME_TOTAL_PASSKEYS = "totalPasskeys"; - @SerializedName(SERIALIZED_NAME_TOTAL_PASSKEYS) - private Integer totalPasskeys; - - public static final String SERIALIZED_NAME_AUTHENTICATOR_NAME = "authenticatorName"; - @SerializedName(SERIALIZED_NAME_AUTHENTICATOR_NAME) - private String authenticatorName; - - public WebauthnStatsAuthenticator() { - } - - public WebauthnStatsAuthenticator totalPasskeys(Integer totalPasskeys) { - this.totalPasskeys = totalPasskeys; - return this; - } - - /** - * Get totalPasskeys - * @return totalPasskeys - **/ - @javax.annotation.Nonnull - public Integer getTotalPasskeys() { - return totalPasskeys; - } - - public void setTotalPasskeys(Integer totalPasskeys) { - this.totalPasskeys = totalPasskeys; - } - - - public WebauthnStatsAuthenticator authenticatorName(String authenticatorName) { - this.authenticatorName = authenticatorName; - return this; - } - - /** - * Get authenticatorName - * @return authenticatorName - **/ - @javax.annotation.Nonnull - public String getAuthenticatorName() { - return authenticatorName; - } - - public void setAuthenticatorName(String authenticatorName) { - this.authenticatorName = authenticatorName; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebauthnStatsAuthenticator webauthnStatsAuthenticator = (WebauthnStatsAuthenticator) o; - return Objects.equals(this.totalPasskeys, webauthnStatsAuthenticator.totalPasskeys) && - Objects.equals(this.authenticatorName, webauthnStatsAuthenticator.authenticatorName); - } - - @Override - public int hashCode() { - return Objects.hash(totalPasskeys, authenticatorName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebauthnStatsAuthenticator {\n"); - sb.append(" totalPasskeys: ").append(toIndentedString(totalPasskeys)).append("\n"); - sb.append(" authenticatorName: ").append(toIndentedString(authenticatorName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("totalPasskeys"); - openapiFields.add("authenticatorName"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("totalPasskeys"); - openapiRequiredFields.add("authenticatorName"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebauthnStatsAuthenticator - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebauthnStatsAuthenticator.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnStatsAuthenticator is not found in the empty JSON string", WebauthnStatsAuthenticator.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebauthnStatsAuthenticator.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnStatsAuthenticator` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebauthnStatsAuthenticator.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("authenticatorName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authenticatorName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticatorName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebauthnStatsAuthenticator.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebauthnStatsAuthenticator' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebauthnStatsAuthenticator.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebauthnStatsAuthenticator value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebauthnStatsAuthenticator read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebauthnStatsAuthenticator given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebauthnStatsAuthenticator - * @throws IOException if the JSON string is invalid with respect to WebauthnStatsAuthenticator - */ - public static WebauthnStatsAuthenticator fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebauthnStatsAuthenticator.class); - } - - /** - * Convert an instance of WebauthnStatsAuthenticator to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRsp.java b/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRsp.java deleted file mode 100644 index 233291d..0000000 --- a/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.WebauthnStatsAuthenticatorRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebauthnStatsAuthenticatorRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebauthnStatsAuthenticatorRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private WebauthnStatsAuthenticatorRspAllOfData data; - - public WebauthnStatsAuthenticatorRsp() { - } - - public WebauthnStatsAuthenticatorRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebauthnStatsAuthenticatorRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebauthnStatsAuthenticatorRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebauthnStatsAuthenticatorRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebauthnStatsAuthenticatorRsp data(WebauthnStatsAuthenticatorRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public WebauthnStatsAuthenticatorRspAllOfData getData() { - return data; - } - - public void setData(WebauthnStatsAuthenticatorRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebauthnStatsAuthenticatorRsp webauthnStatsAuthenticatorRsp = (WebauthnStatsAuthenticatorRsp) o; - return Objects.equals(this.httpStatusCode, webauthnStatsAuthenticatorRsp.httpStatusCode) && - Objects.equals(this.message, webauthnStatsAuthenticatorRsp.message) && - Objects.equals(this.requestData, webauthnStatsAuthenticatorRsp.requestData) && - Objects.equals(this.runtime, webauthnStatsAuthenticatorRsp.runtime) && - Objects.equals(this.data, webauthnStatsAuthenticatorRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebauthnStatsAuthenticatorRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebauthnStatsAuthenticatorRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebauthnStatsAuthenticatorRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnStatsAuthenticatorRsp is not found in the empty JSON string", WebauthnStatsAuthenticatorRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebauthnStatsAuthenticatorRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnStatsAuthenticatorRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebauthnStatsAuthenticatorRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - WebauthnStatsAuthenticatorRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebauthnStatsAuthenticatorRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebauthnStatsAuthenticatorRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebauthnStatsAuthenticatorRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebauthnStatsAuthenticatorRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebauthnStatsAuthenticatorRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebauthnStatsAuthenticatorRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebauthnStatsAuthenticatorRsp - * @throws IOException if the JSON string is invalid with respect to WebauthnStatsAuthenticatorRsp - */ - public static WebauthnStatsAuthenticatorRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebauthnStatsAuthenticatorRsp.class); - } - - /** - * Convert an instance of WebauthnStatsAuthenticatorRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRspAllOfData.java b/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRspAllOfData.java deleted file mode 100644 index 45bee41..0000000 --- a/src/main/java/com/corbado/generated/model/WebauthnStatsAuthenticatorRspAllOfData.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.WebauthnStatsAuthenticator; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebauthnStatsAuthenticatorRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebauthnStatsAuthenticatorRspAllOfData { - public static final String SERIALIZED_NAME_STATS = "stats"; - @SerializedName(SERIALIZED_NAME_STATS) - private List stats = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public WebauthnStatsAuthenticatorRspAllOfData() { - } - - public WebauthnStatsAuthenticatorRspAllOfData stats(List stats) { - this.stats = stats; - return this; - } - - public WebauthnStatsAuthenticatorRspAllOfData addStatsItem(WebauthnStatsAuthenticator statsItem) { - if (this.stats == null) { - this.stats = new ArrayList<>(); - } - this.stats.add(statsItem); - return this; - } - - /** - * Get stats - * @return stats - **/ - @javax.annotation.Nonnull - public List getStats() { - return stats; - } - - public void setStats(List stats) { - this.stats = stats; - } - - - public WebauthnStatsAuthenticatorRspAllOfData paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebauthnStatsAuthenticatorRspAllOfData webauthnStatsAuthenticatorRspAllOfData = (WebauthnStatsAuthenticatorRspAllOfData) o; - return Objects.equals(this.stats, webauthnStatsAuthenticatorRspAllOfData.stats) && - Objects.equals(this.paging, webauthnStatsAuthenticatorRspAllOfData.paging); - } - - @Override - public int hashCode() { - return Objects.hash(stats, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebauthnStatsAuthenticatorRspAllOfData {\n"); - sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("stats"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("stats"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebauthnStatsAuthenticatorRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebauthnStatsAuthenticatorRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnStatsAuthenticatorRspAllOfData is not found in the empty JSON string", WebauthnStatsAuthenticatorRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebauthnStatsAuthenticatorRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnStatsAuthenticatorRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebauthnStatsAuthenticatorRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("stats").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); - } - - JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); - // validate the required field `stats` (array) - for (int i = 0; i < jsonArraystats.size(); i++) { - WebauthnStatsAuthenticator.validateJsonElement(jsonArraystats.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebauthnStatsAuthenticatorRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebauthnStatsAuthenticatorRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebauthnStatsAuthenticatorRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebauthnStatsAuthenticatorRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebauthnStatsAuthenticatorRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebauthnStatsAuthenticatorRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebauthnStatsAuthenticatorRspAllOfData - * @throws IOException if the JSON string is invalid with respect to WebauthnStatsAuthenticatorRspAllOfData - */ - public static WebauthnStatsAuthenticatorRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebauthnStatsAuthenticatorRspAllOfData.class); - } - - /** - * Convert an instance of WebauthnStatsAuthenticatorRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebauthnStatsType.java b/src/main/java/com/corbado/generated/model/WebauthnStatsType.java deleted file mode 100644 index 52881cb..0000000 --- a/src/main/java/com/corbado/generated/model/WebauthnStatsType.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebauthnStatsType - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebauthnStatsType { - public static final String SERIALIZED_NAME_TOTAL_PASSKEYS = "totalPasskeys"; - @SerializedName(SERIALIZED_NAME_TOTAL_PASSKEYS) - private Integer totalPasskeys; - - public static final String SERIALIZED_NAME_PASSKEYS = "passkeys"; - @SerializedName(SERIALIZED_NAME_PASSKEYS) - private Integer passkeys; - - public static final String SERIALIZED_NAME_SYNCED_PASSKEYS = "syncedPasskeys"; - @SerializedName(SERIALIZED_NAME_SYNCED_PASSKEYS) - private Integer syncedPasskeys; - - public static final String SERIALIZED_NAME_HYBRID_PASSKEYS = "hybridPasskeys"; - @SerializedName(SERIALIZED_NAME_HYBRID_PASSKEYS) - private Integer hybridPasskeys; - - public WebauthnStatsType() { - } - - public WebauthnStatsType totalPasskeys(Integer totalPasskeys) { - this.totalPasskeys = totalPasskeys; - return this; - } - - /** - * Get totalPasskeys - * @return totalPasskeys - **/ - @javax.annotation.Nonnull - public Integer getTotalPasskeys() { - return totalPasskeys; - } - - public void setTotalPasskeys(Integer totalPasskeys) { - this.totalPasskeys = totalPasskeys; - } - - - public WebauthnStatsType passkeys(Integer passkeys) { - this.passkeys = passkeys; - return this; - } - - /** - * Get passkeys - * @return passkeys - **/ - @javax.annotation.Nullable - public Integer getPasskeys() { - return passkeys; - } - - public void setPasskeys(Integer passkeys) { - this.passkeys = passkeys; - } - - - public WebauthnStatsType syncedPasskeys(Integer syncedPasskeys) { - this.syncedPasskeys = syncedPasskeys; - return this; - } - - /** - * Get syncedPasskeys - * @return syncedPasskeys - **/ - @javax.annotation.Nonnull - public Integer getSyncedPasskeys() { - return syncedPasskeys; - } - - public void setSyncedPasskeys(Integer syncedPasskeys) { - this.syncedPasskeys = syncedPasskeys; - } - - - public WebauthnStatsType hybridPasskeys(Integer hybridPasskeys) { - this.hybridPasskeys = hybridPasskeys; - return this; - } - - /** - * Get hybridPasskeys - * @return hybridPasskeys - **/ - @javax.annotation.Nonnull - public Integer getHybridPasskeys() { - return hybridPasskeys; - } - - public void setHybridPasskeys(Integer hybridPasskeys) { - this.hybridPasskeys = hybridPasskeys; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebauthnStatsType webauthnStatsType = (WebauthnStatsType) o; - return Objects.equals(this.totalPasskeys, webauthnStatsType.totalPasskeys) && - Objects.equals(this.passkeys, webauthnStatsType.passkeys) && - Objects.equals(this.syncedPasskeys, webauthnStatsType.syncedPasskeys) && - Objects.equals(this.hybridPasskeys, webauthnStatsType.hybridPasskeys); - } - - @Override - public int hashCode() { - return Objects.hash(totalPasskeys, passkeys, syncedPasskeys, hybridPasskeys); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebauthnStatsType {\n"); - sb.append(" totalPasskeys: ").append(toIndentedString(totalPasskeys)).append("\n"); - sb.append(" passkeys: ").append(toIndentedString(passkeys)).append("\n"); - sb.append(" syncedPasskeys: ").append(toIndentedString(syncedPasskeys)).append("\n"); - sb.append(" hybridPasskeys: ").append(toIndentedString(hybridPasskeys)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("totalPasskeys"); - openapiFields.add("passkeys"); - openapiFields.add("syncedPasskeys"); - openapiFields.add("hybridPasskeys"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("totalPasskeys"); - openapiRequiredFields.add("syncedPasskeys"); - openapiRequiredFields.add("hybridPasskeys"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebauthnStatsType - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebauthnStatsType.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnStatsType is not found in the empty JSON string", WebauthnStatsType.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebauthnStatsType.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnStatsType` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebauthnStatsType.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebauthnStatsType.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebauthnStatsType' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebauthnStatsType.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebauthnStatsType value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebauthnStatsType read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebauthnStatsType given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebauthnStatsType - * @throws IOException if the JSON string is invalid with respect to WebauthnStatsType - */ - public static WebauthnStatsType fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebauthnStatsType.class); - } - - /** - * Convert an instance of WebauthnStatsType to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebauthnStatsTypeRsp.java b/src/main/java/com/corbado/generated/model/WebauthnStatsTypeRsp.java deleted file mode 100644 index 420709f..0000000 --- a/src/main/java/com/corbado/generated/model/WebauthnStatsTypeRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.WebauthnStatsTypeRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebauthnStatsTypeRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebauthnStatsTypeRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private WebauthnStatsTypeRspAllOfData data; - - public WebauthnStatsTypeRsp() { - } - - public WebauthnStatsTypeRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebauthnStatsTypeRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebauthnStatsTypeRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebauthnStatsTypeRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebauthnStatsTypeRsp data(WebauthnStatsTypeRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public WebauthnStatsTypeRspAllOfData getData() { - return data; - } - - public void setData(WebauthnStatsTypeRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebauthnStatsTypeRsp webauthnStatsTypeRsp = (WebauthnStatsTypeRsp) o; - return Objects.equals(this.httpStatusCode, webauthnStatsTypeRsp.httpStatusCode) && - Objects.equals(this.message, webauthnStatsTypeRsp.message) && - Objects.equals(this.requestData, webauthnStatsTypeRsp.requestData) && - Objects.equals(this.runtime, webauthnStatsTypeRsp.runtime) && - Objects.equals(this.data, webauthnStatsTypeRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebauthnStatsTypeRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebauthnStatsTypeRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebauthnStatsTypeRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnStatsTypeRsp is not found in the empty JSON string", WebauthnStatsTypeRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebauthnStatsTypeRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnStatsTypeRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebauthnStatsTypeRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - WebauthnStatsTypeRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebauthnStatsTypeRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebauthnStatsTypeRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebauthnStatsTypeRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebauthnStatsTypeRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebauthnStatsTypeRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebauthnStatsTypeRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebauthnStatsTypeRsp - * @throws IOException if the JSON string is invalid with respect to WebauthnStatsTypeRsp - */ - public static WebauthnStatsTypeRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebauthnStatsTypeRsp.class); - } - - /** - * Convert an instance of WebauthnStatsTypeRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebauthnStatsTypeRspAllOfData.java b/src/main/java/com/corbado/generated/model/WebauthnStatsTypeRspAllOfData.java deleted file mode 100644 index a796789..0000000 --- a/src/main/java/com/corbado/generated/model/WebauthnStatsTypeRspAllOfData.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.WebauthnStatsType; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebauthnStatsTypeRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebauthnStatsTypeRspAllOfData { - public static final String SERIALIZED_NAME_STATS = "stats"; - @SerializedName(SERIALIZED_NAME_STATS) - private List stats = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public WebauthnStatsTypeRspAllOfData() { - } - - public WebauthnStatsTypeRspAllOfData stats(List stats) { - this.stats = stats; - return this; - } - - public WebauthnStatsTypeRspAllOfData addStatsItem(WebauthnStatsType statsItem) { - if (this.stats == null) { - this.stats = new ArrayList<>(); - } - this.stats.add(statsItem); - return this; - } - - /** - * Get stats - * @return stats - **/ - @javax.annotation.Nonnull - public List getStats() { - return stats; - } - - public void setStats(List stats) { - this.stats = stats; - } - - - public WebauthnStatsTypeRspAllOfData paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebauthnStatsTypeRspAllOfData webauthnStatsTypeRspAllOfData = (WebauthnStatsTypeRspAllOfData) o; - return Objects.equals(this.stats, webauthnStatsTypeRspAllOfData.stats) && - Objects.equals(this.paging, webauthnStatsTypeRspAllOfData.paging); - } - - @Override - public int hashCode() { - return Objects.hash(stats, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebauthnStatsTypeRspAllOfData {\n"); - sb.append(" stats: ").append(toIndentedString(stats)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("stats"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("stats"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebauthnStatsTypeRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebauthnStatsTypeRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebauthnStatsTypeRspAllOfData is not found in the empty JSON string", WebauthnStatsTypeRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebauthnStatsTypeRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebauthnStatsTypeRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebauthnStatsTypeRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("stats").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stats` to be an array in the JSON string but got `%s`", jsonObj.get("stats").toString())); - } - - JsonArray jsonArraystats = jsonObj.getAsJsonArray("stats"); - // validate the required field `stats` (array) - for (int i = 0; i < jsonArraystats.size(); i++) { - WebauthnStatsType.validateJsonElement(jsonArraystats.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebauthnStatsTypeRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebauthnStatsTypeRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebauthnStatsTypeRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebauthnStatsTypeRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebauthnStatsTypeRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebauthnStatsTypeRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebauthnStatsTypeRspAllOfData - * @throws IOException if the JSON string is invalid with respect to WebauthnStatsTypeRspAllOfData - */ - public static WebauthnStatsTypeRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebauthnStatsTypeRspAllOfData.class); - } - - /** - * Convert an instance of WebauthnStatsTypeRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebhookLog.java b/src/main/java/com/corbado/generated/model/WebhookLog.java deleted file mode 100644 index 2b1f19f..0000000 --- a/src/main/java/com/corbado/generated/model/WebhookLog.java +++ /dev/null @@ -1,535 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * Webhook log entry - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebhookLog { - public static final String SERIALIZED_NAME_WEBHOOK_I_D = "webhookID"; - @SerializedName(SERIALIZED_NAME_WEBHOOK_I_D) - private String webhookID; - - public static final String SERIALIZED_NAME_PROJECT_I_D = "projectID"; - @SerializedName(SERIALIZED_NAME_PROJECT_I_D) - private String projectID; - - public static final String SERIALIZED_NAME_ACTION = "action"; - @SerializedName(SERIALIZED_NAME_ACTION) - private String action; - - public static final String SERIALIZED_NAME_RESPONSE_I_D = "responseID"; - @SerializedName(SERIALIZED_NAME_RESPONSE_I_D) - private String responseID; - - public static final String SERIALIZED_NAME_REQUEST_U_R_L = "requestURL"; - @SerializedName(SERIALIZED_NAME_REQUEST_U_R_L) - private String requestURL; - - public static final String SERIALIZED_NAME_REQUEST_BODY = "requestBody"; - @SerializedName(SERIALIZED_NAME_REQUEST_BODY) - private String requestBody; - - public static final String SERIALIZED_NAME_RESPONSE_STATUS = "responseStatus"; - @SerializedName(SERIALIZED_NAME_RESPONSE_STATUS) - private Integer responseStatus; - - public static final String SERIALIZED_NAME_RESPONSE_HEADERS = "responseHeaders"; - @SerializedName(SERIALIZED_NAME_RESPONSE_HEADERS) - private Object responseHeaders; - - public static final String SERIALIZED_NAME_RESPONSE_BODY = "responseBody"; - @SerializedName(SERIALIZED_NAME_RESPONSE_BODY) - private String responseBody; - - public static final String SERIALIZED_NAME_RESPONSE_ERROR = "responseError"; - @SerializedName(SERIALIZED_NAME_RESPONSE_ERROR) - private String responseError; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_CREATED = "created"; - @SerializedName(SERIALIZED_NAME_CREATED) - private String created; - - public WebhookLog() { - } - - public WebhookLog webhookID(String webhookID) { - this.webhookID = webhookID; - return this; - } - - /** - * Unique ID of webhook request which will be randomly generated on server side - * @return webhookID - **/ - @javax.annotation.Nonnull - public String getWebhookID() { - return webhookID; - } - - public void setWebhookID(String webhookID) { - this.webhookID = webhookID; - } - - - public WebhookLog projectID(String projectID) { - this.projectID = projectID; - return this; - } - - /** - * ID of project - * @return projectID - **/ - @javax.annotation.Nonnull - public String getProjectID() { - return projectID; - } - - public void setProjectID(String projectID) { - this.projectID = projectID; - } - - - public WebhookLog action(String action) { - this.action = action; - return this; - } - - /** - * Webhook action - * @return action - **/ - @javax.annotation.Nonnull - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - - public WebhookLog responseID(String responseID) { - this.responseID = responseID; - return this; - } - - /** - * Unique ID of response, you can provide your own while responding to the webhook, if not the ID will be randomly generated on server side. This has the same meaning as overriding requestID for API requests. - * @return responseID - **/ - @javax.annotation.Nonnull - public String getResponseID() { - return responseID; - } - - public void setResponseID(String responseID) { - this.responseID = responseID; - } - - - public WebhookLog requestURL(String requestURL) { - this.requestURL = requestURL; - return this; - } - - /** - * Absolute request URL of webhook backend - * @return requestURL - **/ - @javax.annotation.Nonnull - public String getRequestURL() { - return requestURL; - } - - public void setRequestURL(String requestURL) { - this.requestURL = requestURL; - } - - - public WebhookLog requestBody(String requestBody) { - this.requestBody = requestBody; - return this; - } - - /** - * Request contents that were sent to webhook backend - * @return requestBody - **/ - @javax.annotation.Nonnull - public String getRequestBody() { - return requestBody; - } - - public void setRequestBody(String requestBody) { - this.requestBody = requestBody; - } - - - public WebhookLog responseStatus(Integer responseStatus) { - this.responseStatus = responseStatus; - return this; - } - - /** - * Response HTTP status that was returned by webhook backend - * @return responseStatus - **/ - @javax.annotation.Nonnull - public Integer getResponseStatus() { - return responseStatus; - } - - public void setResponseStatus(Integer responseStatus) { - this.responseStatus = responseStatus; - } - - - public WebhookLog responseHeaders(Object responseHeaders) { - this.responseHeaders = responseHeaders; - return this; - } - - /** - * Response HTTP headers that were returned by webhook backend - * @return responseHeaders - **/ - @javax.annotation.Nonnull - public Object getResponseHeaders() { - return responseHeaders; - } - - public void setResponseHeaders(Object responseHeaders) { - this.responseHeaders = responseHeaders; - } - - - public WebhookLog responseBody(String responseBody) { - this.responseBody = responseBody; - return this; - } - - /** - * Response body JSON data that was returned by webhook backend - * @return responseBody - **/ - @javax.annotation.Nonnull - public String getResponseBody() { - return responseBody; - } - - public void setResponseBody(String responseBody) { - this.responseBody = responseBody; - } - - - public WebhookLog responseError(String responseError) { - this.responseError = responseError; - return this; - } - - /** - * Response error if present - * @return responseError - **/ - @javax.annotation.Nonnull - public String getResponseError() { - return responseError; - } - - public void setResponseError(String responseError) { - this.responseError = responseError; - } - - - public WebhookLog runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebhookLog created(String created) { - this.created = created; - return this; - } - - /** - * Timestamp of when the request was performed in RFC3339 format - * @return created - **/ - @javax.annotation.Nonnull - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebhookLog webhookLog = (WebhookLog) o; - return Objects.equals(this.webhookID, webhookLog.webhookID) && - Objects.equals(this.projectID, webhookLog.projectID) && - Objects.equals(this.action, webhookLog.action) && - Objects.equals(this.responseID, webhookLog.responseID) && - Objects.equals(this.requestURL, webhookLog.requestURL) && - Objects.equals(this.requestBody, webhookLog.requestBody) && - Objects.equals(this.responseStatus, webhookLog.responseStatus) && - Objects.equals(this.responseHeaders, webhookLog.responseHeaders) && - Objects.equals(this.responseBody, webhookLog.responseBody) && - Objects.equals(this.responseError, webhookLog.responseError) && - Objects.equals(this.runtime, webhookLog.runtime) && - Objects.equals(this.created, webhookLog.created); - } - - @Override - public int hashCode() { - return Objects.hash(webhookID, projectID, action, responseID, requestURL, requestBody, responseStatus, responseHeaders, responseBody, responseError, runtime, created); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebhookLog {\n"); - sb.append(" webhookID: ").append(toIndentedString(webhookID)).append("\n"); - sb.append(" projectID: ").append(toIndentedString(projectID)).append("\n"); - sb.append(" action: ").append(toIndentedString(action)).append("\n"); - sb.append(" responseID: ").append(toIndentedString(responseID)).append("\n"); - sb.append(" requestURL: ").append(toIndentedString(requestURL)).append("\n"); - sb.append(" requestBody: ").append(toIndentedString(requestBody)).append("\n"); - sb.append(" responseStatus: ").append(toIndentedString(responseStatus)).append("\n"); - sb.append(" responseHeaders: ").append(toIndentedString(responseHeaders)).append("\n"); - sb.append(" responseBody: ").append(toIndentedString(responseBody)).append("\n"); - sb.append(" responseError: ").append(toIndentedString(responseError)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" created: ").append(toIndentedString(created)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("webhookID"); - openapiFields.add("projectID"); - openapiFields.add("action"); - openapiFields.add("responseID"); - openapiFields.add("requestURL"); - openapiFields.add("requestBody"); - openapiFields.add("responseStatus"); - openapiFields.add("responseHeaders"); - openapiFields.add("responseBody"); - openapiFields.add("responseError"); - openapiFields.add("runtime"); - openapiFields.add("created"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("webhookID"); - openapiRequiredFields.add("projectID"); - openapiRequiredFields.add("action"); - openapiRequiredFields.add("responseID"); - openapiRequiredFields.add("requestURL"); - openapiRequiredFields.add("requestBody"); - openapiRequiredFields.add("responseStatus"); - openapiRequiredFields.add("responseHeaders"); - openapiRequiredFields.add("responseBody"); - openapiRequiredFields.add("responseError"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("created"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebhookLog - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebhookLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookLog is not found in the empty JSON string", WebhookLog.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebhookLog.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookLog` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebhookLog.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("webhookID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webhookID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webhookID").toString())); - } - if (!jsonObj.get("projectID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `projectID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("projectID").toString())); - } - if (!jsonObj.get("action").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString())); - } - if (!jsonObj.get("responseID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `responseID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseID").toString())); - } - if (!jsonObj.get("requestURL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestURL").toString())); - } - if (!jsonObj.get("requestBody").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestBody` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestBody").toString())); - } - if (!jsonObj.get("responseBody").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `responseBody` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseBody").toString())); - } - if (!jsonObj.get("responseError").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `responseError` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseError").toString())); - } - if (!jsonObj.get("created").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `created` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebhookLog.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebhookLog' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebhookLog.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebhookLog value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebhookLog read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebhookLog given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebhookLog - * @throws IOException if the JSON string is invalid with respect to WebhookLog - */ - public static WebhookLog fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebhookLog.class); - } - - /** - * Convert an instance of WebhookLog to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebhookLogsListRsp.java b/src/main/java/com/corbado/generated/model/WebhookLogsListRsp.java deleted file mode 100644 index 846f1af..0000000 --- a/src/main/java/com/corbado/generated/model/WebhookLogsListRsp.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.RequestData; -import com.corbado.generated.model.WebhookLogsListRspAllOfData; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.Arrays; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebhookLogsListRsp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebhookLogsListRsp { - public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; - @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) - private Integer httpStatusCode; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REQUEST_DATA = "requestData"; - @SerializedName(SERIALIZED_NAME_REQUEST_DATA) - private RequestData requestData; - - public static final String SERIALIZED_NAME_RUNTIME = "runtime"; - @SerializedName(SERIALIZED_NAME_RUNTIME) - private Float runtime; - - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private WebhookLogsListRspAllOfData data; - - public WebhookLogsListRsp() { - } - - public WebhookLogsListRsp httpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - return this; - } - - /** - * HTTP status code of operation - * minimum: 200 - * maximum: 599 - * @return httpStatusCode - **/ - @javax.annotation.Nonnull - public Integer getHttpStatusCode() { - return httpStatusCode; - } - - public void setHttpStatusCode(Integer httpStatusCode) { - this.httpStatusCode = httpStatusCode; - } - - - public WebhookLogsListRsp message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nonnull - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - public WebhookLogsListRsp requestData(RequestData requestData) { - this.requestData = requestData; - return this; - } - - /** - * Get requestData - * @return requestData - **/ - @javax.annotation.Nonnull - public RequestData getRequestData() { - return requestData; - } - - public void setRequestData(RequestData requestData) { - this.requestData = requestData; - } - - - public WebhookLogsListRsp runtime(Float runtime) { - this.runtime = runtime; - return this; - } - - /** - * Runtime in seconds for this request - * @return runtime - **/ - @javax.annotation.Nonnull - public Float getRuntime() { - return runtime; - } - - public void setRuntime(Float runtime) { - this.runtime = runtime; - } - - - public WebhookLogsListRsp data(WebhookLogsListRspAllOfData data) { - this.data = data; - return this; - } - - /** - * Get data - * @return data - **/ - @javax.annotation.Nonnull - public WebhookLogsListRspAllOfData getData() { - return data; - } - - public void setData(WebhookLogsListRspAllOfData data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebhookLogsListRsp webhookLogsListRsp = (WebhookLogsListRsp) o; - return Objects.equals(this.httpStatusCode, webhookLogsListRsp.httpStatusCode) && - Objects.equals(this.message, webhookLogsListRsp.message) && - Objects.equals(this.requestData, webhookLogsListRsp.requestData) && - Objects.equals(this.runtime, webhookLogsListRsp.runtime) && - Objects.equals(this.data, webhookLogsListRsp.data); - } - - @Override - public int hashCode() { - return Objects.hash(httpStatusCode, message, requestData, runtime, data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebhookLogsListRsp {\n"); - sb.append(" httpStatusCode: ").append(toIndentedString(httpStatusCode)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" requestData: ").append(toIndentedString(requestData)).append("\n"); - sb.append(" runtime: ").append(toIndentedString(runtime)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("httpStatusCode"); - openapiFields.add("message"); - openapiFields.add("requestData"); - openapiFields.add("runtime"); - openapiFields.add("data"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("httpStatusCode"); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("requestData"); - openapiRequiredFields.add("runtime"); - openapiRequiredFields.add("data"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebhookLogsListRsp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebhookLogsListRsp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookLogsListRsp is not found in the empty JSON string", WebhookLogsListRsp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebhookLogsListRsp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookLogsListRsp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebhookLogsListRsp.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the required field `requestData` - RequestData.validateJsonElement(jsonObj.get("requestData")); - // validate the required field `data` - WebhookLogsListRspAllOfData.validateJsonElement(jsonObj.get("data")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebhookLogsListRsp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebhookLogsListRsp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebhookLogsListRsp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebhookLogsListRsp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebhookLogsListRsp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebhookLogsListRsp given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebhookLogsListRsp - * @throws IOException if the JSON string is invalid with respect to WebhookLogsListRsp - */ - public static WebhookLogsListRsp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebhookLogsListRsp.class); - } - - /** - * Convert an instance of WebhookLogsListRsp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/model/WebhookLogsListRspAllOfData.java b/src/main/java/com/corbado/generated/model/WebhookLogsListRspAllOfData.java deleted file mode 100644 index 1392ab6..0000000 --- a/src/main/java/com/corbado/generated/model/WebhookLogsListRspAllOfData.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Corbado Backend API - * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. The Corbado Backend API is organized around REST principles. It uses resource-oriented URLs with verbs (HTTP methods) and HTTP status codes. Requests need to be valid JSON payloads. We always return JSON. The Corbado Backend API specification is written in **OpenAPI Version 3.0.3**. You can download it via the download button at the top and use it to generate clients in languages we do not provide officially for example. # Authentication To authenticate your API requests HTTP Basic Auth is used. You need to set the projectID as username and the API secret as password. The authorization header looks as follows: `Basic <:>` The **authorization header** needs to be **Base64 encoded** to be working. If the authorization header is missing or incorrect, the API will respond with status code 401. # Error types As mentioned above we make use of HTTP status codes. **4xx** errors indicate so called client errors, meaning the error occurred on client side and you need to fix it. **5xx** errors indicate server errors, which means the error occurred on server side and outside your control. Besides HTTP status codes Corbado uses what we call error types which gives more details in error cases and help you to debug your request. ## internal_error The error type **internal_error** is used when some internal error occurred at Corbado. You can retry your request but usually there is nothing you can do about it. All internal errors get logged and will triggert an alert to our operations team which takes care of the situation as soon as possible. ## not_found The error type **not_found** is used when you try to get a resource which cannot be found. Most common case is that you provided a wrong ID. ## method_not_allowed The error type **method_not_allowed** is used when you use a HTTP method (GET for example) on a resource/endpoint which it not supports. ## validation_error The error type **validation_error** is used when there is validation error on the data you provided in the request payload or path. There will be detailed information in the JSON response about the validation error like what exactly went wrong on what field. ## project_id_mismatch The error type **project_id_mismatch** is used when there is a project ID you provided mismatch. ## login_error The error type **login_error** is used when the authentication failed. Most common case is that you provided a wrong pair of project ID and API secret. As mentioned above with use HTTP Basic Auth for authentication. ## invalid_json The error type **invalid_json** is used when you send invalid JSON as request body. There will be detailed information in the JSON response about what went wrong. ## rate_limited The error type **rate_limited** is used when ran into rate limiting of the Corbado Backend API. Right now you can do a maximum of **2000 requests** within **10 seconds** from a **single IP**. Throttle your requests and try again. If you think you need more contact support@corbado.com. ## invalid_origin The error type **invalid_origin** is used when the API has been called from a origin which is not authorized (CORS). Add the origin to your project at https://app.corbado.com/app/settings/credentials/authorized-origins. ## already_exists The error type **already_exists** is used when you try create a resource which already exists. Most common case is that there is some unique constraint on one of the fields. # Security and privacy Corbado services are designed, developed, monitored, and updated with security at our core to protect you and your customers’ data and privacy. ## Security ### Infrastructure security Corbado leverages highly available and secure cloud infrastructure to ensure that our services are always available and securely delivered. Corbado's services are operated in uvensys GmbH's data centers in Germany and comply with ISO standard 27001. All data centers have redundant power and internet connections to avoid failure. The main location of the servers used is in Linden and offers 24/7 support. We do not use any AWS, GCP or Azure services. Each server is monitored 24/7 and in the event of problems, automated information is sent via SMS and e-mail. The monitoring is done by the external service provider Serverguard24 GmbH. All Corbado hardware and networking is routinely updated and audited to ensure systems are secure and that least privileged access is followed. Additionally we implement robust logging and audit protocols that allow us high visibility into system use. ### Responsible disclosure program Here at Corbado, we take the security of our user’s data and of our services seriously. As such, we encourage responsible security research on Corbado services and products. If you believe you’ve discovered a potential vulnerability, please let us know by emailing us at [security@corbado.com](mailto:security@corbado.com). We will acknowledge your email within 2 business days. As public disclosures of a security vulnerability could put the entire Corbado community at risk, we ask that you keep such potential vulnerabilities confidential until we are able to address them. We aim to resolve critical issues within 30 days of disclosure. Please make a good faith effort to avoid violating privacy, destroying data, or interrupting or degrading the Corbado service. Please only interact with accounts you own or for which you have explicit permission from the account holder. While researching, please refrain from: - Distributed Denial of Service (DDoS) - Spamming - Social engineering or phishing of Corbado employees or contractors - Any attacks against Corbado's physical property or data centers Thank you for helping to keep Corbado and our users safe! ### Rate limiting At Corbado, we apply rate limit policies on our APIs in order to protect your application and user management infrastructure, so your users will have a frictionless non-interrupted experience. Corbado responds with HTTP status code 429 (too many requests) when the rate limits exceed. Your code logic should be able to handle such cases by checking the status code on the response and recovering from such cases. If a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. The current rate limit for all our API endpoints is **max. 100 requests per 10 seconds**. ## Privacy Corbado is committed to protecting the personal data of our customers and their customers. Corbado has in place appropriate data security measures that meet industry standards. We regularly review and make enhancements to our processes, products, documentation, and contracts to help support ours and our customers’ compliance for the processing of personal data. We try to minimize the usage and processing of personally identifiable information. Therefore, all our services are constructed to avoid unnecessary data consumption. To make our services work, we only require the following data: - any kind of identifier (e.g. UUID, phone number, email address) - IP address (only temporarily for rate limiting aspects) - User agent (for device management) - * - * The version of the OpenAPI document: 1.0.0 - * Contact: support@corbado.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.corbado.generated.model; - -import java.util.Objects; -import com.corbado.generated.model.Paging; -import com.corbado.generated.model.WebhookLog; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.corbado.generated.invoker.JSON; - -/** - * WebhookLogsListRspAllOfData - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-21T11:14:23.049718350Z[Etc/UTC]", comments = "Generator version: 7.7.0-SNAPSHOT") -public class WebhookLogsListRspAllOfData { - public static final String SERIALIZED_NAME_LOGS = "logs"; - @SerializedName(SERIALIZED_NAME_LOGS) - private List logs = new ArrayList<>(); - - public static final String SERIALIZED_NAME_PAGING = "paging"; - @SerializedName(SERIALIZED_NAME_PAGING) - private Paging paging; - - public WebhookLogsListRspAllOfData() { - } - - public WebhookLogsListRspAllOfData logs(List logs) { - this.logs = logs; - return this; - } - - public WebhookLogsListRspAllOfData addLogsItem(WebhookLog logsItem) { - if (this.logs == null) { - this.logs = new ArrayList<>(); - } - this.logs.add(logsItem); - return this; - } - - /** - * Get logs - * @return logs - **/ - @javax.annotation.Nonnull - public List getLogs() { - return logs; - } - - public void setLogs(List logs) { - this.logs = logs; - } - - - public WebhookLogsListRspAllOfData paging(Paging paging) { - this.paging = paging; - return this; - } - - /** - * Get paging - * @return paging - **/ - @javax.annotation.Nonnull - public Paging getPaging() { - return paging; - } - - public void setPaging(Paging paging) { - this.paging = paging; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WebhookLogsListRspAllOfData webhookLogsListRspAllOfData = (WebhookLogsListRspAllOfData) o; - return Objects.equals(this.logs, webhookLogsListRspAllOfData.logs) && - Objects.equals(this.paging, webhookLogsListRspAllOfData.paging); - } - - @Override - public int hashCode() { - return Objects.hash(logs, paging); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WebhookLogsListRspAllOfData {\n"); - sb.append(" logs: ").append(toIndentedString(logs)).append("\n"); - sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("logs"); - openapiFields.add("paging"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("logs"); - openapiRequiredFields.add("paging"); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WebhookLogsListRspAllOfData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!WebhookLogsListRspAllOfData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookLogsListRspAllOfData is not found in the empty JSON string", WebhookLogsListRspAllOfData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!WebhookLogsListRspAllOfData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookLogsListRspAllOfData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : WebhookLogsListRspAllOfData.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - // ensure the json data is an array - if (!jsonObj.get("logs").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `logs` to be an array in the JSON string but got `%s`", jsonObj.get("logs").toString())); - } - - JsonArray jsonArraylogs = jsonObj.getAsJsonArray("logs"); - // validate the required field `logs` (array) - for (int i = 0; i < jsonArraylogs.size(); i++) { - WebhookLog.validateJsonElement(jsonArraylogs.get(i)); - }; - // validate the required field `paging` - Paging.validateJsonElement(jsonObj.get("paging")); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!WebhookLogsListRspAllOfData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'WebhookLogsListRspAllOfData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(WebhookLogsListRspAllOfData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, WebhookLogsListRspAllOfData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public WebhookLogsListRspAllOfData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of WebhookLogsListRspAllOfData given an JSON string - * - * @param jsonString JSON string - * @return An instance of WebhookLogsListRspAllOfData - * @throws IOException if the JSON string is invalid with respect to WebhookLogsListRspAllOfData - */ - public static WebhookLogsListRspAllOfData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, WebhookLogsListRspAllOfData.class); - } - - /** - * Convert an instance of WebhookLogsListRspAllOfData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/corbado/generated/package-info.java b/src/main/java/com/corbado/generated/package-info.java deleted file mode 100644 index 1e26e5e..0000000 --- a/src/main/java/com/corbado/generated/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Desc. - */ -package com.corbado.generated; diff --git a/src/main/java/com/corbado/sdk/CorbadoSdk.java b/src/main/java/com/corbado/sdk/CorbadoSdk.java index 679d664..b89d5a8 100644 --- a/src/main/java/com/corbado/sdk/CorbadoSdk.java +++ b/src/main/java/com/corbado/sdk/CorbadoSdk.java @@ -1,7 +1,7 @@ package com.corbado.sdk; import com.corbado.exceptions.StandardException; -import com.corbado.generated.api.UserApi; +import com.corbado.generated.api.UsersApi; import com.corbado.generated.invoker.ApiClient; import com.corbado.services.UserService; import com.fasterxml.jackson.core.JsonProcessingException; @@ -10,7 +10,6 @@ import java.util.Map; import lombok.Getter; import lombok.NonNull; -import lombok.Setter; /** The Class CorbadoSdk. */ public class CorbadoSdk { @@ -19,11 +18,11 @@ public class CorbadoSdk { private static final String CORBADO_HEADER_NAME = "X-Corbado-SDK"; /** The configuration class. */ - @Getter @Setter private Config config; + @Getter private final Config config; /** The user API. */ @Getter(lazy = true) - private final UserService users = new UserService(new UserApi(this.client)); + private final UserService users = new UserService(new UsersApi(this.client)); /** The client. */ private ApiClient client; @@ -49,7 +48,6 @@ private void initializeClient() throws StandardException { tempClient.setBasePath(this.config.getBackendApi()); tempClient.setUsername(this.config.getProjectId()); tempClient.setPassword(this.config.getApiSecret()); - tempClient.setApiKey(this.config.getProjectId()); // Additional info for requests final Map data = new HashMap<>(); diff --git a/src/main/java/com/corbado/services/SessionService.java b/src/main/java/com/corbado/services/SessionService.java index 40aa5a9..ef4a45b 100644 --- a/src/main/java/com/corbado/services/SessionService.java +++ b/src/main/java/com/corbado/services/SessionService.java @@ -10,7 +10,7 @@ import com.auth0.jwt.algorithms.Algorithm; import com.auth0.jwt.exceptions.JWTVerificationException; import com.auth0.jwt.interfaces.DecodedJWT; -import com.corbado.entities.UserEntity; +import com.corbado.entities.SessionValidationResult; import com.corbado.utils.ValidationUtils; import java.security.interfaces.RSAPublicKey; import java.util.concurrent.TimeUnit; @@ -98,7 +98,8 @@ public void setIssuerMismatchError(final String issuer) { * @param shortSession the short session * @return the and validate short session value */ - private UserEntity getAndValidateUserFromShortSessionValue(final String shortSession) { + private SessionValidationResult getAndValidateUserFromShortSessionValue( + final String shortSession) { if (shortSession == null || shortSession.isEmpty()) { throw new IllegalArgumentException("Session value cannot be null or empty"); @@ -120,31 +121,28 @@ private UserEntity getAndValidateUserFromShortSessionValue(final String shortSes // Verify issuer if (!StringUtils.equals(decodedJwt.getClaim("iss").asString(), this.issuer)) { setIssuerMismatchError(decodedJwt.getClaim("iss").asString()); - return UserEntity.builder().authenticated(false).build(); + return new SessionValidationResult(); } - return UserEntity.builder() + return SessionValidationResult.builder() .authenticated(true) - .userId(decodedJwt.getClaim("sub").asString()) - .name(decodedJwt.getClaim("name").asString()) - .email(decodedJwt.getClaim("email").asString()) - .phoneNumber(decodedJwt.getClaim("phone_number").asString()) + .fullName(decodedJwt.getClaim("name").asString()) + .userID(decodedJwt.getClaim("sub").asString()) .build(); } catch (final JwkException | JWTVerificationException e) { setValidationError(e); - return UserEntity.builder().authenticated(false).build(); + return new SessionValidationResult(); } } /** - * Gets the current user. Returns empty unauthorized user in the case if token is not valid or - * error occurred. + * Retrieves userID and full name if 'shortSession' is valid. * * @param shortSession the short session - * @return the current user + * @return the current user{@link SessionValidationResult} */ - public UserEntity getCurrentUser(final String shortSession) { + public SessionValidationResult getAndValidateCurrentUser(final String shortSession) { return getAndValidateUserFromShortSessionValue(shortSession); } diff --git a/src/main/java/com/corbado/services/UserService.java b/src/main/java/com/corbado/services/UserService.java index 4d560d7..06a8811 100644 --- a/src/main/java/com/corbado/services/UserService.java +++ b/src/main/java/com/corbado/services/UserService.java @@ -1,26 +1,21 @@ package com.corbado.services; +import com.corbado.entities.UserEntity; import com.corbado.exceptions.CorbadoServerException; -import com.corbado.generated.api.UserApi; +import com.corbado.generated.api.UsersApi; import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.model.GenericRsp; import com.corbado.generated.model.UserCreateReq; -import com.corbado.generated.model.UserCreateRsp; -import com.corbado.generated.model.UserDeleteReq; -import com.corbado.generated.model.UserGetRsp; -import com.corbado.generated.model.UserListRsp; import com.corbado.services.base.ApiService; -import java.util.List; /** Service for managing users. */ -public class UserService extends ApiService { +public class UserService extends ApiService { /** * Constructor for UserService. * * @param client User API client */ - public UserService(final UserApi client) { + public UserService(final UsersApi client) { super(client); } @@ -31,9 +26,9 @@ public UserService(final UserApi client) { * @return UserCreateRsp Response * @throws CorbadoServerException If any server-side error occurs. */ - public UserCreateRsp create(final UserCreateReq request) throws CorbadoServerException { + public UserEntity create(final UserCreateReq request) throws CorbadoServerException { try { - return client.userCreate(request); + return new UserEntity(client.userCreate(request)); } catch (final ApiException e) { throw new CorbadoServerException(e); } @@ -47,10 +42,10 @@ public UserCreateRsp create(final UserCreateReq request) throws CorbadoServerExc * @return GenericRsp Response * @throws CorbadoServerException If any server-side error occurs. */ - public GenericRsp delete(final String userId, final UserDeleteReq request) - throws CorbadoServerException { + public UserEntity delete(final String userId) throws CorbadoServerException { try { - return client.userDelete(userId, request); + return new UserEntity(client.userDelete(userId)); + } catch (final ApiException e) { throw new CorbadoServerException(e); } @@ -63,58 +58,9 @@ public GenericRsp delete(final String userId, final UserDeleteReq request) * @return UserGetRsp Response * @throws CorbadoServerException If any server-side error occurs. */ - public UserGetRsp get(final String userId) throws CorbadoServerException { - return get(userId, null, null); - } - - /** - * Get user. - * - * @param userId User ID - * @param remoteAddr Remote address - * @param userAgent User agent - * @return UserGetRsp Response - * @throws CorbadoServerException If any server-side error occurs. - */ - public UserGetRsp get(final String userId, final String remoteAddr, final String userAgent) - throws CorbadoServerException { + public UserEntity get(final String userId) throws CorbadoServerException { try { - return client.userGet(userId, remoteAddr, userAgent); - } catch (final ApiException e) { - throw new CorbadoServerException(e); - } - } - - /** - * List users with paging. - * - * @param remoteAddr Remote address - * @param userAgent User agent - * @param sort Sort - * @param filterArgs Filter arguments. Use null if not needed. - * @param page Page number. Use null if not needed. - * @param pageSize Page size. Use null if not needed. - * @return UserListRsp Response - * @throws CorbadoServerException If any server-side error occurs. - * @throws IllegalArgumentException if page or pageSize <=0 - */ - public UserListRsp listUsers( - final String remoteAddr, - final String userAgent, - final String sort, - final List filterArgs, - final Integer page, - final Integer pageSize) - throws CorbadoServerException, IllegalArgumentException { - try { - if (page != null && page <= 0) { - throw new IllegalArgumentException("age can not be <= 0"); - } - if (pageSize != null && pageSize <= 0) { - throw new IllegalArgumentException("Page size can not be <= 0"); - } - - return client.userList(remoteAddr, userAgent, sort, filterArgs, page, pageSize); + return new UserEntity(client.userGet(userId)); } catch (final ApiException e) { throw new CorbadoServerException(e); } diff --git a/src/test/java/com/corbado/integration/UserServiceIT.java b/src/test/java/com/corbado/integration/UserServiceIT.java index e6fe4af..ee71b9a 100644 --- a/src/test/java/com/corbado/integration/UserServiceIT.java +++ b/src/test/java/com/corbado/integration/UserServiceIT.java @@ -4,17 +4,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; import com.corbado.base.AbstractSdkTest; +import com.corbado.entities.UserEntity; import com.corbado.exceptions.CorbadoServerException; import com.corbado.exceptions.CorbadoServerException.ValidationMessage; import com.corbado.exceptions.StandardException; -import com.corbado.generated.model.GenericRsp; import com.corbado.generated.model.UserCreateReq; -import com.corbado.generated.model.UserCreateRsp; -import com.corbado.generated.model.UserDeleteReq; -import com.corbado.generated.model.UserGetRsp; -import com.corbado.generated.model.UserListRsp; import com.corbado.services.UserService; import com.corbado.util.TestUtils; import org.junit.jupiter.api.BeforeAll; @@ -45,7 +40,7 @@ void test_InstantiateSdkExpectNotNull() { /** Test case for user creation with validation error. * */ @Test void test_UserCreateBlankNameExpectValidationError() { - final UserCreateReq req = new UserCreateReq().name("").email(""); + final UserCreateReq req = new UserCreateReq().fullName(""); final CorbadoServerException e = assertThrows(CorbadoServerException.class, () -> fixture.create(req)); @@ -60,13 +55,10 @@ void test_UserCreateBlankNameExpectValidationError() { /** Test case for successful user creation. * */ @Test void test_UserCreateExpectSuccess() throws CorbadoServerException { - final UserCreateReq req = - new UserCreateReq() - .name(TestUtils.createRandomTestName()) - .email(TestUtils.createRandomTestEmail()); + final UserCreateReq req = new UserCreateReq().fullName(TestUtils.createRandomTestName()); - final UserCreateRsp rsp = fixture.create(req); - assertEquals(200, rsp.getHttpStatusCode()); + final UserEntity rsp = fixture.create(req); + assertEquals(req.getFullName(), rsp.getFullName()); } /** Test for retrieving a user that does not exist. * */ @@ -76,7 +68,7 @@ void test_UserGetExpectNotFound() { assertThrows( CorbadoServerException.class, () -> { - final UserGetRsp ret = fixture.get("usr-1234567890"); + final UserEntity ret = fixture.get("usr-1234567890"); System.out.println(ret.toString()); }); assertNotNull(e); @@ -87,41 +79,15 @@ void test_UserGetExpectNotFound() { @Test void test_UserGetExpectSuccess() throws CorbadoServerException, StandardException { final String userId = TestUtils.createUser(); - final UserGetRsp rsp = fixture.get(userId); - assertEquals(200, rsp.getHttpStatusCode()); + final UserEntity rsp = fixture.delete(userId); + assertEquals(userId, rsp.getUserID()); } /** Test for successfully deleting a user. * */ @Test void test_UserDeleteExpectSuccess() throws CorbadoServerException, StandardException { final String userId = TestUtils.createUser(); - final GenericRsp rsp = fixture.delete(userId, new UserDeleteReq()); - assertEquals(200, rsp.getHttpStatusCode()); - } - - /** Test for listing users with validation error. * */ - @Test - void test_UserListInvalidSortExpectValidationError() { - final CorbadoServerException e = - assertThrows( - CorbadoServerException.class, - () -> fixture.listUsers("", "", "foo:bar", null, null, null)); - assertNotNull(e); - assertEquals(422, e.getHttpStatusCode()); - - assertArrayEquals( - new ValidationMessage[] {new ValidationMessage("sort", "Invalid order direction 'bar'")}, - e.getValidationMessages().toArray()); - } - - /** Test for successfully listing users. * */ - @Test - void test_UserListSuccess() throws CorbadoServerException, StandardException { - final String userId = TestUtils.createUser(); - final UserListRsp rsp = fixture.listUsers(null, null, "created:desc", null, null, null); - - final boolean found = - rsp.getData().getUsers().stream().anyMatch(user -> user.getID().equals(userId)); - assertTrue(found); + final UserEntity rsp = fixture.delete(userId); + assertEquals(userId, rsp.getUserID()); } } diff --git a/src/test/java/com/corbado/unit/SessionServiceTest.java b/src/test/java/com/corbado/unit/SessionServiceTest.java index bea0767..b74402e 100644 --- a/src/test/java/com/corbado/unit/SessionServiceTest.java +++ b/src/test/java/com/corbado/unit/SessionServiceTest.java @@ -10,7 +10,7 @@ import com.auth0.jwk.JwkProvider; import com.auth0.jwt.JWT; import com.auth0.jwt.algorithms.Algorithm; -import com.corbado.entities.UserEntity; +import com.corbado.entities.SessionValidationResult; import com.corbado.exceptions.StandardException; import com.corbado.services.SessionService; import com.google.gson.Gson; @@ -167,25 +167,21 @@ void testInitParametersValidation( } /** - * Test get and validate short session value. + * Test get current user. * - * @param issuer the issuer - * @param jwksUri the jwks uri - * @param shortSessionCookieName the short session cookie name * @param expectValid the expect valid - * @throws StandardException + * @param jwt the jwt + * @throws StandardException the standard exception */ @ParameterizedTest @MethodSource("provideJwts") void test_getCurrentUser(final boolean expectValid, final String jwt) throws StandardException { - final UserEntity currentUser = sessionService.getCurrentUser(jwt); - assertEquals(expectValid, currentUser.isAuthenticated()); + final SessionValidationResult validationResult = sessionService.getAndValidateCurrentUser(jwt); + assertEquals(expectValid, validationResult.isAuthenticated()); if (expectValid) { - assertEquals(TEST_NAME, currentUser.getName()); - assertEquals(TEST_EMAIL, currentUser.getEmail()); - assertEquals(TEST_PHONE_NUMBER, currentUser.getPhoneNumber()); - assertEquals(TEST_USER_ID, currentUser.getUserId()); + assertEquals(TEST_NAME, validationResult.getFullName()); + assertEquals(TEST_USER_ID, validationResult.getUserID()); } } diff --git a/src/test/java/com/corbado/util/TestUtils.java b/src/test/java/com/corbado/util/TestUtils.java index 4a2e712..9a6c0a6 100644 --- a/src/test/java/com/corbado/util/TestUtils.java +++ b/src/test/java/com/corbado/util/TestUtils.java @@ -1,9 +1,9 @@ package com.corbado.util; +import com.corbado.entities.UserEntity; import com.corbado.exceptions.CorbadoServerException; import com.corbado.exceptions.StandardException; import com.corbado.generated.model.UserCreateReq; -import com.corbado.generated.model.UserCreateRsp; import com.corbado.sdk.Config; import com.corbado.sdk.CorbadoSdk; import io.github.cdimascio.dotenv.Dotenv; @@ -61,10 +61,9 @@ public static String createRandomTestPhoneNumber() { * @throws CorbadoServerException */ public static String createUser() throws CorbadoServerException, StandardException { - final UserCreateReq req = - new UserCreateReq().name(createRandomTestName()).email(createRandomTestEmail()); - final UserCreateRsp rsp = instantiateSDK().getUsers().create(req); - return rsp.getData().getUserID(); + final UserCreateReq req = new UserCreateReq().fullName(createRandomTestName()); + final UserEntity rsp = instantiateSDK().getUsers().create(req); + return rsp.getUserID(); } /** From e390c75ff76ea94e56c31e3531a726d7423fa9cf Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 9 Aug 2024 17:27:55 +0200 Subject: [PATCH 22/59] Remove old v1 services --- src/main/java/com/corbado/services/AuthTokenService.java | 3 --- src/main/java/com/corbado/services/EmailMagicLinkService.java | 3 --- src/main/java/com/corbado/services/EmailOtpService.java | 3 --- src/main/java/com/corbado/services/SmsOtpService.java | 3 --- src/main/java/com/corbado/services/ValidationService.java | 3 --- 5 files changed, 15 deletions(-) delete mode 100644 src/main/java/com/corbado/services/AuthTokenService.java delete mode 100644 src/main/java/com/corbado/services/EmailMagicLinkService.java delete mode 100644 src/main/java/com/corbado/services/EmailOtpService.java delete mode 100644 src/main/java/com/corbado/services/SmsOtpService.java delete mode 100644 src/main/java/com/corbado/services/ValidationService.java diff --git a/src/main/java/com/corbado/services/AuthTokenService.java b/src/main/java/com/corbado/services/AuthTokenService.java deleted file mode 100644 index bbc863d..0000000 --- a/src/main/java/com/corbado/services/AuthTokenService.java +++ /dev/null @@ -1,3 +0,0 @@ -package com.corbado.services; - -public class AuthTokenService {} diff --git a/src/main/java/com/corbado/services/EmailMagicLinkService.java b/src/main/java/com/corbado/services/EmailMagicLinkService.java deleted file mode 100644 index 9ae4797..0000000 --- a/src/main/java/com/corbado/services/EmailMagicLinkService.java +++ /dev/null @@ -1,3 +0,0 @@ -package com.corbado.services; - -public class EmailMagicLinkService {} diff --git a/src/main/java/com/corbado/services/EmailOtpService.java b/src/main/java/com/corbado/services/EmailOtpService.java deleted file mode 100644 index aca0ed2..0000000 --- a/src/main/java/com/corbado/services/EmailOtpService.java +++ /dev/null @@ -1,3 +0,0 @@ -package com.corbado.services; - -public class EmailOtpService {} diff --git a/src/main/java/com/corbado/services/SmsOtpService.java b/src/main/java/com/corbado/services/SmsOtpService.java deleted file mode 100644 index 0bd694e..0000000 --- a/src/main/java/com/corbado/services/SmsOtpService.java +++ /dev/null @@ -1,3 +0,0 @@ -package com.corbado.services; - -public class SmsOtpService {} diff --git a/src/main/java/com/corbado/services/ValidationService.java b/src/main/java/com/corbado/services/ValidationService.java deleted file mode 100644 index d41de74..0000000 --- a/src/main/java/com/corbado/services/ValidationService.java +++ /dev/null @@ -1,3 +0,0 @@ -package com.corbado.services; - -public class ValidationService {} From 97f80ba8787d0d2ba454cbfdf09b14fc4c62edf8 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 9 Aug 2024 17:28:54 +0200 Subject: [PATCH 23/59] Add log4j2 logging dependencies and configuration files --- pom.xml | 22 ++++++++++++++++++++++ src/main/resources/log4j2.properties | 18 ++++++++++++++++++ src/test/resources/log4j2.properties | 18 ++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 src/main/resources/log4j2.properties create mode 100644 src/test/resources/log4j2.properties diff --git a/pom.xml b/pom.xml index 2c865fe..e85baa1 100644 --- a/pom.xml +++ b/pom.xml @@ -248,6 +248,28 @@ jwks-rsa 0.22.1 + + + + org.slf4j + slf4j-api + 2.0.15 + + + + + org.apache.logging.log4j + log4j-slf4j2-impl + 2.23.1 + test + + + + + org.apache.logging.log4j + log4j-core + 2.23.1 + diff --git a/src/main/resources/log4j2.properties b/src/main/resources/log4j2.properties new file mode 100644 index 0000000..ebcfb43 --- /dev/null +++ b/src/main/resources/log4j2.properties @@ -0,0 +1,18 @@ +status = warn +name = PropertiesConfig + +filters = threshold + +filter.threshold.type = ThresholdFilter +filter.threshold.level = warn + +appenders = console + +appender.console.type = Console +appender.console.name = STDOUT +appender.console.layout.type = PatternLayout +appender.console.layout.pattern = %d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n + +rootLogger.level = debug +rootLogger.appenderRefs = stdout +rootLogger.appenderRef.stdout.ref = STDOUT diff --git a/src/test/resources/log4j2.properties b/src/test/resources/log4j2.properties new file mode 100644 index 0000000..92e01dd --- /dev/null +++ b/src/test/resources/log4j2.properties @@ -0,0 +1,18 @@ +status = warn +name = PropertiesConfig + +filters = threshold + +filter.threshold.type = ThresholdFilter +filter.threshold.level = debug + +appenders = console + +appender.console.type = Console +appender.console.name = STDOUT +appender.console.layout.type = PatternLayout +appender.console.layout.pattern = %d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n + +rootLogger.level = debug +rootLogger.appenderRefs = stdout +rootLogger.appenderRef.stdout.ref = STDOUT From 3950b40b2c24c2beffaa822b4a6b4e0d19dff786 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 9 Aug 2024 17:33:25 +0200 Subject: [PATCH 24/59] Expand UserService implementation, fix backendApi url --- .../java/com/corbado/entities/UserEntity.java | 5 +- .../exceptions/CorbadoServerException.java | 2 +- src/main/java/com/corbado/sdk/Config.java | 5 +- .../com/corbado/services/SessionService.java | 8 +-- .../com/corbado/services/UserService.java | 61 +++++++++++++++++-- .../corbado/integration/UserServiceIT.java | 25 +++++--- src/test/java/com/corbado/util/TestUtils.java | 16 +++-- 7 files changed, 95 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/corbado/entities/UserEntity.java b/src/main/java/com/corbado/entities/UserEntity.java index aa699d7..c486ffb 100644 --- a/src/main/java/com/corbado/entities/UserEntity.java +++ b/src/main/java/com/corbado/entities/UserEntity.java @@ -18,7 +18,10 @@ public class UserEntity extends User { /** * Instantiates a new user entity. * - * @param authenticated the authenticated + * @param userID the user ID + * @param explicitWebauthnID the explicit webauthn ID + * @param fullName the full name + * @param status the status */ public UserEntity( @NonNull final String userID, diff --git a/src/main/java/com/corbado/exceptions/CorbadoServerException.java b/src/main/java/com/corbado/exceptions/CorbadoServerException.java index b0635d7..84422ac 100644 --- a/src/main/java/com/corbado/exceptions/CorbadoServerException.java +++ b/src/main/java/com/corbado/exceptions/CorbadoServerException.java @@ -42,7 +42,7 @@ public CorbadoServerException(@NonNull final ApiException e) { * @param statusCode the status code * @param body the body */ - public CorbadoServerException(final int statusCode, @NonNull final String body) { + public CorbadoServerException(final int statusCode, final String body) { final Gson gson = new Gson(); httpStatusCode = statusCode; this.errorResponse = gson.fromJson(body, ErrorResponse.class); diff --git a/src/main/java/com/corbado/sdk/Config.java b/src/main/java/com/corbado/sdk/Config.java index 2878864..39217f6 100644 --- a/src/main/java/com/corbado/sdk/Config.java +++ b/src/main/java/com/corbado/sdk/Config.java @@ -4,6 +4,7 @@ import java.net.URL; import lombok.Getter; import lombok.Setter; +import lombok.extern.slf4j.Slf4j; /** * Configuration class for setting up project parameters. @@ -12,6 +13,7 @@ * backend API URL, and other parameters. It provides validation for these fields and computes * derived properties like frontend API URL and issuer. */ +@Slf4j public class Config { // Fields @@ -29,7 +31,7 @@ public class Config { @Getter private String apiSecret; /** The backend api with custom setter. */ - @Getter private String backendApi = "https://backendapi.corbado.io"; + @Getter private String backendApi = "https://backendapi.cloud.corbado.io/v2"; /** The short session cookie name. */ @Getter @Setter private String shortSessionCookieName = "cbo_short_session"; @@ -48,6 +50,7 @@ public class Config { * @param apiSecret the api secret */ public Config(final String projectId, final String apiSecret) { + setProjectId(projectId); // set and validate setApiSecret(apiSecret); diff --git a/src/main/java/com/corbado/services/SessionService.java b/src/main/java/com/corbado/services/SessionService.java index ef4a45b..301479d 100644 --- a/src/main/java/com/corbado/services/SessionService.java +++ b/src/main/java/com/corbado/services/SessionService.java @@ -31,13 +31,13 @@ public class SessionService { private static final int JWK_CACHE_SIZE = 100; /** The short session cookie name. */ - private String shortSessionCookieName; + private final String shortSessionCookieName; /** The issuer. */ - private String issuer; + private final String issuer; /** The jwks uri. */ - private String jwksUri; + private final String jwksUri; /** The last short session validation result. */ private String lastShortSessionValidationResult; @@ -49,7 +49,7 @@ public class SessionService { private boolean cacheKeys = false; /** The jwk provider. */ - private JwkProvider jwkProvider; + private final JwkProvider jwkProvider; /** * Instantiates a new session service. diff --git a/src/main/java/com/corbado/services/UserService.java b/src/main/java/com/corbado/services/UserService.java index 06a8811..88e48c1 100644 --- a/src/main/java/com/corbado/services/UserService.java +++ b/src/main/java/com/corbado/services/UserService.java @@ -5,7 +5,11 @@ import com.corbado.generated.api.UsersApi; import com.corbado.generated.invoker.ApiException; import com.corbado.generated.model.UserCreateReq; +import com.corbado.generated.model.UserStatus; import com.corbado.services.base.ApiService; +import java.util.Objects; +import javax.annotation.Nullable; +import lombok.NonNull; /** Service for managing users. */ public class UserService extends ApiService { @@ -26,7 +30,55 @@ public UserService(final UsersApi client) { * @return UserCreateRsp Response * @throws CorbadoServerException If any server-side error occurs. */ - public UserEntity create(final UserCreateReq request) throws CorbadoServerException { + public UserEntity create(@NonNull final UserCreateReq request) throws CorbadoServerException { + Objects.requireNonNull( + request.getStatus(), "Required field 'UserCreateReq.status' in 'request' cannot be null"); + + try { + return new UserEntity(client.userCreate(request)); + } catch (final ApiException e) { + throw new CorbadoServerException(e); + } + } + + /** + * Create a user. + * + * @param fullName the full name + * @param status the status + * @param explicitWebauthnID the explicit webauthn ID + * @return the user entity + * @throws CorbadoServerException If any server-side error occurs + */ + public UserEntity create( + @NonNull final String fullName, + @NonNull final UserStatus status, + @Nullable final String explicitWebauthnID) + throws CorbadoServerException { + + final UserCreateReq request = + new UserCreateReq() + .fullName(fullName) + .status(status) + .explicitWebauthnID(explicitWebauthnID); + try { + return new UserEntity(client.userCreate(request)); + } catch (final ApiException e) { + throw new CorbadoServerException(e); + } + } + + /** + * Creates the active user by name. + * + * @param fullName the full name + * @return the user entity + * @throws CorbadoServerException If any server-side error occurs + */ + public UserEntity createActiveByName(@NonNull final String fullName) + throws CorbadoServerException { + + final UserCreateReq request = new UserCreateReq().fullName(fullName).status(UserStatus.ACTIVE); try { return new UserEntity(client.userCreate(request)); } catch (final ApiException e) { @@ -37,10 +89,9 @@ public UserEntity create(final UserCreateReq request) throws CorbadoServerExcept /** * Delete user. * - * @param userId User ID - * @param request Request - * @return GenericRsp Response - * @throws CorbadoServerException If any server-side error occurs. + * @param userId the user id + * @return the user entity + * @throws CorbadoServerException the corbado server exception */ public UserEntity delete(final String userId) throws CorbadoServerException { try { diff --git a/src/test/java/com/corbado/integration/UserServiceIT.java b/src/test/java/com/corbado/integration/UserServiceIT.java index ee71b9a..804bf48 100644 --- a/src/test/java/com/corbado/integration/UserServiceIT.java +++ b/src/test/java/com/corbado/integration/UserServiceIT.java @@ -33,17 +33,16 @@ public void setUpClass() throws StandardException { /** Test instantiate sdk expect not null. */ @Test - void test_InstantiateSdkExpectNotNull() { + void test_InstantiateSdk_ExpectNotNull() { assertNotNull(sdk); } /** Test case for user creation with validation error. * */ @Test - void test_UserCreateBlankNameExpectValidationError() { - final UserCreateReq req = new UserCreateReq().fullName(""); + void test_UserCreateBlankName_ExpectSuccess() { final CorbadoServerException e = - assertThrows(CorbadoServerException.class, () -> fixture.create(req)); + assertThrows(CorbadoServerException.class, () -> fixture.createActiveByName("")); assertNotNull(e); assertEquals(400, e.getHttpStatusCode()); @@ -55,15 +54,22 @@ void test_UserCreateBlankNameExpectValidationError() { /** Test case for successful user creation. * */ @Test void test_UserCreateExpectSuccess() throws CorbadoServerException { + final String name = TestUtils.createRandomTestName(); + final UserEntity rsp = fixture.createActiveByName(name); + assertEquals(name, rsp.getFullName()); + } + + /** Test case for missing status on user creation. * */ + @Test + void test_UserCreateWithoutStatus_ExpectNullPoinerException() throws CorbadoServerException { final UserCreateReq req = new UserCreateReq().fullName(TestUtils.createRandomTestName()); - final UserEntity rsp = fixture.create(req); - assertEquals(req.getFullName(), rsp.getFullName()); + assertThrows(NullPointerException.class, () -> fixture.create(req)); } /** Test for retrieving a user that does not exist. * */ @Test - void test_UserGetExpectNotFound() { + void test_UserGet_ExpectNotFound() { final CorbadoServerException e = assertThrows( CorbadoServerException.class, @@ -77,7 +83,7 @@ void test_UserGetExpectNotFound() { /** Test for successfully retrieving a user. * */ @Test - void test_UserGetExpectSuccess() throws CorbadoServerException, StandardException { + void test_UserGet_ExpectSuccess() throws CorbadoServerException, StandardException { final String userId = TestUtils.createUser(); final UserEntity rsp = fixture.delete(userId); assertEquals(userId, rsp.getUserID()); @@ -85,9 +91,10 @@ void test_UserGetExpectSuccess() throws CorbadoServerException, StandardExceptio /** Test for successfully deleting a user. * */ @Test - void test_UserDeleteExpectSuccess() throws CorbadoServerException, StandardException { + void test_UserDelete_ExpectSuccess() throws CorbadoServerException, StandardException { final String userId = TestUtils.createUser(); final UserEntity rsp = fixture.delete(userId); + assertEquals(userId, rsp.getUserID()); } } diff --git a/src/test/java/com/corbado/util/TestUtils.java b/src/test/java/com/corbado/util/TestUtils.java index 9a6c0a6..6328c48 100644 --- a/src/test/java/com/corbado/util/TestUtils.java +++ b/src/test/java/com/corbado/util/TestUtils.java @@ -4,12 +4,12 @@ import com.corbado.exceptions.CorbadoServerException; import com.corbado.exceptions.StandardException; import com.corbado.generated.model.UserCreateReq; +import com.corbado.generated.model.UserStatus; import com.corbado.sdk.Config; import com.corbado.sdk.CorbadoSdk; import io.github.cdimascio.dotenv.Dotenv; import java.util.Random; -// TODO: Auto-generated Javadocs /** The Class TestUtils. */ public class TestUtils { /** The Constant CORBADO_API_SECRET. */ @@ -22,6 +22,9 @@ public class TestUtils { /** The Constant CORBADO_BACKEND_API. */ public static final String CORBADO_BACKEND_API = "CORBADO_BACKEND_API"; + /** The Constant CANNOT_BE_BLANK_MESSAGE. */ + public static final String CANNOT_BE_BLANK_MESSAGE = "cannot be blank"; + /** * Generate a random test email. * @@ -54,14 +57,15 @@ public static String createRandomTestPhoneNumber() { } /** - * Create a user and return the user ID. + * Creates the user. * - * @return user ID of the created user - * @throws StandardException - * @throws CorbadoServerException + * @return the string + * @throws CorbadoServerException the corbado server exception + * @throws StandardException the standard exception */ public static String createUser() throws CorbadoServerException, StandardException { - final UserCreateReq req = new UserCreateReq().fullName(createRandomTestName()); + final UserCreateReq req = + new UserCreateReq().fullName(createRandomTestName()).status(UserStatus.ACTIVE); final UserEntity rsp = instantiateSDK().getUsers().create(req); return rsp.getUserID(); } From bb87bf344d3e98d98c1318b2724180bd89e6a547 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 9 Aug 2024 17:34:42 +0200 Subject: [PATCH 25/59] Add IdentifierService --- src/main/java/com/corbado/sdk/CorbadoSdk.java | 13 +- .../corbado/services/IdentifierService.java | 221 ++++++++++++++++++ .../integration/IdentifierServiceIT.java | 220 +++++++++++++++++ 3 files changed, 452 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/corbado/services/IdentifierService.java create mode 100644 src/test/java/com/corbado/integration/IdentifierServiceIT.java diff --git a/src/main/java/com/corbado/sdk/CorbadoSdk.java b/src/main/java/com/corbado/sdk/CorbadoSdk.java index b89d5a8..a49019c 100644 --- a/src/main/java/com/corbado/sdk/CorbadoSdk.java +++ b/src/main/java/com/corbado/sdk/CorbadoSdk.java @@ -1,8 +1,10 @@ package com.corbado.sdk; import com.corbado.exceptions.StandardException; +import com.corbado.generated.api.IdentifiersApi; import com.corbado.generated.api.UsersApi; import com.corbado.generated.invoker.ApiClient; +import com.corbado.services.IdentifierService; import com.corbado.services.UserService; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -10,8 +12,10 @@ import java.util.Map; import lombok.Getter; import lombok.NonNull; +import lombok.extern.slf4j.Slf4j; /** The Class CorbadoSdk. */ +@Slf4j public class CorbadoSdk { /** The Constant CORBADO_HEADER_NAME. */ @@ -20,10 +24,15 @@ public class CorbadoSdk { /** The configuration class. */ @Getter private final Config config; - /** The user API. */ + /** The users API. */ @Getter(lazy = true) private final UserService users = new UserService(new UsersApi(this.client)); + /** The identifiers API. */ + @Getter(lazy = true) + private final IdentifierService identifiers = + new IdentifierService(new IdentifiersApi(this.client)); + /** The client. */ private ApiClient client; @@ -45,10 +54,10 @@ public CorbadoSdk(final @NonNull Config config) throws StandardException { */ private void initializeClient() throws StandardException { final ApiClient tempClient = new ApiClient(); + tempClient.setBasePath(this.config.getBackendApi()); tempClient.setUsername(this.config.getProjectId()); tempClient.setPassword(this.config.getApiSecret()); - // Additional info for requests final Map data = new HashMap<>(); data.put("name", "Java SDK"); diff --git a/src/main/java/com/corbado/services/IdentifierService.java b/src/main/java/com/corbado/services/IdentifierService.java new file mode 100644 index 0000000..f21aec8 --- /dev/null +++ b/src/main/java/com/corbado/services/IdentifierService.java @@ -0,0 +1,221 @@ +package com.corbado.services; + +import com.corbado.exceptions.CorbadoServerException; +import com.corbado.generated.api.IdentifiersApi; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.model.Identifier; +import com.corbado.generated.model.IdentifierCreateReq; +import com.corbado.generated.model.IdentifierList; +import com.corbado.generated.model.IdentifierStatus; +import com.corbado.generated.model.IdentifierType; +import com.corbado.generated.model.IdentifierUpdateReq; +import com.corbado.services.base.ApiService; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import javax.annotation.Nullable; +import lombok.NonNull; + +/** This class provides functionality for managing login identifiers. */ +public class IdentifierService extends ApiService { + + /** + * Instantiates a new identifier service. + * + * @param client the client + */ + public IdentifierService(final IdentifiersApi client) { + super(client); + } + + /** + * Create a new login identifier. + * + * @param userID ID of user (required) + * @param identifierCreateReq + * @return Identifier + * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize + * the response body + */ + public Identifier create( + @NonNull final String userID, @NonNull final IdentifierCreateReq identifierCreateReq) + throws CorbadoServerException { + Objects.requireNonNull( + identifierCreateReq.getIdentifierType(), + "Required field 'IdentifierCreateReq.identifierType' in 'identifierCreateReq' cannot be null\""); + Objects.requireNonNull( + identifierCreateReq.getIdentifierValue(), + "Required field 'IdentifierCreateReq.identifierValue' in 'identifierCreateReq' cannot be null\""); + Objects.requireNonNull( + identifierCreateReq.getStatus(), + "Required field 'IdentifierCreateReq.status' in 'identifierCreateReq' cannot be null\""); + + try { + return client.identifierCreate(userID, identifierCreateReq); + // client.identifierList(userID, null, null, null) + } catch (final ApiException e) { + throw new CorbadoServerException(e); + } + } + + /** + * Returns a list of matching identifiers + * + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return IdentifierList list of matching identifiers + * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize + * the response body + */ + public IdentifierList list( + @Nullable final String sort, + @Nullable final List filter, + @Nullable final Integer page, + @Nullable final Integer pageSize) + throws CorbadoServerException { + try { + return client.identifierList(sort, filter, page, pageSize); + } catch (final ApiException e) { + throw new CorbadoServerException(e); + } + } + + /** + * Returns a list of matching identifiers + * + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return IdentifierList list of matching identifiers + * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize + * the response body + */ + public IdentifierList listAllWithPaging( + @Nullable final Integer page, @Nullable final Integer pageSize) + throws CorbadoServerException { + return list(null, null, page, pageSize); + } + + /** + * Gets the by value and type. + * + * @param value the value + * @param type the type + * @return the by value and type + * @throws CorbadoServerException the corbado server exception + */ + public IdentifierList listByValueAndType( + @NonNull final String value, @NonNull final IdentifierType type) + throws CorbadoServerException { + return list( + null, + Arrays.asList("identifierValue:eq:" + value, "identifierType:eq:" + type), + null, + null); + } + + /** + * Gets the identifiers matching identifier value and identifier type. + * + * @param sort the sort + * @param value the identifier value + * @param type the identifier type + * @param page the page + * @param pageSize the page size + * @return list of matching identifiers + * @throws CorbadoServerException tIf fail to call the API, e.g. server error or cannot + * deserialize the response body + */ + public IdentifierList listByValueAndTypeWithPaging( + @Nullable final String sort, + @NonNull final String value, + @NonNull final IdentifierType type, + @Nullable final Integer page, + @Nullable final Integer pageSize) + throws CorbadoServerException { + return list( + sort, + Arrays.asList("identifierValue:eq:" + value, "identifierType:eq:" + type), + page, + pageSize); + } + + /** + * Exists by value and type. + * + * @return the identifier list + * @throws ApiException the api exception + * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize + * the response body + */ + public boolean existsByValueAndType( + @NonNull final String value, @NonNull final IdentifierType type) + throws CorbadoServerException { + + final IdentifierList ret = + list( + null, + Arrays.asList("identifierValue:eq:" + value, "identifierType:eq:" + type), + null, + null); + return !ret.getIdentifiers().isEmpty(); + } + + /** + * List by user id with paging. + * + * @param userID the user ID + * @param page the page + * @param pageSize the page size + * @return the identifier list + * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize + * the response body + */ + // TODO: finish impl. + public IdentifierList listAllByUserIdWithPaging( + @NonNull final String userID, @Nullable final Integer page, @Nullable final Integer pageSize) + throws CorbadoServerException { + return list(null, Arrays.asList("userID:eq:" + userID), page, pageSize); + } + + /** + * Updates a login identifier (e.g. from pending to verified) + * + * @param userID ID of user (required) + * @param identifierID ID of login identifier (required) + * @param identifierUpdateReq (required) + * @return Identifier + * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize + * the response body + */ + public Identifier updateStatus( + @NonNull final String userID, + @NonNull final String identifierID, + @NonNull final IdentifierUpdateReq identifierUpdateReq) + throws CorbadoServerException { + try { + return client.identifierUpdate(userID, identifierID, identifierUpdateReq); + } catch (final ApiException e) { + throw new CorbadoServerException(e); + } + } + + /** + * Updates a login identifier (e.g. from pending to verified) + * + * @param userID ID of user (required) + * @param identifierID ID of login identifier (required) + * @param status IdentifierStatus (required) + * @return Identifier + * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize + * the response body + */ + public Identifier updateStatus( + @NonNull final String userID, + @NonNull final String identifierID, + @NonNull final IdentifierStatus status) + throws CorbadoServerException { + return updateStatus(userID, identifierID, new IdentifierUpdateReq().status(status)); + } +} diff --git a/src/test/java/com/corbado/integration/IdentifierServiceIT.java b/src/test/java/com/corbado/integration/IdentifierServiceIT.java new file mode 100644 index 0000000..500c4b7 --- /dev/null +++ b/src/test/java/com/corbado/integration/IdentifierServiceIT.java @@ -0,0 +1,220 @@ +package com.corbado.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import com.corbado.base.AbstractSdkTest; +import com.corbado.exceptions.CorbadoServerException; +import com.corbado.exceptions.StandardException; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.model.Identifier; +import com.corbado.generated.model.IdentifierCreateReq; +import com.corbado.generated.model.IdentifierList; +import com.corbado.generated.model.IdentifierStatus; +import com.corbado.generated.model.IdentifierType; +import com.corbado.services.IdentifierService; +import com.corbado.util.TestUtils; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import lombok.extern.slf4j.Slf4j; + +/** The Class UserServiceIT. */ +@Slf4j +class IdentifierServiceIT extends AbstractSdkTest { + + /** The fixture under test. */ + private static IdentifierService fixture; + + /** The test user id. */ + private static String TEST_USER_ID = null; + + /** The test user email. */ + private static String TEST_USER_EMAIL = null; + + /** The test user phone. */ + private static String TEST_USER_PHONE = null; + + /** The test user email id. */ + private static Identifier TEST_USER_EMAIL_IDENTIFIER = null; + + /** + * Sets the up class. + * + * @throws StandardException the standard exception + * @throws CorbadoServerException + */ + @BeforeAll + public void setUpClass() throws StandardException, CorbadoServerException { + fixture = sdk.getIdentifiers(); + TEST_USER_ID = TestUtils.createUser(); + TEST_USER_EMAIL = TestUtils.createRandomTestEmail(); + TEST_USER_PHONE = TestUtils.createRandomTestPhoneNumber(); + + TEST_USER_EMAIL_IDENTIFIER = + fixture.create( + TEST_USER_ID, + new IdentifierCreateReq() + .identifierType(IdentifierType.EMAIL) + .identifierValue(TEST_USER_EMAIL) + .status(IdentifierStatus.PRIMARY)); + fixture.create( + TEST_USER_ID, + new IdentifierCreateReq() + .identifierType(IdentifierType.PHONE) + .identifierValue(TEST_USER_PHONE) + .status(IdentifierStatus.PRIMARY)); + + log.debug( + "TEST_USER_ID: {}, TEST_USER_EMAIL: {}, TEST_USER_PHONE: {}", + TEST_USER_ID, + TEST_USER_EMAIL, + TEST_USER_PHONE); + } + + /** Test for successfully creating an identifier. * */ + @Test + void test_CreateIdentifier_ExpectSuccess() throws CorbadoServerException, StandardException { + final String userId = TestUtils.createUser(); + final String email = TestUtils.createRandomTestEmail(); + final Identifier rsp = + fixture.create( + userId, + new IdentifierCreateReq() + .identifierType(IdentifierType.EMAIL) + .identifierValue(email) + .status(IdentifierStatus.PRIMARY)); + + assertEquals(userId, rsp.getUserID()); + assertEquals(email, rsp.getValue()); + assertEquals(IdentifierType.EMAIL, rsp.getType()); + } + + /** + * Test create empty identifier expect exception. + * + * @throws CorbadoServerException the corbado server exception + * @throws StandardException the standard exception + */ + @Test + void test_CreateEmptyIdentifier_ExpectException() + throws CorbadoServerException, StandardException { + final String userId = TestUtils.createUser(); + final String email = ""; + final CorbadoServerException e = + assertThrows( + CorbadoServerException.class, + () -> { + fixture.create( + userId, + new IdentifierCreateReq() + .identifierType(IdentifierType.EMAIL) + .identifierValue(email) + .status(IdentifierStatus.PRIMARY)); + }); + + assertValidationErrorEquals(e, "identifierValue", TestUtils.CANNOT_BE_BLANK_MESSAGE); + } + + /** + * Test list expect success. + * + * @throws CorbadoServerException the corbado server exception + * @throws StandardException the standard exception + */ + @Test + void test_ListIdentifiersAll_ExpectSuccess() throws CorbadoServerException, StandardException { + final IdentifierList ret = fixture.list(null, null, null, 100); + + for (final Identifier x : ret.getIdentifiers()) { + log.error("Userid: {}, Value: {}", x.getUserID(), x.getValue()); + } + + assertNotNull(ret); + } + + /** + * Test get email and get email with false identifier. + * + * @throws CorbadoServerException the corbado server exception + * @throws StandardException the standard exception + * @throws ApiException the api exception + */ + @Test + void test_checkExistingEmailIsPresent_ExpectSuccess() + throws CorbadoServerException, StandardException, ApiException { + + IdentifierList ret = fixture.listByValueAndType(TEST_USER_EMAIL, IdentifierType.EMAIL); + assertNotEquals(0, ret.getIdentifiers().size()); + ret = fixture.listByValueAndType(TEST_USER_EMAIL, IdentifierType.PHONE); + assertTrue(fixture.existsByValueAndType(TEST_USER_EMAIL, IdentifierType.EMAIL)); + assertFalse((fixture.existsByValueAndType(TEST_USER_EMAIL, IdentifierType.PHONE))); + assertEquals(0, ret.getIdentifiers().size()); + } + + /** + * Test get email and get email with false identifier. + * + * @throws CorbadoServerException the corbado server exception + * @throws StandardException the standard exception + * @throws ApiException the api exception + */ + @Test + void test_getIdentifiersForUserId_ExpectListOfIdentifiers() + throws CorbadoServerException, StandardException, ApiException { + + final IdentifierList ret = fixture.listAllByUserIdWithPaging(TEST_USER_ID, null, null); + + assertEquals(2, ret.getIdentifiers().size()); + } + + /** + * Test get email and get email with false identifier. + * + * @throws CorbadoServerException the corbado server exception + * @throws StandardException the standard exception + * @throws ApiException the api exception + */ + @Test + void test_updateIdentifier_ExpectSuccess() + throws CorbadoServerException, StandardException, ApiException { + fixture.updateStatus( + TEST_USER_EMAIL_IDENTIFIER.getUserID(), + TEST_USER_EMAIL_IDENTIFIER.getIdentifierID(), + IdentifierStatus.PENDING); + IdentifierList ret = + fixture.listByValueAndType( + TEST_USER_EMAIL_IDENTIFIER.getValue(), TEST_USER_EMAIL_IDENTIFIER.getType()); + assertEquals(IdentifierStatus.PENDING, ret.getIdentifiers().get(0).getStatus()); + + fixture.updateStatus( + TEST_USER_EMAIL_IDENTIFIER.getUserID(), + TEST_USER_EMAIL_IDENTIFIER.getIdentifierID(), + IdentifierStatus.PRIMARY); + + ret = + fixture.listByValueAndType( + TEST_USER_EMAIL_IDENTIFIER.getValue(), TEST_USER_EMAIL_IDENTIFIER.getType()); + assertEquals(IdentifierStatus.PRIMARY, ret.getIdentifiers().get(0).getStatus()); + } + + // ----------- Helper functions ------------// + + /** + * Assert validation error equals. + * + * @param e the e + * @param validatedFieldName the validated field name + * @param expectedMessage the expected message + */ + private void assertValidationErrorEquals( + final CorbadoServerException e, + final String validatedFieldName, + final String expectedMessage) { + assertEquals(1, e.getValidationMessages().size()); + assertEquals(validatedFieldName, e.getValidationMessages().get(0).getField()); + assertEquals(expectedMessage, e.getValidationMessages().get(0).getMessage()); + } +} From 4ecaffa46696677d89ae010516fc56fe80453145 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 9 Aug 2024 17:58:49 +0200 Subject: [PATCH 26/59] Corrected Identifier search function by userID --- .../com/corbado/services/IdentifierService.java | 13 ++++++++++--- .../corbado/integration/IdentifierServiceIT.java | 6 ++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/corbado/services/IdentifierService.java b/src/main/java/com/corbado/services/IdentifierService.java index f21aec8..a61a45a 100644 --- a/src/main/java/com/corbado/services/IdentifierService.java +++ b/src/main/java/com/corbado/services/IdentifierService.java @@ -19,6 +19,9 @@ /** This class provides functionality for managing login identifiers. */ public class IdentifierService extends ApiService { + /** The user id prefix. */ + private static String USER_ID_PREFIX = "usr-"; + /** * Instantiates a new identifier service. * @@ -165,17 +168,21 @@ public boolean existsByValueAndType( /** * List by user id with paging. * - * @param userID the user ID + * @param userID the user ID (with or without 'usr-' prefix) * @param page the page * @param pageSize the page size * @return the identifier list * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize * the response body */ - // TODO: finish impl. public IdentifierList listAllByUserIdWithPaging( - @NonNull final String userID, @Nullable final Integer page, @Nullable final Integer pageSize) + @NonNull String userID, @Nullable final Integer page, @Nullable final Integer pageSize) throws CorbadoServerException { + + // filter queries are using userID without prefix + if (userID.startsWith(USER_ID_PREFIX)) { + userID = userID.substring(USER_ID_PREFIX.length()); + } return list(null, Arrays.asList("userID:eq:" + userID), page, pageSize); } diff --git a/src/test/java/com/corbado/integration/IdentifierServiceIT.java b/src/test/java/com/corbado/integration/IdentifierServiceIT.java index 500c4b7..df47627 100644 --- a/src/test/java/com/corbado/integration/IdentifierServiceIT.java +++ b/src/test/java/com/corbado/integration/IdentifierServiceIT.java @@ -155,7 +155,7 @@ void test_checkExistingEmailIsPresent_ExpectSuccess() } /** - * Test get email and get email with false identifier. + * Test case for search for Identifiers by userId. * * @throws CorbadoServerException the corbado server exception * @throws StandardException the standard exception @@ -166,7 +166,9 @@ void test_getIdentifiersForUserId_ExpectListOfIdentifiers() throws CorbadoServerException, StandardException, ApiException { final IdentifierList ret = fixture.listAllByUserIdWithPaging(TEST_USER_ID, null, null); - + ret.getIdentifiers().stream() + .map(Identifier::getIdentifierID) + .anyMatch(x -> x.equals(TEST_USER_EMAIL_IDENTIFIER.getIdentifierID())); assertEquals(2, ret.getIdentifiers().size()); } From 7d63249ef9c7e29b10d2e6c251000f1a681f4c29 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Tue, 13 Aug 2024 14:19:03 +0200 Subject: [PATCH 27/59] updated generated code from new OpenAPI specification --- .../corbado/generated/api/AuthEventsApi.java | 13 +- .../corbado/generated/api/ChallengesApi.java | 26 +- .../generated/api/ConnectTokensApi.java | 26 +- .../corbado/generated/api/IdentifiersApi.java | 26 +- .../generated/api/PasskeyChallengesApi.java | 384 ++++++++++++++++++ .../generated/api/PasskeyEventsApi.java | 151 ++++++- .../corbado/generated/api/PasskeysApi.java | 78 ++-- .../corbado/generated/api/SessionsApi.java | 39 +- .../com/corbado/generated/api/UsersApi.java | 63 +-- .../generated/invoker/ApiException.java | 2 +- .../generated/invoker/Configuration.java | 2 +- .../com/corbado/generated/invoker/JSON.java | 3 + .../com/corbado/generated/invoker/Pair.java | 2 +- .../invoker/ServerConfiguration.java | 2 +- .../generated/invoker/ServerVariable.java | 2 +- .../corbado/generated/invoker/StringUtil.java | 2 +- .../generated/invoker/auth/ApiKeyAuth.java | 2 +- .../invoker/auth/HttpBearerAuth.java | 2 +- .../model/AbstractOpenApiSchema.java | 2 +- .../corbado/generated/model/AuthEvent.java | 2 +- .../generated/model/AuthEventCreateReq.java | 2 +- .../corbado/generated/model/Challenge.java | 2 +- .../generated/model/ChallengeCreateReq.java | 2 +- .../generated/model/ChallengeUpdateReq.java | 2 +- .../generated/model/ClientInformation.java | 2 +- .../corbado/generated/model/ConnectToken.java | 2 +- .../model/ConnectTokenCreateReq.java | 2 +- .../generated/model/ConnectTokenData.java | 2 +- .../model/ConnectTokenDataPasskeyAppend.java | 2 +- .../model/ConnectTokenDataPasskeyDelete.java | 2 +- .../model/ConnectTokenDataPasskeyList.java | 2 +- .../generated/model/ConnectTokenList.java | 2 +- .../model/ConnectTokenUpdateReq.java | 2 +- .../corbado/generated/model/Credential.java | 2 +- .../generated/model/CredentialList.java | 2 +- .../corbado/generated/model/DetectionTag.java | 2 +- .../com/corbado/generated/model/ErrorRsp.java | 2 +- .../generated/model/ErrorRspAllOfError.java | 2 +- .../model/ErrorRspAllOfErrorValidation.java | 2 +- .../corbado/generated/model/GenericRsp.java | 2 +- .../corbado/generated/model/Identifier.java | 2 +- .../generated/model/IdentifierCreateReq.java | 2 +- .../generated/model/IdentifierList.java | 2 +- .../generated/model/IdentifierUpdateReq.java | 2 +- .../model/JavaScriptHighEntropy.java | 2 +- .../corbado/generated/model/LongSession.java | 2 +- .../generated/model/LongSessionCreateReq.java | 2 +- .../generated/model/LongSessionUpdateReq.java | 2 +- .../com/corbado/generated/model/Paging.java | 2 +- .../model/PasskeyAppendFinishReq.java | 2 +- .../model/PasskeyAppendFinishRsp.java | 2 +- .../model/PasskeyAppendStartReq.java | 2 +- .../model/PasskeyAppendStartRsp.java | 2 +- .../generated/model/PasskeyChallenge.java | 358 ++++++++++++++++ .../generated/model/PasskeyChallengeList.java | 262 ++++++++++++ .../model/PasskeyChallengeStatus.java | 80 ++++ .../generated/model/PasskeyChallengeType.java | 78 ++++ .../model/PasskeyChallengeUpdateReq.java | 214 ++++++++++ .../corbado/generated/model/PasskeyData.java | 123 +++++- .../corbado/generated/model/PasskeyEvent.java | 2 +- .../model/PasskeyEventCreateReq.java | 93 ++++- .../generated/model/PasskeyEventList.java | 2 +- .../generated/model/PasskeyEventType.java | 12 +- .../generated/model/PasskeyIntelFlags.java | 2 +- .../model/PasskeyLoginFinishReq.java | 2 +- .../model/PasskeyLoginFinishRsp.java | 2 +- .../generated/model/PasskeyLoginStartReq.java | 2 +- .../generated/model/PasskeyLoginStartRsp.java | 33 +- .../model/PasskeyMediationFinishReq.java | 36 +- .../model/PasskeyMediationFinishRsp.java | 2 +- .../model/PasskeyMediationStartReq.java | 2 +- .../model/PasskeyMediationStartRsp.java | 2 +- .../model/ProjectConfigUpdateCnameReq.java | 2 +- .../corbado/generated/model/RequestData.java | 2 +- .../corbado/generated/model/ShortSession.java | 2 +- .../model/ShortSessionCreateReq.java | 2 +- .../generated/model/SocialAccount.java | 2 +- .../model/SocialAccountCreateReq.java | 2 +- .../generated/model/SocialAccountList.java | 2 +- .../com/corbado/generated/model/User.java | 2 +- .../generated/model/UserCreateReq.java | 2 +- .../generated/model/UserUpdateReq.java | 2 +- .../com/corbado/services/UserService.java | 5 +- .../corbado/integration/UserServiceIT.java | 10 +- 84 files changed, 2050 insertions(+), 187 deletions(-) create mode 100644 src/main/java/com/corbado/generated/api/PasskeyChallengesApi.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyChallenge.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyChallengeList.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyChallengeStatus.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyChallengeType.java create mode 100644 src/main/java/com/corbado/generated/model/PasskeyChallengeUpdateReq.java diff --git a/src/main/java/com/corbado/generated/api/AuthEventsApi.java b/src/main/java/com/corbado/generated/api/AuthEventsApi.java index cc1d0e4..4e72970 100644 --- a/src/main/java/com/corbado/generated/api/AuthEventsApi.java +++ b/src/main/java/com/corbado/generated/api/AuthEventsApi.java @@ -77,7 +77,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for authEventCreate * @param userID ID of user (required) - * @param authEventCreateReq (optional) + * @param authEventCreateReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -141,6 +141,11 @@ private okhttp3.Call authEventCreateValidateBeforeCall(String userID, AuthEventC throw new ApiException("Missing the required parameter 'userID' when calling authEventCreate(Async)"); } + // verify the required parameter 'authEventCreateReq' is set + if (authEventCreateReq == null) { + throw new ApiException("Missing the required parameter 'authEventCreateReq' when calling authEventCreate(Async)"); + } + return authEventCreateCall(userID, authEventCreateReq, _callback); } @@ -149,7 +154,7 @@ private okhttp3.Call authEventCreateValidateBeforeCall(String userID, AuthEventC * * Create a new authentication event for a user * @param userID ID of user (required) - * @param authEventCreateReq (optional) + * @param authEventCreateReq (required) * @return AuthEvent * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -168,7 +173,7 @@ public AuthEvent authEventCreate(String userID, AuthEventCreateReq authEventCrea * * Create a new authentication event for a user * @param userID ID of user (required) - * @param authEventCreateReq (optional) + * @param authEventCreateReq (required) * @return ApiResponse<AuthEvent> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -188,7 +193,7 @@ public ApiResponse authEventCreateWithHttpInfo(String userID, AuthEve * (asynchronously) * Create a new authentication event for a user * @param userID ID of user (required) - * @param authEventCreateReq (optional) + * @param authEventCreateReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object diff --git a/src/main/java/com/corbado/generated/api/ChallengesApi.java b/src/main/java/com/corbado/generated/api/ChallengesApi.java index e152727..0ce2724 100644 --- a/src/main/java/com/corbado/generated/api/ChallengesApi.java +++ b/src/main/java/com/corbado/generated/api/ChallengesApi.java @@ -78,7 +78,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for challengeCreate * @param userID ID of user (required) - * @param challengeCreateReq (optional) + * @param challengeCreateReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -142,6 +142,11 @@ private okhttp3.Call challengeCreateValidateBeforeCall(String userID, ChallengeC throw new ApiException("Missing the required parameter 'userID' when calling challengeCreate(Async)"); } + // verify the required parameter 'challengeCreateReq' is set + if (challengeCreateReq == null) { + throw new ApiException("Missing the required parameter 'challengeCreateReq' when calling challengeCreate(Async)"); + } + return challengeCreateCall(userID, challengeCreateReq, _callback); } @@ -150,7 +155,7 @@ private okhttp3.Call challengeCreateValidateBeforeCall(String userID, ChallengeC * * Create a new challenge to verify a login identifier * @param userID ID of user (required) - * @param challengeCreateReq (optional) + * @param challengeCreateReq (required) * @return Challenge * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -169,7 +174,7 @@ public Challenge challengeCreate(String userID, ChallengeCreateReq challengeCrea * * Create a new challenge to verify a login identifier * @param userID ID of user (required) - * @param challengeCreateReq (optional) + * @param challengeCreateReq (required) * @return ApiResponse<Challenge> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -189,7 +194,7 @@ public ApiResponse challengeCreateWithHttpInfo(String userID, Challen * (asynchronously) * Create a new challenge to verify a login identifier * @param userID ID of user (required) - * @param challengeCreateReq (optional) + * @param challengeCreateReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -211,7 +216,7 @@ public okhttp3.Call challengeCreateAsync(String userID, ChallengeCreateReq chall * Build call for challengeUpdate * @param userID ID of user (required) * @param challengeID ID of challenge (required) - * @param challengeUpdateReq (optional) + * @param challengeUpdateReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -281,6 +286,11 @@ private okhttp3.Call challengeUpdateValidateBeforeCall(String userID, String cha throw new ApiException("Missing the required parameter 'challengeID' when calling challengeUpdate(Async)"); } + // verify the required parameter 'challengeUpdateReq' is set + if (challengeUpdateReq == null) { + throw new ApiException("Missing the required parameter 'challengeUpdateReq' when calling challengeUpdate(Async)"); + } + return challengeUpdateCall(userID, challengeID, challengeUpdateReq, _callback); } @@ -290,7 +300,7 @@ private okhttp3.Call challengeUpdateValidateBeforeCall(String userID, String cha * Updates a challenge (e.g. from pending to completed) * @param userID ID of user (required) * @param challengeID ID of challenge (required) - * @param challengeUpdateReq (optional) + * @param challengeUpdateReq (required) * @return Challenge * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -310,7 +320,7 @@ public Challenge challengeUpdate(String userID, String challengeID, ChallengeUpd * Updates a challenge (e.g. from pending to completed) * @param userID ID of user (required) * @param challengeID ID of challenge (required) - * @param challengeUpdateReq (optional) + * @param challengeUpdateReq (required) * @return ApiResponse<Challenge> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -331,7 +341,7 @@ public ApiResponse challengeUpdateWithHttpInfo(String userID, String * Updates a challenge (e.g. from pending to completed) * @param userID ID of user (required) * @param challengeID ID of challenge (required) - * @param challengeUpdateReq (optional) + * @param challengeUpdateReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object diff --git a/src/main/java/com/corbado/generated/api/ConnectTokensApi.java b/src/main/java/com/corbado/generated/api/ConnectTokensApi.java index f4a33df..167f137 100644 --- a/src/main/java/com/corbado/generated/api/ConnectTokensApi.java +++ b/src/main/java/com/corbado/generated/api/ConnectTokensApi.java @@ -79,7 +79,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for connectTokenCreate - * @param connectTokenCreateReq (optional) + * @param connectTokenCreateReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -137,6 +137,11 @@ public okhttp3.Call connectTokenCreateCall(ConnectTokenCreateReq connectTokenCre @SuppressWarnings("rawtypes") private okhttp3.Call connectTokenCreateValidateBeforeCall(ConnectTokenCreateReq connectTokenCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'connectTokenCreateReq' is set + if (connectTokenCreateReq == null) { + throw new ApiException("Missing the required parameter 'connectTokenCreateReq' when calling connectTokenCreate(Async)"); + } + return connectTokenCreateCall(connectTokenCreateReq, _callback); } @@ -144,7 +149,7 @@ private okhttp3.Call connectTokenCreateValidateBeforeCall(ConnectTokenCreateReq /** * * Create a new connect token - * @param connectTokenCreateReq (optional) + * @param connectTokenCreateReq (required) * @return ConnectToken * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -162,7 +167,7 @@ public ConnectToken connectTokenCreate(ConnectTokenCreateReq connectTokenCreateR /** * * Create a new connect token - * @param connectTokenCreateReq (optional) + * @param connectTokenCreateReq (required) * @return ApiResponse<ConnectToken> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -181,7 +186,7 @@ public ApiResponse connectTokenCreateWithHttpInfo(ConnectTokenCrea /** * (asynchronously) * Create a new connect token - * @param connectTokenCreateReq (optional) + * @param connectTokenCreateReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -478,7 +483,7 @@ public okhttp3.Call connectTokenListAsync(String sort, List filter, Inte /** * Build call for connectTokenUpdate * @param connectTokenID ID of an append token (required) - * @param connectTokenUpdateReq (optional) + * @param connectTokenUpdateReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -542,6 +547,11 @@ private okhttp3.Call connectTokenUpdateValidateBeforeCall(String connectTokenID, throw new ApiException("Missing the required parameter 'connectTokenID' when calling connectTokenUpdate(Async)"); } + // verify the required parameter 'connectTokenUpdateReq' is set + if (connectTokenUpdateReq == null) { + throw new ApiException("Missing the required parameter 'connectTokenUpdateReq' when calling connectTokenUpdate(Async)"); + } + return connectTokenUpdateCall(connectTokenID, connectTokenUpdateReq, _callback); } @@ -550,7 +560,7 @@ private okhttp3.Call connectTokenUpdateValidateBeforeCall(String connectTokenID, * * Updates an existing append token * @param connectTokenID ID of an append token (required) - * @param connectTokenUpdateReq (optional) + * @param connectTokenUpdateReq (required) * @return GenericRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -569,7 +579,7 @@ public GenericRsp connectTokenUpdate(String connectTokenID, ConnectTokenUpdateRe * * Updates an existing append token * @param connectTokenID ID of an append token (required) - * @param connectTokenUpdateReq (optional) + * @param connectTokenUpdateReq (required) * @return ApiResponse<GenericRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -589,7 +599,7 @@ public ApiResponse connectTokenUpdateWithHttpInfo(String connectToke * (asynchronously) * Updates an existing append token * @param connectTokenID ID of an append token (required) - * @param connectTokenUpdateReq (optional) + * @param connectTokenUpdateReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object diff --git a/src/main/java/com/corbado/generated/api/IdentifiersApi.java b/src/main/java/com/corbado/generated/api/IdentifiersApi.java index 9922a08..4383647 100644 --- a/src/main/java/com/corbado/generated/api/IdentifiersApi.java +++ b/src/main/java/com/corbado/generated/api/IdentifiersApi.java @@ -80,7 +80,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for identifierCreate * @param userID ID of user (required) - * @param identifierCreateReq (optional) + * @param identifierCreateReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -144,6 +144,11 @@ private okhttp3.Call identifierCreateValidateBeforeCall(String userID, Identifie throw new ApiException("Missing the required parameter 'userID' when calling identifierCreate(Async)"); } + // verify the required parameter 'identifierCreateReq' is set + if (identifierCreateReq == null) { + throw new ApiException("Missing the required parameter 'identifierCreateReq' when calling identifierCreate(Async)"); + } + return identifierCreateCall(userID, identifierCreateReq, _callback); } @@ -152,7 +157,7 @@ private okhttp3.Call identifierCreateValidateBeforeCall(String userID, Identifie * * Create a new login identifier * @param userID ID of user (required) - * @param identifierCreateReq (optional) + * @param identifierCreateReq (required) * @return Identifier * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -171,7 +176,7 @@ public Identifier identifierCreate(String userID, IdentifierCreateReq identifier * * Create a new login identifier * @param userID ID of user (required) - * @param identifierCreateReq (optional) + * @param identifierCreateReq (required) * @return ApiResponse<Identifier> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -191,7 +196,7 @@ public ApiResponse identifierCreateWithHttpInfo(String userID, Ident * (asynchronously) * Create a new login identifier * @param userID ID of user (required) - * @param identifierCreateReq (optional) + * @param identifierCreateReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -499,7 +504,7 @@ public okhttp3.Call identifierListAsync(String sort, List filter, Intege * Build call for identifierUpdate * @param userID ID of user (required) * @param identifierID ID of login identifier (required) - * @param identifierUpdateReq (optional) + * @param identifierUpdateReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -569,6 +574,11 @@ private okhttp3.Call identifierUpdateValidateBeforeCall(String userID, String id throw new ApiException("Missing the required parameter 'identifierID' when calling identifierUpdate(Async)"); } + // verify the required parameter 'identifierUpdateReq' is set + if (identifierUpdateReq == null) { + throw new ApiException("Missing the required parameter 'identifierUpdateReq' when calling identifierUpdate(Async)"); + } + return identifierUpdateCall(userID, identifierID, identifierUpdateReq, _callback); } @@ -578,7 +588,7 @@ private okhttp3.Call identifierUpdateValidateBeforeCall(String userID, String id * Updates a login identifier (e.g. from pending to verified) * @param userID ID of user (required) * @param identifierID ID of login identifier (required) - * @param identifierUpdateReq (optional) + * @param identifierUpdateReq (required) * @return Identifier * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -598,7 +608,7 @@ public Identifier identifierUpdate(String userID, String identifierID, Identifie * Updates a login identifier (e.g. from pending to verified) * @param userID ID of user (required) * @param identifierID ID of login identifier (required) - * @param identifierUpdateReq (optional) + * @param identifierUpdateReq (required) * @return ApiResponse<Identifier> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -619,7 +629,7 @@ public ApiResponse identifierUpdateWithHttpInfo(String userID, Strin * Updates a login identifier (e.g. from pending to verified) * @param userID ID of user (required) * @param identifierID ID of login identifier (required) - * @param identifierUpdateReq (optional) + * @param identifierUpdateReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object diff --git a/src/main/java/com/corbado/generated/api/PasskeyChallengesApi.java b/src/main/java/com/corbado/generated/api/PasskeyChallengesApi.java new file mode 100644 index 0000000..436139a --- /dev/null +++ b/src/main/java/com/corbado/generated/api/PasskeyChallengesApi.java @@ -0,0 +1,384 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.api; + +import com.corbado.generated.invoker.ApiCallback; +import com.corbado.generated.invoker.ApiClient; +import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.invoker.ApiResponse; +import com.corbado.generated.invoker.Configuration; +import com.corbado.generated.invoker.Pair; +import com.corbado.generated.invoker.ProgressRequestBody; +import com.corbado.generated.invoker.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.PasskeyChallenge; +import com.corbado.generated.model.PasskeyChallengeList; +import com.corbado.generated.model.PasskeyChallengeUpdateReq; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PasskeyChallengesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PasskeyChallengesApi() { + this(Configuration.getDefaultApiClient()); + } + + public PasskeyChallengesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for passkeyChallengeList + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching passkey challenges -
0 Error -
+ */ + public okhttp3.Call passkeyChallengeListCall(String userID, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/users/{userID}/passkeyChallenges" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (filter != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "filter[]", filter)); + } + + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passkeyChallengeListValidateBeforeCall(String userID, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling passkeyChallengeList(Async)"); + } + + return passkeyChallengeListCall(userID, sort, filter, page, pageSize, _callback); + + } + + /** + * + * Returns a list of matching passkey challenges + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return PasskeyChallengeList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching passkey challenges -
0 Error -
+ */ + public PasskeyChallengeList passkeyChallengeList(String userID, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + ApiResponse localVarResp = passkeyChallengeListWithHttpInfo(userID, sort, filter, page, pageSize); + return localVarResp.getData(); + } + + /** + * + * Returns a list of matching passkey challenges + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @return ApiResponse<PasskeyChallengeList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching passkey challenges -
0 Error -
+ */ + public ApiResponse passkeyChallengeListWithHttpInfo(String userID, String sort, List filter, Integer page, Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = passkeyChallengeListValidateBeforeCall(userID, sort, filter, page, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Returns a list of matching passkey challenges + * @param userID ID of user (required) + * @param sort Field sorting (optional) + * @param filter Field filtering (optional) + * @param page Page number (optional, default to 1) + * @param pageSize Number of items per page (optional, default to 10) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 List of all matching passkey challenges -
0 Error -
+ */ + public okhttp3.Call passkeyChallengeListAsync(String userID, String sort, List filter, Integer page, Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = passkeyChallengeListValidateBeforeCall(userID, sort, filter, page, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passkeyChallengeUpdate + * @param userID ID of user (required) + * @param passkeyChallengeID ID of a passkey challenge (required) + * @param passkeyChallengeUpdateReq (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey challenge has been updated -
0 Error -
+ */ + public okhttp3.Call passkeyChallengeUpdateCall(String userID, String passkeyChallengeID, PasskeyChallengeUpdateReq passkeyChallengeUpdateReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = passkeyChallengeUpdateReq; + + // create path and map variables + String localVarPath = "/users/{userID}/passkeyChallenges/{passkeyChallengeID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "passkeyChallengeID" + "}", localVarApiClient.escapeString(passkeyChallengeID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passkeyChallengeUpdateValidateBeforeCall(String userID, String passkeyChallengeID, PasskeyChallengeUpdateReq passkeyChallengeUpdateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling passkeyChallengeUpdate(Async)"); + } + + // verify the required parameter 'passkeyChallengeID' is set + if (passkeyChallengeID == null) { + throw new ApiException("Missing the required parameter 'passkeyChallengeID' when calling passkeyChallengeUpdate(Async)"); + } + + // verify the required parameter 'passkeyChallengeUpdateReq' is set + if (passkeyChallengeUpdateReq == null) { + throw new ApiException("Missing the required parameter 'passkeyChallengeUpdateReq' when calling passkeyChallengeUpdate(Async)"); + } + + return passkeyChallengeUpdateCall(userID, passkeyChallengeID, passkeyChallengeUpdateReq, _callback); + + } + + /** + * + * Updates a passkey challenge + * @param userID ID of user (required) + * @param passkeyChallengeID ID of a passkey challenge (required) + * @param passkeyChallengeUpdateReq (required) + * @return PasskeyChallenge + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey challenge has been updated -
0 Error -
+ */ + public PasskeyChallenge passkeyChallengeUpdate(String userID, String passkeyChallengeID, PasskeyChallengeUpdateReq passkeyChallengeUpdateReq) throws ApiException { + ApiResponse localVarResp = passkeyChallengeUpdateWithHttpInfo(userID, passkeyChallengeID, passkeyChallengeUpdateReq); + return localVarResp.getData(); + } + + /** + * + * Updates a passkey challenge + * @param userID ID of user (required) + * @param passkeyChallengeID ID of a passkey challenge (required) + * @param passkeyChallengeUpdateReq (required) + * @return ApiResponse<PasskeyChallenge> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey challenge has been updated -
0 Error -
+ */ + public ApiResponse passkeyChallengeUpdateWithHttpInfo(String userID, String passkeyChallengeID, PasskeyChallengeUpdateReq passkeyChallengeUpdateReq) throws ApiException { + okhttp3.Call localVarCall = passkeyChallengeUpdateValidateBeforeCall(userID, passkeyChallengeID, passkeyChallengeUpdateReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Updates a passkey challenge + * @param userID ID of user (required) + * @param passkeyChallengeID ID of a passkey challenge (required) + * @param passkeyChallengeUpdateReq (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Passkey challenge has been updated -
0 Error -
+ */ + public okhttp3.Call passkeyChallengeUpdateAsync(String userID, String passkeyChallengeID, PasskeyChallengeUpdateReq passkeyChallengeUpdateReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = passkeyChallengeUpdateValidateBeforeCall(userID, passkeyChallengeID, passkeyChallengeUpdateReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/corbado/generated/api/PasskeyEventsApi.java b/src/main/java/com/corbado/generated/api/PasskeyEventsApi.java index 2d4b519..01d209f 100644 --- a/src/main/java/com/corbado/generated/api/PasskeyEventsApi.java +++ b/src/main/java/com/corbado/generated/api/PasskeyEventsApi.java @@ -28,6 +28,7 @@ import com.corbado.generated.model.ErrorRsp; +import com.corbado.generated.model.GenericRsp; import com.corbado.generated.model.PasskeyEvent; import com.corbado.generated.model.PasskeyEventCreateReq; import com.corbado.generated.model.PasskeyEventList; @@ -78,7 +79,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for passkeyEventCreate * @param userID ID of user (required) - * @param passkeyEventCreateReq (optional) + * @param passkeyEventCreateReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -142,6 +143,11 @@ private okhttp3.Call passkeyEventCreateValidateBeforeCall(String userID, Passkey throw new ApiException("Missing the required parameter 'userID' when calling passkeyEventCreate(Async)"); } + // verify the required parameter 'passkeyEventCreateReq' is set + if (passkeyEventCreateReq == null) { + throw new ApiException("Missing the required parameter 'passkeyEventCreateReq' when calling passkeyEventCreate(Async)"); + } + return passkeyEventCreateCall(userID, passkeyEventCreateReq, _callback); } @@ -150,7 +156,7 @@ private okhttp3.Call passkeyEventCreateValidateBeforeCall(String userID, Passkey * * Create a new passkey event for a user * @param userID ID of user (required) - * @param passkeyEventCreateReq (optional) + * @param passkeyEventCreateReq (required) * @return PasskeyEvent * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -169,7 +175,7 @@ public PasskeyEvent passkeyEventCreate(String userID, PasskeyEventCreateReq pass * * Create a new passkey event for a user * @param userID ID of user (required) - * @param passkeyEventCreateReq (optional) + * @param passkeyEventCreateReq (required) * @return ApiResponse<PasskeyEvent> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -189,7 +195,7 @@ public ApiResponse passkeyEventCreateWithHttpInfo(String userID, P * (asynchronously) * Create a new passkey event for a user * @param userID ID of user (required) - * @param passkeyEventCreateReq (optional) + * @param passkeyEventCreateReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -207,6 +213,143 @@ public okhttp3.Call passkeyEventCreateAsync(String userID, PasskeyEventCreateReq localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for passkeyEventDelete + * @param userID ID of user (required) + * @param passkeyEventID ID of a passkey event (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call passkeyEventDeleteCall(String userID, String passkeyEventID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/users/{userID}/passkeyEvents/{passkeyEventID}" + .replace("{" + "userID" + "}", localVarApiClient.escapeString(userID.toString())) + .replace("{" + "passkeyEventID" + "}", localVarApiClient.escapeString(passkeyEventID.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "basicAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passkeyEventDeleteValidateBeforeCall(String userID, String passkeyEventID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userID' is set + if (userID == null) { + throw new ApiException("Missing the required parameter 'userID' when calling passkeyEventDelete(Async)"); + } + + // verify the required parameter 'passkeyEventID' is set + if (passkeyEventID == null) { + throw new ApiException("Missing the required parameter 'passkeyEventID' when calling passkeyEventDelete(Async)"); + } + + return passkeyEventDeleteCall(userID, passkeyEventID, _callback); + + } + + /** + * + * Deletes an existing passkey event + * @param userID ID of user (required) + * @param passkeyEventID ID of a passkey event (required) + * @return GenericRsp + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public GenericRsp passkeyEventDelete(String userID, String passkeyEventID) throws ApiException { + ApiResponse localVarResp = passkeyEventDeleteWithHttpInfo(userID, passkeyEventID); + return localVarResp.getData(); + } + + /** + * + * Deletes an existing passkey event + * @param userID ID of user (required) + * @param passkeyEventID ID of a passkey event (required) + * @return ApiResponse<GenericRsp> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public ApiResponse passkeyEventDeleteWithHttpInfo(String userID, String passkeyEventID) throws ApiException { + okhttp3.Call localVarCall = passkeyEventDeleteValidateBeforeCall(userID, passkeyEventID, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Deletes an existing passkey event + * @param userID ID of user (required) + * @param passkeyEventID ID of a passkey event (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Operation succeeded -
0 Error -
+ */ + public okhttp3.Call passkeyEventDeleteAsync(String userID, String passkeyEventID, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = passkeyEventDeleteValidateBeforeCall(userID, passkeyEventID, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for passkeyEventList * @param userID ID of user (required) diff --git a/src/main/java/com/corbado/generated/api/PasskeysApi.java b/src/main/java/com/corbado/generated/api/PasskeysApi.java index e83aaf5..c251b6c 100644 --- a/src/main/java/com/corbado/generated/api/PasskeysApi.java +++ b/src/main/java/com/corbado/generated/api/PasskeysApi.java @@ -86,7 +86,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for passkeyAppendFinish - * @param passkeyAppendFinishReq (optional) + * @param passkeyAppendFinishReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -144,6 +144,11 @@ public okhttp3.Call passkeyAppendFinishCall(PasskeyAppendFinishReq passkeyAppend @SuppressWarnings("rawtypes") private okhttp3.Call passkeyAppendFinishValidateBeforeCall(PasskeyAppendFinishReq passkeyAppendFinishReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passkeyAppendFinishReq' is set + if (passkeyAppendFinishReq == null) { + throw new ApiException("Missing the required parameter 'passkeyAppendFinishReq' when calling passkeyAppendFinish(Async)"); + } + return passkeyAppendFinishCall(passkeyAppendFinishReq, _callback); } @@ -151,7 +156,7 @@ private okhttp3.Call passkeyAppendFinishValidateBeforeCall(PasskeyAppendFinishRe /** * * Completes a challenge for creating a new passkey - * @param passkeyAppendFinishReq (optional) + * @param passkeyAppendFinishReq (required) * @return PasskeyAppendFinishRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -169,7 +174,7 @@ public PasskeyAppendFinishRsp passkeyAppendFinish(PasskeyAppendFinishReq passkey /** * * Completes a challenge for creating a new passkey - * @param passkeyAppendFinishReq (optional) + * @param passkeyAppendFinishReq (required) * @return ApiResponse<PasskeyAppendFinishRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -188,7 +193,7 @@ public ApiResponse passkeyAppendFinishWithHttpInfo(Passk /** * (asynchronously) * Completes a challenge for creating a new passkey - * @param passkeyAppendFinishReq (optional) + * @param passkeyAppendFinishReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -208,7 +213,7 @@ public okhttp3.Call passkeyAppendFinishAsync(PasskeyAppendFinishReq passkeyAppen } /** * Build call for passkeyAppendStart - * @param passkeyAppendStartReq (optional) + * @param passkeyAppendStartReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -266,6 +271,11 @@ public okhttp3.Call passkeyAppendStartCall(PasskeyAppendStartReq passkeyAppendSt @SuppressWarnings("rawtypes") private okhttp3.Call passkeyAppendStartValidateBeforeCall(PasskeyAppendStartReq passkeyAppendStartReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passkeyAppendStartReq' is set + if (passkeyAppendStartReq == null) { + throw new ApiException("Missing the required parameter 'passkeyAppendStartReq' when calling passkeyAppendStart(Async)"); + } + return passkeyAppendStartCall(passkeyAppendStartReq, _callback); } @@ -273,7 +283,7 @@ private okhttp3.Call passkeyAppendStartValidateBeforeCall(PasskeyAppendStartReq /** * * Starts a challenge for creating a new passkey - * @param passkeyAppendStartReq (optional) + * @param passkeyAppendStartReq (required) * @return PasskeyAppendStartRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -291,7 +301,7 @@ public PasskeyAppendStartRsp passkeyAppendStart(PasskeyAppendStartReq passkeyApp /** * * Starts a challenge for creating a new passkey - * @param passkeyAppendStartReq (optional) + * @param passkeyAppendStartReq (required) * @return ApiResponse<PasskeyAppendStartRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -310,7 +320,7 @@ public ApiResponse passkeyAppendStartWithHttpInfo(Passkey /** * (asynchronously) * Starts a challenge for creating a new passkey - * @param passkeyAppendStartReq (optional) + * @param passkeyAppendStartReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -330,7 +340,7 @@ public okhttp3.Call passkeyAppendStartAsync(PasskeyAppendStartReq passkeyAppendS } /** * Build call for passkeyLoginFinish - * @param passkeyLoginFinishReq (optional) + * @param passkeyLoginFinishReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -388,6 +398,11 @@ public okhttp3.Call passkeyLoginFinishCall(PasskeyLoginFinishReq passkeyLoginFin @SuppressWarnings("rawtypes") private okhttp3.Call passkeyLoginFinishValidateBeforeCall(PasskeyLoginFinishReq passkeyLoginFinishReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passkeyLoginFinishReq' is set + if (passkeyLoginFinishReq == null) { + throw new ApiException("Missing the required parameter 'passkeyLoginFinishReq' when calling passkeyLoginFinish(Async)"); + } + return passkeyLoginFinishCall(passkeyLoginFinishReq, _callback); } @@ -395,7 +410,7 @@ private okhttp3.Call passkeyLoginFinishValidateBeforeCall(PasskeyLoginFinishReq /** * * Completes a challenge for an existing passkey - * @param passkeyLoginFinishReq (optional) + * @param passkeyLoginFinishReq (required) * @return PasskeyLoginFinishRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -413,7 +428,7 @@ public PasskeyLoginFinishRsp passkeyLoginFinish(PasskeyLoginFinishReq passkeyLog /** * * Completes a challenge for an existing passkey - * @param passkeyLoginFinishReq (optional) + * @param passkeyLoginFinishReq (required) * @return ApiResponse<PasskeyLoginFinishRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -432,7 +447,7 @@ public ApiResponse passkeyLoginFinishWithHttpInfo(Passkey /** * (asynchronously) * Completes a challenge for an existing passkey - * @param passkeyLoginFinishReq (optional) + * @param passkeyLoginFinishReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -452,7 +467,7 @@ public okhttp3.Call passkeyLoginFinishAsync(PasskeyLoginFinishReq passkeyLoginFi } /** * Build call for passkeyLoginStart - * @param passkeyLoginStartReq (optional) + * @param passkeyLoginStartReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -510,6 +525,11 @@ public okhttp3.Call passkeyLoginStartCall(PasskeyLoginStartReq passkeyLoginStart @SuppressWarnings("rawtypes") private okhttp3.Call passkeyLoginStartValidateBeforeCall(PasskeyLoginStartReq passkeyLoginStartReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passkeyLoginStartReq' is set + if (passkeyLoginStartReq == null) { + throw new ApiException("Missing the required parameter 'passkeyLoginStartReq' when calling passkeyLoginStart(Async)"); + } + return passkeyLoginStartCall(passkeyLoginStartReq, _callback); } @@ -517,7 +537,7 @@ private okhttp3.Call passkeyLoginStartValidateBeforeCall(PasskeyLoginStartReq pa /** * * Starts a challenge for an existing passkey - * @param passkeyLoginStartReq (optional) + * @param passkeyLoginStartReq (required) * @return PasskeyLoginStartRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -535,7 +555,7 @@ public PasskeyLoginStartRsp passkeyLoginStart(PasskeyLoginStartReq passkeyLoginS /** * * Starts a challenge for an existing passkey - * @param passkeyLoginStartReq (optional) + * @param passkeyLoginStartReq (required) * @return ApiResponse<PasskeyLoginStartRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -554,7 +574,7 @@ public ApiResponse passkeyLoginStartWithHttpInfo(PasskeyLo /** * (asynchronously) * Starts a challenge for an existing passkey - * @param passkeyLoginStartReq (optional) + * @param passkeyLoginStartReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -574,7 +594,7 @@ public okhttp3.Call passkeyLoginStartAsync(PasskeyLoginStartReq passkeyLoginStar } /** * Build call for passkeyMediationFinish - * @param passkeyMediationFinishReq (optional) + * @param passkeyMediationFinishReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -632,6 +652,11 @@ public okhttp3.Call passkeyMediationFinishCall(PasskeyMediationFinishReq passkey @SuppressWarnings("rawtypes") private okhttp3.Call passkeyMediationFinishValidateBeforeCall(PasskeyMediationFinishReq passkeyMediationFinishReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passkeyMediationFinishReq' is set + if (passkeyMediationFinishReq == null) { + throw new ApiException("Missing the required parameter 'passkeyMediationFinishReq' when calling passkeyMediationFinish(Async)"); + } + return passkeyMediationFinishCall(passkeyMediationFinishReq, _callback); } @@ -639,7 +664,7 @@ private okhttp3.Call passkeyMediationFinishValidateBeforeCall(PasskeyMediationFi /** * * Completes a challenge for an existing passkey (Conditional UI) - * @param passkeyMediationFinishReq (optional) + * @param passkeyMediationFinishReq (required) * @return PasskeyMediationFinishRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -657,7 +682,7 @@ public PasskeyMediationFinishRsp passkeyMediationFinish(PasskeyMediationFinishRe /** * * Completes a challenge for an existing passkey (Conditional UI) - * @param passkeyMediationFinishReq (optional) + * @param passkeyMediationFinishReq (required) * @return ApiResponse<PasskeyMediationFinishRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -676,7 +701,7 @@ public ApiResponse passkeyMediationFinishWithHttpInfo /** * (asynchronously) * Completes a challenge for an existing passkey (Conditional UI) - * @param passkeyMediationFinishReq (optional) + * @param passkeyMediationFinishReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -696,7 +721,7 @@ public okhttp3.Call passkeyMediationFinishAsync(PasskeyMediationFinishReq passke } /** * Build call for passkeyMediationStart - * @param passkeyMediationStartReq (optional) + * @param passkeyMediationStartReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -754,6 +779,11 @@ public okhttp3.Call passkeyMediationStartCall(PasskeyMediationStartReq passkeyMe @SuppressWarnings("rawtypes") private okhttp3.Call passkeyMediationStartValidateBeforeCall(PasskeyMediationStartReq passkeyMediationStartReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passkeyMediationStartReq' is set + if (passkeyMediationStartReq == null) { + throw new ApiException("Missing the required parameter 'passkeyMediationStartReq' when calling passkeyMediationStart(Async)"); + } + return passkeyMediationStartCall(passkeyMediationStartReq, _callback); } @@ -761,7 +791,7 @@ private okhttp3.Call passkeyMediationStartValidateBeforeCall(PasskeyMediationSta /** * * Starts a challenge for an existing passkey (Conditional UI) - * @param passkeyMediationStartReq (optional) + * @param passkeyMediationStartReq (required) * @return PasskeyMediationStartRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -779,7 +809,7 @@ public PasskeyMediationStartRsp passkeyMediationStart(PasskeyMediationStartReq p /** * * Starts a challenge for an existing passkey (Conditional UI) - * @param passkeyMediationStartReq (optional) + * @param passkeyMediationStartReq (required) * @return ApiResponse<PasskeyMediationStartRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -798,7 +828,7 @@ public ApiResponse passkeyMediationStartWithHttpInfo(P /** * (asynchronously) * Starts a challenge for an existing passkey (Conditional UI) - * @param passkeyMediationStartReq (optional) + * @param passkeyMediationStartReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object diff --git a/src/main/java/com/corbado/generated/api/SessionsApi.java b/src/main/java/com/corbado/generated/api/SessionsApi.java index c0211df..c27e5f5 100644 --- a/src/main/java/com/corbado/generated/api/SessionsApi.java +++ b/src/main/java/com/corbado/generated/api/SessionsApi.java @@ -80,7 +80,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for longSessionCreate * @param userID ID of user (required) - * @param longSessionCreateReq (optional) + * @param longSessionCreateReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -144,6 +144,11 @@ private okhttp3.Call longSessionCreateValidateBeforeCall(String userID, LongSess throw new ApiException("Missing the required parameter 'userID' when calling longSessionCreate(Async)"); } + // verify the required parameter 'longSessionCreateReq' is set + if (longSessionCreateReq == null) { + throw new ApiException("Missing the required parameter 'longSessionCreateReq' when calling longSessionCreate(Async)"); + } + return longSessionCreateCall(userID, longSessionCreateReq, _callback); } @@ -152,7 +157,7 @@ private okhttp3.Call longSessionCreateValidateBeforeCall(String userID, LongSess * * Create a new long session * @param userID ID of user (required) - * @param longSessionCreateReq (optional) + * @param longSessionCreateReq (required) * @return LongSession * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -171,7 +176,7 @@ public LongSession longSessionCreate(String userID, LongSessionCreateReq longSes * * Create a new long session * @param userID ID of user (required) - * @param longSessionCreateReq (optional) + * @param longSessionCreateReq (required) * @return ApiResponse<LongSession> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -191,7 +196,7 @@ public ApiResponse longSessionCreateWithHttpInfo(String userID, Lon * (asynchronously) * Create a new long session * @param userID ID of user (required) - * @param longSessionCreateReq (optional) + * @param longSessionCreateReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -340,7 +345,7 @@ public okhttp3.Call longSessionGetAsync(String longSessionID, final ApiCallback< * Build call for longSessionUpdate * @param userID ID of user (required) * @param longSessionID ID of long session (required) - * @param longSessionUpdateReq (optional) + * @param longSessionUpdateReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -410,6 +415,11 @@ private okhttp3.Call longSessionUpdateValidateBeforeCall(String userID, String l throw new ApiException("Missing the required parameter 'longSessionID' when calling longSessionUpdate(Async)"); } + // verify the required parameter 'longSessionUpdateReq' is set + if (longSessionUpdateReq == null) { + throw new ApiException("Missing the required parameter 'longSessionUpdateReq' when calling longSessionUpdate(Async)"); + } + return longSessionUpdateCall(userID, longSessionID, longSessionUpdateReq, _callback); } @@ -419,7 +429,7 @@ private okhttp3.Call longSessionUpdateValidateBeforeCall(String userID, String l * Updates long session status * @param userID ID of user (required) * @param longSessionID ID of long session (required) - * @param longSessionUpdateReq (optional) + * @param longSessionUpdateReq (required) * @return LongSession * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -439,7 +449,7 @@ public LongSession longSessionUpdate(String userID, String longSessionID, LongSe * Updates long session status * @param userID ID of user (required) * @param longSessionID ID of long session (required) - * @param longSessionUpdateReq (optional) + * @param longSessionUpdateReq (required) * @return ApiResponse<LongSession> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -460,7 +470,7 @@ public ApiResponse longSessionUpdateWithHttpInfo(String userID, Str * Updates long session status * @param userID ID of user (required) * @param longSessionID ID of long session (required) - * @param longSessionUpdateReq (optional) + * @param longSessionUpdateReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -482,7 +492,7 @@ public okhttp3.Call longSessionUpdateAsync(String userID, String longSessionID, * Build call for shortSessionCreate * @param userID ID of user (required) * @param longSessionID ID of long session (required) - * @param shortSessionCreateReq (optional) + * @param shortSessionCreateReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -552,6 +562,11 @@ private okhttp3.Call shortSessionCreateValidateBeforeCall(String userID, String throw new ApiException("Missing the required parameter 'longSessionID' when calling shortSessionCreate(Async)"); } + // verify the required parameter 'shortSessionCreateReq' is set + if (shortSessionCreateReq == null) { + throw new ApiException("Missing the required parameter 'shortSessionCreateReq' when calling shortSessionCreate(Async)"); + } + return shortSessionCreateCall(userID, longSessionID, shortSessionCreateReq, _callback); } @@ -561,7 +576,7 @@ private okhttp3.Call shortSessionCreateValidateBeforeCall(String userID, String * Create a new short session * @param userID ID of user (required) * @param longSessionID ID of long session (required) - * @param shortSessionCreateReq (optional) + * @param shortSessionCreateReq (required) * @return ShortSession * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -581,7 +596,7 @@ public ShortSession shortSessionCreate(String userID, String longSessionID, Shor * Create a new short session * @param userID ID of user (required) * @param longSessionID ID of long session (required) - * @param shortSessionCreateReq (optional) + * @param shortSessionCreateReq (required) * @return ApiResponse<ShortSession> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -602,7 +617,7 @@ public ApiResponse shortSessionCreateWithHttpInfo(String userID, S * Create a new short session * @param userID ID of user (required) * @param longSessionID ID of long session (required) - * @param shortSessionCreateReq (optional) + * @param shortSessionCreateReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object diff --git a/src/main/java/com/corbado/generated/api/UsersApi.java b/src/main/java/com/corbado/generated/api/UsersApi.java index e84eb45..7945125 100644 --- a/src/main/java/com/corbado/generated/api/UsersApi.java +++ b/src/main/java/com/corbado/generated/api/UsersApi.java @@ -379,7 +379,7 @@ public okhttp3.Call credentialListAsync(String userID, String sort, List /** * Build call for socialAccountCreate * @param userID ID of user (required) - * @param socialAccountCreateReq (optional) + * @param socialAccountCreateReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -443,6 +443,11 @@ private okhttp3.Call socialAccountCreateValidateBeforeCall(String userID, Social throw new ApiException("Missing the required parameter 'userID' when calling socialAccountCreate(Async)"); } + // verify the required parameter 'socialAccountCreateReq' is set + if (socialAccountCreateReq == null) { + throw new ApiException("Missing the required parameter 'socialAccountCreateReq' when calling socialAccountCreate(Async)"); + } + return socialAccountCreateCall(userID, socialAccountCreateReq, _callback); } @@ -451,7 +456,7 @@ private okhttp3.Call socialAccountCreateValidateBeforeCall(String userID, Social * * Creates a new social account * @param userID ID of user (required) - * @param socialAccountCreateReq (optional) + * @param socialAccountCreateReq (required) * @return SocialAccount * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -470,7 +475,7 @@ public SocialAccount socialAccountCreate(String userID, SocialAccountCreateReq s * * Creates a new social account * @param userID ID of user (required) - * @param socialAccountCreateReq (optional) + * @param socialAccountCreateReq (required) * @return ApiResponse<SocialAccount> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -490,7 +495,7 @@ public ApiResponse socialAccountCreateWithHttpInfo(String userID, * (asynchronously) * Creates a new social account * @param userID ID of user (required) - * @param socialAccountCreateReq (optional) + * @param socialAccountCreateReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -659,7 +664,7 @@ public okhttp3.Call socialAccountListAsync(String sort, List filter, Int } /** * Build call for userCreate - * @param userCreateReq (optional) + * @param userCreateReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -717,6 +722,11 @@ public okhttp3.Call userCreateCall(UserCreateReq userCreateReq, final ApiCallbac @SuppressWarnings("rawtypes") private okhttp3.Call userCreateValidateBeforeCall(UserCreateReq userCreateReq, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userCreateReq' is set + if (userCreateReq == null) { + throw new ApiException("Missing the required parameter 'userCreateReq' when calling userCreate(Async)"); + } + return userCreateCall(userCreateReq, _callback); } @@ -724,7 +734,7 @@ private okhttp3.Call userCreateValidateBeforeCall(UserCreateReq userCreateReq, f /** * * Creates a new user - * @param userCreateReq (optional) + * @param userCreateReq (required) * @return User * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -742,7 +752,7 @@ public User userCreate(UserCreateReq userCreateReq) throws ApiException { /** * * Creates a new user - * @param userCreateReq (optional) + * @param userCreateReq (required) * @return ApiResponse<User> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -761,7 +771,7 @@ public ApiResponse userCreateWithHttpInfo(UserCreateReq userCreateReq) thr /** * (asynchronously) * Creates a new user - * @param userCreateReq (optional) + * @param userCreateReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -788,7 +798,7 @@ public okhttp3.Call userCreateAsync(UserCreateReq userCreateReq, final ApiCallba * @http.response.details - +
Status Code Description Response Headers
200 User has been deleted -
200 Operation succeeded -
0 Error -
*/ @@ -852,17 +862,17 @@ private okhttp3.Call userDeleteValidateBeforeCall(String userID, final ApiCallba * * Deletes a user * @param userID ID of user (required) - * @return User + * @return GenericRsp * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 User has been deleted -
200 Operation succeeded -
0 Error -
*/ - public User userDelete(String userID) throws ApiException { - ApiResponse localVarResp = userDeleteWithHttpInfo(userID); + public GenericRsp userDelete(String userID) throws ApiException { + ApiResponse localVarResp = userDeleteWithHttpInfo(userID); return localVarResp.getData(); } @@ -870,18 +880,18 @@ public User userDelete(String userID) throws ApiException { * * Deletes a user * @param userID ID of user (required) - * @return ApiResponse<User> + * @return ApiResponse<GenericRsp> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 User has been deleted -
200 Operation succeeded -
0 Error -
*/ - public ApiResponse userDeleteWithHttpInfo(String userID) throws ApiException { + public ApiResponse userDeleteWithHttpInfo(String userID) throws ApiException { okhttp3.Call localVarCall = userDeleteValidateBeforeCall(userID, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -895,14 +905,14 @@ public ApiResponse userDeleteWithHttpInfo(String userID) throws ApiExcepti * @http.response.details - +
Status Code Description Response Headers
200 User has been deleted -
200 Operation succeeded -
0 Error -
*/ - public okhttp3.Call userDeleteAsync(String userID, final ApiCallback _callback) throws ApiException { + public okhttp3.Call userDeleteAsync(String userID, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = userDeleteValidateBeforeCall(userID, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -1195,7 +1205,7 @@ public okhttp3.Call userSocialAccountListAsync(String userID, String sort, List< /** * Build call for userUpdate * @param userID ID of user (required) - * @param userUpdateReq (optional) + * @param userUpdateReq (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1259,6 +1269,11 @@ private okhttp3.Call userUpdateValidateBeforeCall(String userID, UserUpdateReq u throw new ApiException("Missing the required parameter 'userID' when calling userUpdate(Async)"); } + // verify the required parameter 'userUpdateReq' is set + if (userUpdateReq == null) { + throw new ApiException("Missing the required parameter 'userUpdateReq' when calling userUpdate(Async)"); + } + return userUpdateCall(userID, userUpdateReq, _callback); } @@ -1267,7 +1282,7 @@ private okhttp3.Call userUpdateValidateBeforeCall(String userID, UserUpdateReq u * * Updates a user * @param userID ID of user (required) - * @param userUpdateReq (optional) + * @param userUpdateReq (required) * @return User * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1286,7 +1301,7 @@ public User userUpdate(String userID, UserUpdateReq userUpdateReq) throws ApiExc * * Updates a user * @param userID ID of user (required) - * @param userUpdateReq (optional) + * @param userUpdateReq (required) * @return ApiResponse<User> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1306,7 +1321,7 @@ public ApiResponse userUpdateWithHttpInfo(String userID, UserUpdateReq use * (asynchronously) * Updates a user * @param userID ID of user (required) - * @param userUpdateReq (optional) + * @param userUpdateReq (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object diff --git a/src/main/java/com/corbado/generated/invoker/ApiException.java b/src/main/java/com/corbado/generated/invoker/ApiException.java index dcc9e84..5613511 100644 --- a/src/main/java/com/corbado/generated/invoker/ApiException.java +++ b/src/main/java/com/corbado/generated/invoker/ApiException.java @@ -21,7 +21,7 @@ *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ApiException extends Exception { private static final long serialVersionUID = 1L; diff --git a/src/main/java/com/corbado/generated/invoker/Configuration.java b/src/main/java/com/corbado/generated/invoker/Configuration.java index df640f5..c1074ad 100644 --- a/src/main/java/com/corbado/generated/invoker/Configuration.java +++ b/src/main/java/com/corbado/generated/invoker/Configuration.java @@ -13,7 +13,7 @@ package com.corbado.generated.invoker; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class Configuration { public static final String VERSION = "1.0.0"; diff --git a/src/main/java/com/corbado/generated/invoker/JSON.java b/src/main/java/com/corbado/generated/invoker/JSON.java index d8f14a6..de018af 100644 --- a/src/main/java/com/corbado/generated/invoker/JSON.java +++ b/src/main/java/com/corbado/generated/invoker/JSON.java @@ -127,6 +127,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyAppendFinishRsp.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyAppendStartReq.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyAppendStartRsp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyChallenge.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyChallengeList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyChallengeUpdateReq.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyEvent.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.corbado.generated.model.PasskeyEventCreateReq.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/corbado/generated/invoker/Pair.java b/src/main/java/com/corbado/generated/invoker/Pair.java index 3ebfc38..d7cb63c 100644 --- a/src/main/java/com/corbado/generated/invoker/Pair.java +++ b/src/main/java/com/corbado/generated/invoker/Pair.java @@ -13,7 +13,7 @@ package com.corbado.generated.invoker; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java b/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java index ff86546..d5cf3ca 100644 --- a/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java +++ b/src/main/java/com/corbado/generated/invoker/ServerConfiguration.java @@ -5,7 +5,7 @@ /** * Representing a Server configuration. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ServerConfiguration { public String URL; public String description; diff --git a/src/main/java/com/corbado/generated/invoker/ServerVariable.java b/src/main/java/com/corbado/generated/invoker/ServerVariable.java index 86b7fd0..5ac1cce 100644 --- a/src/main/java/com/corbado/generated/invoker/ServerVariable.java +++ b/src/main/java/com/corbado/generated/invoker/ServerVariable.java @@ -5,7 +5,7 @@ /** * Representing a Server Variable for server URL template substitution. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ServerVariable { public String description; public String defaultValue; diff --git a/src/main/java/com/corbado/generated/invoker/StringUtil.java b/src/main/java/com/corbado/generated/invoker/StringUtil.java index ef2213d..c8b2323 100644 --- a/src/main/java/com/corbado/generated/invoker/StringUtil.java +++ b/src/main/java/com/corbado/generated/invoker/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java b/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java index ae546ce..832d638 100644 --- a/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java +++ b/src/main/java/com/corbado/generated/invoker/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java b/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java index 30fe4f1..e7b6f57 100644 --- a/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java +++ b/src/main/java/com/corbado/generated/invoker/auth/HttpBearerAuth.java @@ -22,7 +22,7 @@ import java.util.Optional; import java.util.function.Supplier; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class HttpBearerAuth implements Authentication { private final String scheme; private Supplier tokenSupplier; diff --git a/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java b/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java index 9ba3266..0b36fce 100644 --- a/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java +++ b/src/main/java/com/corbado/generated/model/AbstractOpenApiSchema.java @@ -21,7 +21,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/src/main/java/com/corbado/generated/model/AuthEvent.java b/src/main/java/com/corbado/generated/model/AuthEvent.java index 7ef492a..ff10cd4 100644 --- a/src/main/java/com/corbado/generated/model/AuthEvent.java +++ b/src/main/java/com/corbado/generated/model/AuthEvent.java @@ -52,7 +52,7 @@ /** * AuthEvent */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class AuthEvent { public static final String SERIALIZED_NAME_AUTH_EVENT_I_D = "authEventID"; @SerializedName(SERIALIZED_NAME_AUTH_EVENT_I_D) diff --git a/src/main/java/com/corbado/generated/model/AuthEventCreateReq.java b/src/main/java/com/corbado/generated/model/AuthEventCreateReq.java index 95ad2ce..f3803b2 100644 --- a/src/main/java/com/corbado/generated/model/AuthEventCreateReq.java +++ b/src/main/java/com/corbado/generated/model/AuthEventCreateReq.java @@ -53,7 +53,7 @@ /** * AuthEventCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class AuthEventCreateReq { public static final String SERIALIZED_NAME_USERNAME = "username"; @SerializedName(SERIALIZED_NAME_USERNAME) diff --git a/src/main/java/com/corbado/generated/model/Challenge.java b/src/main/java/com/corbado/generated/model/Challenge.java index 75d1f74..3924320 100644 --- a/src/main/java/com/corbado/generated/model/Challenge.java +++ b/src/main/java/com/corbado/generated/model/Challenge.java @@ -51,7 +51,7 @@ /** * Challenge */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class Challenge { public static final String SERIALIZED_NAME_CHALLENGE_I_D = "challengeID"; @SerializedName(SERIALIZED_NAME_CHALLENGE_I_D) diff --git a/src/main/java/com/corbado/generated/model/ChallengeCreateReq.java b/src/main/java/com/corbado/generated/model/ChallengeCreateReq.java index 46bf4a5..6435c40 100644 --- a/src/main/java/com/corbado/generated/model/ChallengeCreateReq.java +++ b/src/main/java/com/corbado/generated/model/ChallengeCreateReq.java @@ -51,7 +51,7 @@ /** * ChallengeCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ChallengeCreateReq { public static final String SERIALIZED_NAME_CHALLENGE_TYPE = "challengeType"; @SerializedName(SERIALIZED_NAME_CHALLENGE_TYPE) diff --git a/src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java b/src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java index 9b65f6c..af96ea0 100644 --- a/src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/ChallengeUpdateReq.java @@ -49,7 +49,7 @@ /** * ChallengeUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ChallengeUpdateReq { public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) diff --git a/src/main/java/com/corbado/generated/model/ClientInformation.java b/src/main/java/com/corbado/generated/model/ClientInformation.java index 4eb743f..fd04999 100644 --- a/src/main/java/com/corbado/generated/model/ClientInformation.java +++ b/src/main/java/com/corbado/generated/model/ClientInformation.java @@ -50,7 +50,7 @@ /** * ClientInformation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ClientInformation { public static final String SERIALIZED_NAME_REMOTE_ADDRESS = "remoteAddress"; @SerializedName(SERIALIZED_NAME_REMOTE_ADDRESS) diff --git a/src/main/java/com/corbado/generated/model/ConnectToken.java b/src/main/java/com/corbado/generated/model/ConnectToken.java index 206530d..e30a3fa 100644 --- a/src/main/java/com/corbado/generated/model/ConnectToken.java +++ b/src/main/java/com/corbado/generated/model/ConnectToken.java @@ -52,7 +52,7 @@ /** * ConnectToken */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ConnectToken { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java b/src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java index 9e3fce0..de3f3d3 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenCreateReq.java @@ -51,7 +51,7 @@ /** * ConnectTokenCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ConnectTokenCreateReq { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenData.java b/src/main/java/com/corbado/generated/model/ConnectTokenData.java index d1a5594..460d62e 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenData.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenData.java @@ -60,7 +60,7 @@ import com.corbado.generated.invoker.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ConnectTokenData extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(ConnectTokenData.class.getName()); diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java index 3fc9c1d..65ede38 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyAppend.java @@ -49,7 +49,7 @@ /** * ConnectTokenDataPasskeyAppend */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ConnectTokenDataPasskeyAppend { public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java index 445812f..14cc8e8 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyDelete.java @@ -49,7 +49,7 @@ /** * ConnectTokenDataPasskeyDelete */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ConnectTokenDataPasskeyDelete { public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; @SerializedName(SERIALIZED_NAME_IDENTIFIER) diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java index ece4213..9fe3b98 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenDataPasskeyList.java @@ -49,7 +49,7 @@ /** * ConnectTokenDataPasskeyList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ConnectTokenDataPasskeyList { public static final String SERIALIZED_NAME_IDENTIFIER = "identifier"; @SerializedName(SERIALIZED_NAME_IDENTIFIER) diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenList.java b/src/main/java/com/corbado/generated/model/ConnectTokenList.java index 1896bd5..ed033fb 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenList.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenList.java @@ -53,7 +53,7 @@ /** * ConnectTokenList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ConnectTokenList { public static final String SERIALIZED_NAME_CONNECT_TOKENS = "connectTokens"; @SerializedName(SERIALIZED_NAME_CONNECT_TOKENS) diff --git a/src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java b/src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java index 76b17de..45d4daa 100644 --- a/src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/ConnectTokenUpdateReq.java @@ -50,7 +50,7 @@ /** * ConnectTokenUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ConnectTokenUpdateReq { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) diff --git a/src/main/java/com/corbado/generated/model/Credential.java b/src/main/java/com/corbado/generated/model/Credential.java index a08a277..2752d29 100644 --- a/src/main/java/com/corbado/generated/model/Credential.java +++ b/src/main/java/com/corbado/generated/model/Credential.java @@ -51,7 +51,7 @@ /** * Credential */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class Credential { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/com/corbado/generated/model/CredentialList.java b/src/main/java/com/corbado/generated/model/CredentialList.java index 2859f41..214b19c 100644 --- a/src/main/java/com/corbado/generated/model/CredentialList.java +++ b/src/main/java/com/corbado/generated/model/CredentialList.java @@ -53,7 +53,7 @@ /** * CredentialList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class CredentialList { public static final String SERIALIZED_NAME_CREDENTIALS = "credentials"; @SerializedName(SERIALIZED_NAME_CREDENTIALS) diff --git a/src/main/java/com/corbado/generated/model/DetectionTag.java b/src/main/java/com/corbado/generated/model/DetectionTag.java index d9f70e5..e958e18 100644 --- a/src/main/java/com/corbado/generated/model/DetectionTag.java +++ b/src/main/java/com/corbado/generated/model/DetectionTag.java @@ -49,7 +49,7 @@ /** * DetectionTag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class DetectionTag { /** * Gets or Sets category diff --git a/src/main/java/com/corbado/generated/model/ErrorRsp.java b/src/main/java/com/corbado/generated/model/ErrorRsp.java index ec63346..59c25a1 100644 --- a/src/main/java/com/corbado/generated/model/ErrorRsp.java +++ b/src/main/java/com/corbado/generated/model/ErrorRsp.java @@ -51,7 +51,7 @@ /** * ErrorRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ErrorRsp { public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) diff --git a/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java b/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java index 1f49cb3..4cc8f65 100644 --- a/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java +++ b/src/main/java/com/corbado/generated/model/ErrorRspAllOfError.java @@ -52,7 +52,7 @@ /** * ErrorRspAllOfError */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ErrorRspAllOfError { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) diff --git a/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java b/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java index 2845e3a..8a8a509 100644 --- a/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java +++ b/src/main/java/com/corbado/generated/model/ErrorRspAllOfErrorValidation.java @@ -49,7 +49,7 @@ /** * ErrorRspAllOfErrorValidation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ErrorRspAllOfErrorValidation { public static final String SERIALIZED_NAME_FIELD = "field"; @SerializedName(SERIALIZED_NAME_FIELD) diff --git a/src/main/java/com/corbado/generated/model/GenericRsp.java b/src/main/java/com/corbado/generated/model/GenericRsp.java index 53508fc..e748774 100644 --- a/src/main/java/com/corbado/generated/model/GenericRsp.java +++ b/src/main/java/com/corbado/generated/model/GenericRsp.java @@ -50,7 +50,7 @@ /** * GenericRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class GenericRsp { public static final String SERIALIZED_NAME_HTTP_STATUS_CODE = "httpStatusCode"; @SerializedName(SERIALIZED_NAME_HTTP_STATUS_CODE) diff --git a/src/main/java/com/corbado/generated/model/Identifier.java b/src/main/java/com/corbado/generated/model/Identifier.java index 38c1f0c..e83fd2f 100644 --- a/src/main/java/com/corbado/generated/model/Identifier.java +++ b/src/main/java/com/corbado/generated/model/Identifier.java @@ -51,7 +51,7 @@ /** * Identifier */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class Identifier { public static final String SERIALIZED_NAME_IDENTIFIER_I_D = "identifierID"; @SerializedName(SERIALIZED_NAME_IDENTIFIER_I_D) diff --git a/src/main/java/com/corbado/generated/model/IdentifierCreateReq.java b/src/main/java/com/corbado/generated/model/IdentifierCreateReq.java index 7b77233..7b9f256 100644 --- a/src/main/java/com/corbado/generated/model/IdentifierCreateReq.java +++ b/src/main/java/com/corbado/generated/model/IdentifierCreateReq.java @@ -51,7 +51,7 @@ /** * IdentifierCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class IdentifierCreateReq { public static final String SERIALIZED_NAME_IDENTIFIER_TYPE = "identifierType"; @SerializedName(SERIALIZED_NAME_IDENTIFIER_TYPE) diff --git a/src/main/java/com/corbado/generated/model/IdentifierList.java b/src/main/java/com/corbado/generated/model/IdentifierList.java index 19f8c24..d32d040 100644 --- a/src/main/java/com/corbado/generated/model/IdentifierList.java +++ b/src/main/java/com/corbado/generated/model/IdentifierList.java @@ -53,7 +53,7 @@ /** * IdentifierList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class IdentifierList { public static final String SERIALIZED_NAME_IDENTIFIERS = "identifiers"; @SerializedName(SERIALIZED_NAME_IDENTIFIERS) diff --git a/src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java b/src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java index 2d07537..7ca6590 100644 --- a/src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/IdentifierUpdateReq.java @@ -50,7 +50,7 @@ /** * IdentifierUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class IdentifierUpdateReq { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) diff --git a/src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java b/src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java index 0b6eba3..b434791 100644 --- a/src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java +++ b/src/main/java/com/corbado/generated/model/JavaScriptHighEntropy.java @@ -49,7 +49,7 @@ /** * JavaScriptHighEntropy */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class JavaScriptHighEntropy { public static final String SERIALIZED_NAME_PLATFORM = "platform"; @SerializedName(SERIALIZED_NAME_PLATFORM) diff --git a/src/main/java/com/corbado/generated/model/LongSession.java b/src/main/java/com/corbado/generated/model/LongSession.java index 6a6915d..e3672f8 100644 --- a/src/main/java/com/corbado/generated/model/LongSession.java +++ b/src/main/java/com/corbado/generated/model/LongSession.java @@ -50,7 +50,7 @@ /** * LongSession */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class LongSession { public static final String SERIALIZED_NAME_LONG_SESSION_I_D = "longSessionID"; @SerializedName(SERIALIZED_NAME_LONG_SESSION_I_D) diff --git a/src/main/java/com/corbado/generated/model/LongSessionCreateReq.java b/src/main/java/com/corbado/generated/model/LongSessionCreateReq.java index ef0ddbc..28f70a0 100644 --- a/src/main/java/com/corbado/generated/model/LongSessionCreateReq.java +++ b/src/main/java/com/corbado/generated/model/LongSessionCreateReq.java @@ -50,7 +50,7 @@ /** * LongSessionCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class LongSessionCreateReq { public static final String SERIALIZED_NAME_APP_TYPE = "appType"; @SerializedName(SERIALIZED_NAME_APP_TYPE) diff --git a/src/main/java/com/corbado/generated/model/LongSessionUpdateReq.java b/src/main/java/com/corbado/generated/model/LongSessionUpdateReq.java index fac7295..8ee786b 100644 --- a/src/main/java/com/corbado/generated/model/LongSessionUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/LongSessionUpdateReq.java @@ -50,7 +50,7 @@ /** * LongSessionUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class LongSessionUpdateReq { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) diff --git a/src/main/java/com/corbado/generated/model/Paging.java b/src/main/java/com/corbado/generated/model/Paging.java index 696ab56..223a5e2 100644 --- a/src/main/java/com/corbado/generated/model/Paging.java +++ b/src/main/java/com/corbado/generated/model/Paging.java @@ -49,7 +49,7 @@ /** * Paging */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class Paging { public static final String SERIALIZED_NAME_PAGE = "page"; @SerializedName(SERIALIZED_NAME_PAGE) diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java index 3e4490b..93c935b 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishReq.java @@ -50,7 +50,7 @@ /** * PasskeyAppendFinishReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyAppendFinishReq { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java index 8cbffcb..81cd800 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendFinishRsp.java @@ -50,7 +50,7 @@ /** * PasskeyAppendFinishRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyAppendFinishRsp { public static final String SERIALIZED_NAME_PASSKEY_DATA = "passkeyData"; @SerializedName(SERIALIZED_NAME_PASSKEY_DATA) diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java b/src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java index c861a3a..36d0820 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendStartReq.java @@ -51,7 +51,7 @@ /** * PasskeyAppendStartReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyAppendStartReq { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) diff --git a/src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java b/src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java index 6641c43..ea2025e 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyAppendStartRsp.java @@ -53,7 +53,7 @@ /** * PasskeyAppendStartRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyAppendStartRsp { public static final String SERIALIZED_NAME_APPEND_ALLOW = "appendAllow"; @SerializedName(SERIALIZED_NAME_APPEND_ALLOW) diff --git a/src/main/java/com/corbado/generated/model/PasskeyChallenge.java b/src/main/java/com/corbado/generated/model/PasskeyChallenge.java new file mode 100644 index 0000000..97780a6 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyChallenge.java @@ -0,0 +1,358 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.PasskeyChallengeStatus; +import com.corbado.generated.model.PasskeyChallengeType; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyChallenge + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyChallenge { + public static final String SERIALIZED_NAME_CHALLENGE_I_D = "challengeID"; + @SerializedName(SERIALIZED_NAME_CHALLENGE_I_D) + private String challengeID; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private PasskeyChallengeType type; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private PasskeyChallengeStatus status; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private Long created; + + public static final String SERIALIZED_NAME_EXPIRES = "expires"; + @SerializedName(SERIALIZED_NAME_EXPIRES) + private Long expires; + + public PasskeyChallenge() { + } + + public PasskeyChallenge challengeID(String challengeID) { + this.challengeID = challengeID; + return this; + } + + /** + * Get challengeID + * @return challengeID + */ + @javax.annotation.Nonnull + public String getChallengeID() { + return challengeID; + } + + public void setChallengeID(String challengeID) { + this.challengeID = challengeID; + } + + + public PasskeyChallenge type(PasskeyChallengeType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public PasskeyChallengeType getType() { + return type; + } + + public void setType(PasskeyChallengeType type) { + this.type = type; + } + + + public PasskeyChallenge value(String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + public PasskeyChallenge status(PasskeyChallengeStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public PasskeyChallengeStatus getStatus() { + return status; + } + + public void setStatus(PasskeyChallengeStatus status) { + this.status = status; + } + + + public PasskeyChallenge created(Long created) { + this.created = created; + return this; + } + + /** + * Get created + * @return created + */ + @javax.annotation.Nonnull + public Long getCreated() { + return created; + } + + public void setCreated(Long created) { + this.created = created; + } + + + public PasskeyChallenge expires(Long expires) { + this.expires = expires; + return this; + } + + /** + * Get expires + * @return expires + */ + @javax.annotation.Nonnull + public Long getExpires() { + return expires; + } + + public void setExpires(Long expires) { + this.expires = expires; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyChallenge passkeyChallenge = (PasskeyChallenge) o; + return Objects.equals(this.challengeID, passkeyChallenge.challengeID) && + Objects.equals(this.type, passkeyChallenge.type) && + Objects.equals(this.value, passkeyChallenge.value) && + Objects.equals(this.status, passkeyChallenge.status) && + Objects.equals(this.created, passkeyChallenge.created) && + Objects.equals(this.expires, passkeyChallenge.expires); + } + + @Override + public int hashCode() { + return Objects.hash(challengeID, type, value, status, created, expires); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyChallenge {\n"); + sb.append(" challengeID: ").append(toIndentedString(challengeID)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("challengeID"); + openapiFields.add("type"); + openapiFields.add("value"); + openapiFields.add("status"); + openapiFields.add("created"); + openapiFields.add("expires"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("challengeID"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("value"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("created"); + openapiRequiredFields.add("expires"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyChallenge + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyChallenge.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyChallenge is not found in the empty JSON string", PasskeyChallenge.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyChallenge.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyChallenge` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyChallenge.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("challengeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `challengeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("challengeID").toString())); + } + // validate the required field `type` + PasskeyChallengeType.validateJsonElement(jsonObj.get("type")); + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + // validate the required field `status` + PasskeyChallengeStatus.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyChallenge.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyChallenge' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyChallenge.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyChallenge value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyChallenge read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyChallenge given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyChallenge + * @throws IOException if the JSON string is invalid with respect to PasskeyChallenge + */ + public static PasskeyChallenge fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyChallenge.class); + } + + /** + * Convert an instance of PasskeyChallenge to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyChallengeList.java b/src/main/java/com/corbado/generated/model/PasskeyChallengeList.java new file mode 100644 index 0000000..a25864c --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyChallengeList.java @@ -0,0 +1,262 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.Paging; +import com.corbado.generated.model.PasskeyChallenge; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyChallengeList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyChallengeList { + public static final String SERIALIZED_NAME_PASSKEY_CHALLENGES = "passkeyChallenges"; + @SerializedName(SERIALIZED_NAME_PASSKEY_CHALLENGES) + private List passkeyChallenges = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAGING = "paging"; + @SerializedName(SERIALIZED_NAME_PAGING) + private Paging paging; + + public PasskeyChallengeList() { + } + + public PasskeyChallengeList passkeyChallenges(List passkeyChallenges) { + this.passkeyChallenges = passkeyChallenges; + return this; + } + + public PasskeyChallengeList addPasskeyChallengesItem(PasskeyChallenge passkeyChallengesItem) { + if (this.passkeyChallenges == null) { + this.passkeyChallenges = new ArrayList<>(); + } + this.passkeyChallenges.add(passkeyChallengesItem); + return this; + } + + /** + * Get passkeyChallenges + * @return passkeyChallenges + */ + @javax.annotation.Nonnull + public List getPasskeyChallenges() { + return passkeyChallenges; + } + + public void setPasskeyChallenges(List passkeyChallenges) { + this.passkeyChallenges = passkeyChallenges; + } + + + public PasskeyChallengeList paging(Paging paging) { + this.paging = paging; + return this; + } + + /** + * Get paging + * @return paging + */ + @javax.annotation.Nonnull + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyChallengeList passkeyChallengeList = (PasskeyChallengeList) o; + return Objects.equals(this.passkeyChallenges, passkeyChallengeList.passkeyChallenges) && + Objects.equals(this.paging, passkeyChallengeList.paging); + } + + @Override + public int hashCode() { + return Objects.hash(passkeyChallenges, paging); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyChallengeList {\n"); + sb.append(" passkeyChallenges: ").append(toIndentedString(passkeyChallenges)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("passkeyChallenges"); + openapiFields.add("paging"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("passkeyChallenges"); + openapiRequiredFields.add("paging"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyChallengeList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyChallengeList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyChallengeList is not found in the empty JSON string", PasskeyChallengeList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyChallengeList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyChallengeList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyChallengeList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("passkeyChallenges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `passkeyChallenges` to be an array in the JSON string but got `%s`", jsonObj.get("passkeyChallenges").toString())); + } + + JsonArray jsonArraypasskeyChallenges = jsonObj.getAsJsonArray("passkeyChallenges"); + // validate the required field `passkeyChallenges` (array) + for (int i = 0; i < jsonArraypasskeyChallenges.size(); i++) { + PasskeyChallenge.validateJsonElement(jsonArraypasskeyChallenges.get(i)); + }; + // validate the required field `paging` + Paging.validateJsonElement(jsonObj.get("paging")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyChallengeList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyChallengeList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyChallengeList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyChallengeList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyChallengeList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyChallengeList given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyChallengeList + * @throws IOException if the JSON string is invalid with respect to PasskeyChallengeList + */ + public static PasskeyChallengeList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyChallengeList.class); + } + + /** + * Convert an instance of PasskeyChallengeList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyChallengeStatus.java b/src/main/java/com/corbado/generated/model/PasskeyChallengeStatus.java new file mode 100644 index 0000000..34cec93 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyChallengeStatus.java @@ -0,0 +1,80 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets passkeyChallengeStatus + */ +@JsonAdapter(PasskeyChallengeStatus.Adapter.class) +public enum PasskeyChallengeStatus { + + PENDING("pending"), + + COMPLETED("completed"), + + CONSUMED("consumed"); + + private String value; + + PasskeyChallengeStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PasskeyChallengeStatus fromValue(String value) { + for (PasskeyChallengeStatus b : PasskeyChallengeStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PasskeyChallengeStatus enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PasskeyChallengeStatus read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PasskeyChallengeStatus.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PasskeyChallengeStatus.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyChallengeType.java b/src/main/java/com/corbado/generated/model/PasskeyChallengeType.java new file mode 100644 index 0000000..d186bbe --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyChallengeType.java @@ -0,0 +1,78 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets passkeyChallengeType + */ +@JsonAdapter(PasskeyChallengeType.Adapter.class) +public enum PasskeyChallengeType { + + REGISTER("register"), + + AUTHENTICATE("authenticate"); + + private String value; + + PasskeyChallengeType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PasskeyChallengeType fromValue(String value) { + for (PasskeyChallengeType b : PasskeyChallengeType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PasskeyChallengeType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PasskeyChallengeType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PasskeyChallengeType.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PasskeyChallengeType.fromValue(value); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyChallengeUpdateReq.java b/src/main/java/com/corbado/generated/model/PasskeyChallengeUpdateReq.java new file mode 100644 index 0000000..5193eb6 --- /dev/null +++ b/src/main/java/com/corbado/generated/model/PasskeyChallengeUpdateReq.java @@ -0,0 +1,214 @@ +/* + * Corbado Backend API + * # Introduction This documentation gives an overview of all Corbado Backend API calls to implement passwordless authentication with Passkeys. + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@corbado.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.corbado.generated.model; + +import java.util.Objects; +import com.corbado.generated.model.PasskeyChallengeStatus; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.corbado.generated.invoker.JSON; + +/** + * PasskeyChallengeUpdateReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +public class PasskeyChallengeUpdateReq { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private PasskeyChallengeStatus status; + + public PasskeyChallengeUpdateReq() { + } + + public PasskeyChallengeUpdateReq status(PasskeyChallengeStatus status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nonnull + public PasskeyChallengeStatus getStatus() { + return status; + } + + public void setStatus(PasskeyChallengeStatus status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyChallengeUpdateReq passkeyChallengeUpdateReq = (PasskeyChallengeUpdateReq) o; + return Objects.equals(this.status, passkeyChallengeUpdateReq.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyChallengeUpdateReq {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PasskeyChallengeUpdateReq + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyChallengeUpdateReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyChallengeUpdateReq is not found in the empty JSON string", PasskeyChallengeUpdateReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PasskeyChallengeUpdateReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PasskeyChallengeUpdateReq` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyChallengeUpdateReq.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `status` + PasskeyChallengeStatus.validateJsonElement(jsonObj.get("status")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PasskeyChallengeUpdateReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyChallengeUpdateReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyChallengeUpdateReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PasskeyChallengeUpdateReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PasskeyChallengeUpdateReq read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyChallengeUpdateReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyChallengeUpdateReq + * @throws IOException if the JSON string is invalid with respect to PasskeyChallengeUpdateReq + */ + public static PasskeyChallengeUpdateReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyChallengeUpdateReq.class); + } + + /** + * Convert an instance of PasskeyChallengeUpdateReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/corbado/generated/model/PasskeyData.java b/src/main/java/com/corbado/generated/model/PasskeyData.java index ee499a6..22bfa5b 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyData.java +++ b/src/main/java/com/corbado/generated/model/PasskeyData.java @@ -49,7 +49,7 @@ /** * PasskeyData */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyData { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -63,9 +63,67 @@ public class PasskeyData { @SerializedName(SERIALIZED_NAME_USERNAME) private String username; - public static final String SERIALIZED_NAME_IS_C_D_A = "isCDA"; - @SerializedName(SERIALIZED_NAME_IS_C_D_A) - private Boolean isCDA; + /** + * Gets or Sets ceremonyType + */ + @JsonAdapter(CeremonyTypeEnum.Adapter.class) + public enum CeremonyTypeEnum { + LOCAL("local"), + + CDA("cda"), + + SECURITY_KEY("security-key"); + + private String value; + + CeremonyTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CeremonyTypeEnum fromValue(String value) { + for (CeremonyTypeEnum b : CeremonyTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CeremonyTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CeremonyTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CeremonyTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CeremonyTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CEREMONY_TYPE = "ceremonyType"; + @SerializedName(SERIALIZED_NAME_CEREMONY_TYPE) + private CeremonyTypeEnum ceremonyType; + + public static final String SERIALIZED_NAME_CHALLENGE_I_D = "challengeID"; + @SerializedName(SERIALIZED_NAME_CHALLENGE_I_D) + private String challengeID; public PasskeyData() { } @@ -127,22 +185,41 @@ public void setUsername(String username) { } - public PasskeyData isCDA(Boolean isCDA) { - this.isCDA = isCDA; + public PasskeyData ceremonyType(CeremonyTypeEnum ceremonyType) { + this.ceremonyType = ceremonyType; return this; } /** - * Get isCDA - * @return isCDA + * Get ceremonyType + * @return ceremonyType */ @javax.annotation.Nonnull - public Boolean getIsCDA() { - return isCDA; + public CeremonyTypeEnum getCeremonyType() { + return ceremonyType; } - public void setIsCDA(Boolean isCDA) { - this.isCDA = isCDA; + public void setCeremonyType(CeremonyTypeEnum ceremonyType) { + this.ceremonyType = ceremonyType; + } + + + public PasskeyData challengeID(String challengeID) { + this.challengeID = challengeID; + return this; + } + + /** + * Get challengeID + * @return challengeID + */ + @javax.annotation.Nonnull + public String getChallengeID() { + return challengeID; + } + + public void setChallengeID(String challengeID) { + this.challengeID = challengeID; } @@ -159,12 +236,13 @@ public boolean equals(Object o) { return Objects.equals(this.id, passkeyData.id) && Objects.equals(this.userID, passkeyData.userID) && Objects.equals(this.username, passkeyData.username) && - Objects.equals(this.isCDA, passkeyData.isCDA); + Objects.equals(this.ceremonyType, passkeyData.ceremonyType) && + Objects.equals(this.challengeID, passkeyData.challengeID); } @Override public int hashCode() { - return Objects.hash(id, userID, username, isCDA); + return Objects.hash(id, userID, username, ceremonyType, challengeID); } @Override @@ -174,7 +252,8 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" userID: ").append(toIndentedString(userID)).append("\n"); sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" isCDA: ").append(toIndentedString(isCDA)).append("\n"); + sb.append(" ceremonyType: ").append(toIndentedString(ceremonyType)).append("\n"); + sb.append(" challengeID: ").append(toIndentedString(challengeID)).append("\n"); sb.append("}"); return sb.toString(); } @@ -200,14 +279,16 @@ private String toIndentedString(Object o) { openapiFields.add("id"); openapiFields.add("userID"); openapiFields.add("username"); - openapiFields.add("isCDA"); + openapiFields.add("ceremonyType"); + openapiFields.add("challengeID"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("id"); openapiRequiredFields.add("userID"); openapiRequiredFields.add("username"); - openapiRequiredFields.add("isCDA"); + openapiRequiredFields.add("ceremonyType"); + openapiRequiredFields.add("challengeID"); } /** @@ -247,6 +328,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("username").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } + if (!jsonObj.get("ceremonyType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ceremonyType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ceremonyType").toString())); + } + // validate the required field `ceremonyType` + CeremonyTypeEnum.validateJsonElement(jsonObj.get("ceremonyType")); + if (!jsonObj.get("challengeID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `challengeID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("challengeID").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/corbado/generated/model/PasskeyEvent.java b/src/main/java/com/corbado/generated/model/PasskeyEvent.java index c7deb31..b8fb1a3 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyEvent.java +++ b/src/main/java/com/corbado/generated/model/PasskeyEvent.java @@ -50,7 +50,7 @@ /** * PasskeyEvent */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyEvent { public static final String SERIALIZED_NAME_PASSKEY_EVENT_I_D = "passkeyEventID"; @SerializedName(SERIALIZED_NAME_PASSKEY_EVENT_I_D) diff --git a/src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java b/src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java index e9c273e..68f4685 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyEventCreateReq.java @@ -50,7 +50,7 @@ /** * PasskeyEventCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyEventCreateReq { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) @@ -60,6 +60,18 @@ public class PasskeyEventCreateReq { @SerializedName(SERIALIZED_NAME_EXPIRES) private Integer expires; + public static final String SERIALIZED_NAME_PROCESS_I_D = "processID"; + @SerializedName(SERIALIZED_NAME_PROCESS_I_D) + private String processID; + + public static final String SERIALIZED_NAME_CLIENT_ENV_I_D = "clientEnvID"; + @SerializedName(SERIALIZED_NAME_CLIENT_ENV_I_D) + private String clientEnvID; + + public static final String SERIALIZED_NAME_CREDENTIAL_I_D = "credentialID"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_I_D) + private String credentialID; + public PasskeyEventCreateReq() { } @@ -101,6 +113,63 @@ public void setExpires(Integer expires) { } + public PasskeyEventCreateReq processID(String processID) { + this.processID = processID; + return this; + } + + /** + * Get processID + * @return processID + */ + @javax.annotation.Nullable + public String getProcessID() { + return processID; + } + + public void setProcessID(String processID) { + this.processID = processID; + } + + + public PasskeyEventCreateReq clientEnvID(String clientEnvID) { + this.clientEnvID = clientEnvID; + return this; + } + + /** + * Get clientEnvID + * @return clientEnvID + */ + @javax.annotation.Nullable + public String getClientEnvID() { + return clientEnvID; + } + + public void setClientEnvID(String clientEnvID) { + this.clientEnvID = clientEnvID; + } + + + public PasskeyEventCreateReq credentialID(String credentialID) { + this.credentialID = credentialID; + return this; + } + + /** + * Get credentialID + * @return credentialID + */ + @javax.annotation.Nullable + public String getCredentialID() { + return credentialID; + } + + public void setCredentialID(String credentialID) { + this.credentialID = credentialID; + } + + @Override public boolean equals(Object o) { @@ -112,12 +181,15 @@ public boolean equals(Object o) { } PasskeyEventCreateReq passkeyEventCreateReq = (PasskeyEventCreateReq) o; return Objects.equals(this.eventType, passkeyEventCreateReq.eventType) && - Objects.equals(this.expires, passkeyEventCreateReq.expires); + Objects.equals(this.expires, passkeyEventCreateReq.expires) && + Objects.equals(this.processID, passkeyEventCreateReq.processID) && + Objects.equals(this.clientEnvID, passkeyEventCreateReq.clientEnvID) && + Objects.equals(this.credentialID, passkeyEventCreateReq.credentialID); } @Override public int hashCode() { - return Objects.hash(eventType, expires); + return Objects.hash(eventType, expires, processID, clientEnvID, credentialID); } @Override @@ -126,6 +198,9 @@ public String toString() { sb.append("class PasskeyEventCreateReq {\n"); sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); + sb.append(" processID: ").append(toIndentedString(processID)).append("\n"); + sb.append(" clientEnvID: ").append(toIndentedString(clientEnvID)).append("\n"); + sb.append(" credentialID: ").append(toIndentedString(credentialID)).append("\n"); sb.append("}"); return sb.toString(); } @@ -150,6 +225,9 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("eventType"); openapiFields.add("expires"); + openapiFields.add("processID"); + openapiFields.add("clientEnvID"); + openapiFields.add("credentialID"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -186,6 +264,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonObject jsonObj = jsonElement.getAsJsonObject(); // validate the required field `eventType` PasskeyEventType.validateJsonElement(jsonObj.get("eventType")); + if ((jsonObj.get("processID") != null && !jsonObj.get("processID").isJsonNull()) && !jsonObj.get("processID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `processID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processID").toString())); + } + if ((jsonObj.get("clientEnvID") != null && !jsonObj.get("clientEnvID").isJsonNull()) && !jsonObj.get("clientEnvID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientEnvID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientEnvID").toString())); + } + if ((jsonObj.get("credentialID") != null && !jsonObj.get("credentialID").isJsonNull()) && !jsonObj.get("credentialID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `credentialID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("credentialID").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/corbado/generated/model/PasskeyEventList.java b/src/main/java/com/corbado/generated/model/PasskeyEventList.java index 92f56cd..f7126f1 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyEventList.java +++ b/src/main/java/com/corbado/generated/model/PasskeyEventList.java @@ -53,7 +53,7 @@ /** * PasskeyEventList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyEventList { public static final String SERIALIZED_NAME_PASSKEY_EVENTS = "passkeyEvents"; @SerializedName(SERIALIZED_NAME_PASSKEY_EVENTS) diff --git a/src/main/java/com/corbado/generated/model/PasskeyEventType.java b/src/main/java/com/corbado/generated/model/PasskeyEventType.java index 4dbb902..164dbe3 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyEventType.java +++ b/src/main/java/com/corbado/generated/model/PasskeyEventType.java @@ -29,7 +29,17 @@ @JsonAdapter(PasskeyEventType.Adapter.class) public enum PasskeyEventType { - USER_LOGIN_BLACKLISTED("user-login-blacklisted"); + USER_LOGIN_BLACKLISTED("user-login-blacklisted"), + + LOGIN_EXPLICIT_ABORT("login-explicit-abort"), + + LOGIN_ERROR("login-error"), + + LOGIN_ONE_TAP_SWITCH("login-one-tap-switch"), + + USER_APPEND_AFTER_CROSS_PLATFORM_BLACKLISTED("user-append-after-cross-platform-blacklisted"), + + USER_APPEND_AFTER_LOGIN_ERROR_BLACKLISTED("user-append-after-login-error-blacklisted"); private String value; diff --git a/src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java b/src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java index 2c317d7..c1f3ed2 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java +++ b/src/main/java/com/corbado/generated/model/PasskeyIntelFlags.java @@ -49,7 +49,7 @@ /** * PasskeyIntelFlags */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyIntelFlags { public static final String SERIALIZED_NAME_FORCE_PASSKEY_APPEND = "forcePasskeyAppend"; @SerializedName(SERIALIZED_NAME_FORCE_PASSKEY_APPEND) diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java index e7b9a86..3dc266d 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishReq.java @@ -50,7 +50,7 @@ /** * PasskeyLoginFinishReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyLoginFinishReq { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java index effd8ed..da682af 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginFinishRsp.java @@ -50,7 +50,7 @@ /** * PasskeyLoginFinishRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyLoginFinishRsp { public static final String SERIALIZED_NAME_PASSKEY_DATA = "passkeyData"; @SerializedName(SERIALIZED_NAME_PASSKEY_DATA) diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java b/src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java index f5cadfc..dec2ed6 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginStartReq.java @@ -51,7 +51,7 @@ /** * PasskeyLoginStartReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyLoginStartReq { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) diff --git a/src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java b/src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java index 61539a2..6c9c90c 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyLoginStartRsp.java @@ -53,7 +53,7 @@ /** * PasskeyLoginStartRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyLoginStartRsp { public static final String SERIALIZED_NAME_LOGIN_ALLOW = "loginAllow"; @SerializedName(SERIALIZED_NAME_LOGIN_ALLOW) @@ -71,6 +71,10 @@ public class PasskeyLoginStartRsp { @SerializedName(SERIALIZED_NAME_ASSERTION_OPTIONS) private String assertionOptions; + public static final String SERIALIZED_NAME_IS_C_D_A_CANDIDATE = "isCDACandidate"; + @SerializedName(SERIALIZED_NAME_IS_C_D_A_CANDIDATE) + private Boolean isCDACandidate; + public PasskeyLoginStartRsp() { } @@ -158,6 +162,25 @@ public void setAssertionOptions(String assertionOptions) { } + public PasskeyLoginStartRsp isCDACandidate(Boolean isCDACandidate) { + this.isCDACandidate = isCDACandidate; + return this; + } + + /** + * Get isCDACandidate + * @return isCDACandidate + */ + @javax.annotation.Nonnull + public Boolean getIsCDACandidate() { + return isCDACandidate; + } + + public void setIsCDACandidate(Boolean isCDACandidate) { + this.isCDACandidate = isCDACandidate; + } + + @Override public boolean equals(Object o) { @@ -171,12 +194,13 @@ public boolean equals(Object o) { return Objects.equals(this.loginAllow, passkeyLoginStartRsp.loginAllow) && Objects.equals(this.detectionTags, passkeyLoginStartRsp.detectionTags) && Objects.equals(this.decisionTag, passkeyLoginStartRsp.decisionTag) && - Objects.equals(this.assertionOptions, passkeyLoginStartRsp.assertionOptions); + Objects.equals(this.assertionOptions, passkeyLoginStartRsp.assertionOptions) && + Objects.equals(this.isCDACandidate, passkeyLoginStartRsp.isCDACandidate); } @Override public int hashCode() { - return Objects.hash(loginAllow, detectionTags, decisionTag, assertionOptions); + return Objects.hash(loginAllow, detectionTags, decisionTag, assertionOptions, isCDACandidate); } @Override @@ -187,6 +211,7 @@ public String toString() { sb.append(" detectionTags: ").append(toIndentedString(detectionTags)).append("\n"); sb.append(" decisionTag: ").append(toIndentedString(decisionTag)).append("\n"); sb.append(" assertionOptions: ").append(toIndentedString(assertionOptions)).append("\n"); + sb.append(" isCDACandidate: ").append(toIndentedString(isCDACandidate)).append("\n"); sb.append("}"); return sb.toString(); } @@ -213,6 +238,7 @@ private String toIndentedString(Object o) { openapiFields.add("detectionTags"); openapiFields.add("decisionTag"); openapiFields.add("assertionOptions"); + openapiFields.add("isCDACandidate"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -220,6 +246,7 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("detectionTags"); openapiRequiredFields.add("decisionTag"); openapiRequiredFields.add("assertionOptions"); + openapiRequiredFields.add("isCDACandidate"); } /** diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java index 5df7e56..6a20401 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishReq.java @@ -50,7 +50,7 @@ /** * PasskeyMediationFinishReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyMediationFinishReq { public static final String SERIALIZED_NAME_ASSERTION_RESPONSE = "assertionResponse"; @SerializedName(SERIALIZED_NAME_ASSERTION_RESPONSE) @@ -60,6 +60,10 @@ public class PasskeyMediationFinishReq { @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) private ClientInformation clientInformation; + public static final String SERIALIZED_NAME_PROCESS_I_D = "processID"; + @SerializedName(SERIALIZED_NAME_PROCESS_I_D) + private String processID; + public PasskeyMediationFinishReq() { } @@ -101,6 +105,25 @@ public void setClientInformation(ClientInformation clientInformation) { } + public PasskeyMediationFinishReq processID(String processID) { + this.processID = processID; + return this; + } + + /** + * Get processID + * @return processID + */ + @javax.annotation.Nonnull + public String getProcessID() { + return processID; + } + + public void setProcessID(String processID) { + this.processID = processID; + } + + @Override public boolean equals(Object o) { @@ -112,12 +135,13 @@ public boolean equals(Object o) { } PasskeyMediationFinishReq passkeyMediationFinishReq = (PasskeyMediationFinishReq) o; return Objects.equals(this.assertionResponse, passkeyMediationFinishReq.assertionResponse) && - Objects.equals(this.clientInformation, passkeyMediationFinishReq.clientInformation); + Objects.equals(this.clientInformation, passkeyMediationFinishReq.clientInformation) && + Objects.equals(this.processID, passkeyMediationFinishReq.processID); } @Override public int hashCode() { - return Objects.hash(assertionResponse, clientInformation); + return Objects.hash(assertionResponse, clientInformation, processID); } @Override @@ -126,6 +150,7 @@ public String toString() { sb.append("class PasskeyMediationFinishReq {\n"); sb.append(" assertionResponse: ").append(toIndentedString(assertionResponse)).append("\n"); sb.append(" clientInformation: ").append(toIndentedString(clientInformation)).append("\n"); + sb.append(" processID: ").append(toIndentedString(processID)).append("\n"); sb.append("}"); return sb.toString(); } @@ -150,11 +175,13 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("assertionResponse"); openapiFields.add("clientInformation"); + openapiFields.add("processID"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("assertionResponse"); openapiRequiredFields.add("clientInformation"); + openapiRequiredFields.add("processID"); } /** @@ -190,6 +217,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the required field `clientInformation` ClientInformation.validateJsonElement(jsonObj.get("clientInformation")); + if (!jsonObj.get("processID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `processID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processID").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java index 9ae7845..72043b4 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationFinishRsp.java @@ -50,7 +50,7 @@ /** * PasskeyMediationFinishRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyMediationFinishRsp { public static final String SERIALIZED_NAME_PASSKEY_DATA = "passkeyData"; @SerializedName(SERIALIZED_NAME_PASSKEY_DATA) diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java b/src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java index 60f2f41..dc96f30 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationStartReq.java @@ -50,7 +50,7 @@ /** * PasskeyMediationStartReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyMediationStartReq { public static final String SERIALIZED_NAME_CLIENT_INFORMATION = "clientInformation"; @SerializedName(SERIALIZED_NAME_CLIENT_INFORMATION) diff --git a/src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java b/src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java index cc3d42c..0886171 100644 --- a/src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java +++ b/src/main/java/com/corbado/generated/model/PasskeyMediationStartRsp.java @@ -49,7 +49,7 @@ /** * PasskeyMediationStartRsp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class PasskeyMediationStartRsp { public static final String SERIALIZED_NAME_LOGIN_ALLOW = "loginAllow"; @SerializedName(SERIALIZED_NAME_LOGIN_ALLOW) diff --git a/src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java b/src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java index b8d706d..305aa7d 100644 --- a/src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java +++ b/src/main/java/com/corbado/generated/model/ProjectConfigUpdateCnameReq.java @@ -49,7 +49,7 @@ /** * ProjectConfigUpdateCnameReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ProjectConfigUpdateCnameReq { public static final String SERIALIZED_NAME_CNAME = "cname"; @SerializedName(SERIALIZED_NAME_CNAME) diff --git a/src/main/java/com/corbado/generated/model/RequestData.java b/src/main/java/com/corbado/generated/model/RequestData.java index cb0cd5f..907c522 100644 --- a/src/main/java/com/corbado/generated/model/RequestData.java +++ b/src/main/java/com/corbado/generated/model/RequestData.java @@ -49,7 +49,7 @@ /** * Data about the request itself, can be used for debugging */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class RequestData { public static final String SERIALIZED_NAME_REQUEST_I_D = "requestID"; @SerializedName(SERIALIZED_NAME_REQUEST_I_D) diff --git a/src/main/java/com/corbado/generated/model/ShortSession.java b/src/main/java/com/corbado/generated/model/ShortSession.java index 1e718fe..abbdf37 100644 --- a/src/main/java/com/corbado/generated/model/ShortSession.java +++ b/src/main/java/com/corbado/generated/model/ShortSession.java @@ -49,7 +49,7 @@ /** * ShortSession */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ShortSession { public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) diff --git a/src/main/java/com/corbado/generated/model/ShortSessionCreateReq.java b/src/main/java/com/corbado/generated/model/ShortSessionCreateReq.java index 2496eb1..3accf4e 100644 --- a/src/main/java/com/corbado/generated/model/ShortSessionCreateReq.java +++ b/src/main/java/com/corbado/generated/model/ShortSessionCreateReq.java @@ -50,7 +50,7 @@ /** * ShortSessionCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class ShortSessionCreateReq { public static final String SERIALIZED_NAME_APP_TYPE = "appType"; @SerializedName(SERIALIZED_NAME_APP_TYPE) diff --git a/src/main/java/com/corbado/generated/model/SocialAccount.java b/src/main/java/com/corbado/generated/model/SocialAccount.java index 4993f35..fcad5ea 100644 --- a/src/main/java/com/corbado/generated/model/SocialAccount.java +++ b/src/main/java/com/corbado/generated/model/SocialAccount.java @@ -49,7 +49,7 @@ /** * SocialAccount */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class SocialAccount { public static final String SERIALIZED_NAME_SOCIAL_ACCOUNT_I_D = "socialAccountID"; @SerializedName(SERIALIZED_NAME_SOCIAL_ACCOUNT_I_D) diff --git a/src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java b/src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java index 5e85fa8..22ce26a 100644 --- a/src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java +++ b/src/main/java/com/corbado/generated/model/SocialAccountCreateReq.java @@ -50,7 +50,7 @@ /** * SocialAccountCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class SocialAccountCreateReq { public static final String SERIALIZED_NAME_PROVIDER_TYPE = "providerType"; @SerializedName(SERIALIZED_NAME_PROVIDER_TYPE) diff --git a/src/main/java/com/corbado/generated/model/SocialAccountList.java b/src/main/java/com/corbado/generated/model/SocialAccountList.java index c7db6d0..1b9f92e 100644 --- a/src/main/java/com/corbado/generated/model/SocialAccountList.java +++ b/src/main/java/com/corbado/generated/model/SocialAccountList.java @@ -53,7 +53,7 @@ /** * SocialAccountList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class SocialAccountList { public static final String SERIALIZED_NAME_SOCIAL_ACCOUNTS = "socialAccounts"; @SerializedName(SERIALIZED_NAME_SOCIAL_ACCOUNTS) diff --git a/src/main/java/com/corbado/generated/model/User.java b/src/main/java/com/corbado/generated/model/User.java index 5b33145..f8ac423 100644 --- a/src/main/java/com/corbado/generated/model/User.java +++ b/src/main/java/com/corbado/generated/model/User.java @@ -50,7 +50,7 @@ /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class User { public static final String SERIALIZED_NAME_USER_I_D = "userID"; @SerializedName(SERIALIZED_NAME_USER_I_D) diff --git a/src/main/java/com/corbado/generated/model/UserCreateReq.java b/src/main/java/com/corbado/generated/model/UserCreateReq.java index 1b73bd2..8ffa903 100644 --- a/src/main/java/com/corbado/generated/model/UserCreateReq.java +++ b/src/main/java/com/corbado/generated/model/UserCreateReq.java @@ -50,7 +50,7 @@ /** * UserCreateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class UserCreateReq { public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; @SerializedName(SERIALIZED_NAME_FULL_NAME) diff --git a/src/main/java/com/corbado/generated/model/UserUpdateReq.java b/src/main/java/com/corbado/generated/model/UserUpdateReq.java index de34094..a9caf55 100644 --- a/src/main/java/com/corbado/generated/model/UserUpdateReq.java +++ b/src/main/java/com/corbado/generated/model/UserUpdateReq.java @@ -50,7 +50,7 @@ /** * UserUpdateReq */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-02T14:34:22.087477742Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-13T12:08:31.183817564Z[Etc/UTC]", comments = "Generator version: 7.8.0-SNAPSHOT") public class UserUpdateReq { public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; @SerializedName(SERIALIZED_NAME_FULL_NAME) diff --git a/src/main/java/com/corbado/services/UserService.java b/src/main/java/com/corbado/services/UserService.java index 88e48c1..f38768f 100644 --- a/src/main/java/com/corbado/services/UserService.java +++ b/src/main/java/com/corbado/services/UserService.java @@ -4,6 +4,7 @@ import com.corbado.exceptions.CorbadoServerException; import com.corbado.generated.api.UsersApi; import com.corbado.generated.invoker.ApiException; +import com.corbado.generated.model.GenericRsp; import com.corbado.generated.model.UserCreateReq; import com.corbado.generated.model.UserStatus; import com.corbado.services.base.ApiService; @@ -93,9 +94,9 @@ public UserEntity createActiveByName(@NonNull final String fullName) * @return the user entity * @throws CorbadoServerException the corbado server exception */ - public UserEntity delete(final String userId) throws CorbadoServerException { + public GenericRsp delete(final String userId) throws CorbadoServerException { try { - return new UserEntity(client.userDelete(userId)); + return client.userDelete(userId); } catch (final ApiException e) { throw new CorbadoServerException(e); diff --git a/src/test/java/com/corbado/integration/UserServiceIT.java b/src/test/java/com/corbado/integration/UserServiceIT.java index 804bf48..c454986 100644 --- a/src/test/java/com/corbado/integration/UserServiceIT.java +++ b/src/test/java/com/corbado/integration/UserServiceIT.java @@ -9,6 +9,7 @@ import com.corbado.exceptions.CorbadoServerException; import com.corbado.exceptions.CorbadoServerException.ValidationMessage; import com.corbado.exceptions.StandardException; +import com.corbado.generated.model.GenericRsp; import com.corbado.generated.model.UserCreateReq; import com.corbado.services.UserService; import com.corbado.util.TestUtils; @@ -82,19 +83,20 @@ void test_UserGet_ExpectNotFound() { } /** Test for successfully retrieving a user. * */ + // TODO fix @Test void test_UserGet_ExpectSuccess() throws CorbadoServerException, StandardException { final String userId = TestUtils.createUser(); - final UserEntity rsp = fixture.delete(userId); - assertEquals(userId, rsp.getUserID()); + final GenericRsp rsp = fixture.delete(userId); + assertEquals(200, rsp.getHttpStatusCode()); } /** Test for successfully deleting a user. * */ @Test void test_UserDelete_ExpectSuccess() throws CorbadoServerException, StandardException { final String userId = TestUtils.createUser(); - final UserEntity rsp = fixture.delete(userId); + final GenericRsp rsp = fixture.delete(userId); - assertEquals(userId, rsp.getUserID()); + assertEquals(200, rsp.getHttpStatusCode()); } } From 2c578a4c2398243c59a34ae76e3e156b9b9bd1a6 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Tue, 13 Aug 2024 14:43:13 +0200 Subject: [PATCH 28/59] finished UserService implementation and tests (including new api version) --- .../com/corbado/services/UserService.java | 57 ++++---- .../integration/IdentifierServiceIT.java | 137 +++++++++--------- .../corbado/integration/UserServiceIT.java | 80 +++++----- src/test/java/com/corbado/util/TestUtils.java | 18 +-- 4 files changed, 153 insertions(+), 139 deletions(-) diff --git a/src/main/java/com/corbado/services/UserService.java b/src/main/java/com/corbado/services/UserService.java index f38768f..8683afd 100644 --- a/src/main/java/com/corbado/services/UserService.java +++ b/src/main/java/com/corbado/services/UserService.java @@ -1,15 +1,17 @@ package com.corbado.services; +import java.util.Objects; + +import javax.annotation.Nullable; + import com.corbado.entities.UserEntity; import com.corbado.exceptions.CorbadoServerException; import com.corbado.generated.api.UsersApi; import com.corbado.generated.invoker.ApiException; -import com.corbado.generated.model.GenericRsp; import com.corbado.generated.model.UserCreateReq; import com.corbado.generated.model.UserStatus; import com.corbado.services.base.ApiService; -import java.util.Objects; -import javax.annotation.Nullable; + import lombok.NonNull; /** Service for managing users. */ @@ -24,24 +26,6 @@ public UserService(final UsersApi client) { super(client); } - /** - * Create a user. - * - * @param request User create request - * @return UserCreateRsp Response - * @throws CorbadoServerException If any server-side error occurs. - */ - public UserEntity create(@NonNull final UserCreateReq request) throws CorbadoServerException { - Objects.requireNonNull( - request.getStatus(), "Required field 'UserCreateReq.status' in 'request' cannot be null"); - - try { - return new UserEntity(client.userCreate(request)); - } catch (final ApiException e) { - throw new CorbadoServerException(e); - } - } - /** * Create a user. * @@ -63,7 +47,25 @@ public UserEntity create( .status(status) .explicitWebauthnID(explicitWebauthnID); try { - return new UserEntity(client.userCreate(request)); + return new UserEntity(this.client.userCreate(request)); + } catch (final ApiException e) { + throw new CorbadoServerException(e); + } + } + + /** + * Create a user. + * + * @param request User create request + * @return UserCreateRsp Response + * @throws CorbadoServerException If any server-side error occurs. + */ + public UserEntity create(@NonNull final UserCreateReq request) throws CorbadoServerException { + Objects.requireNonNull( + request.getStatus(), "Required field 'UserCreateReq.status' in 'request' cannot be null"); + + try { + return new UserEntity(this.client.userCreate(request)); } catch (final ApiException e) { throw new CorbadoServerException(e); } @@ -81,7 +83,7 @@ public UserEntity createActiveByName(@NonNull final String fullName) final UserCreateReq request = new UserCreateReq().fullName(fullName).status(UserStatus.ACTIVE); try { - return new UserEntity(client.userCreate(request)); + return new UserEntity(this.client.userCreate(request)); } catch (final ApiException e) { throw new CorbadoServerException(e); } @@ -91,12 +93,11 @@ public UserEntity createActiveByName(@NonNull final String fullName) * Delete user. * * @param userId the user id - * @return the user entity - * @throws CorbadoServerException the corbado server exception + * @throws CorbadoServerException exception thrown on error or if user is not found */ - public GenericRsp delete(final String userId) throws CorbadoServerException { + public void delete(final String userId) throws CorbadoServerException { try { - return client.userDelete(userId); + this.client.userDelete(userId); } catch (final ApiException e) { throw new CorbadoServerException(e); @@ -112,7 +113,7 @@ public GenericRsp delete(final String userId) throws CorbadoServerException { */ public UserEntity get(final String userId) throws CorbadoServerException { try { - return new UserEntity(client.userGet(userId)); + return new UserEntity(this.client.userGet(userId)); } catch (final ApiException e) { throw new CorbadoServerException(e); } diff --git a/src/test/java/com/corbado/integration/IdentifierServiceIT.java b/src/test/java/com/corbado/integration/IdentifierServiceIT.java index df47627..d375e85 100644 --- a/src/test/java/com/corbado/integration/IdentifierServiceIT.java +++ b/src/test/java/com/corbado/integration/IdentifierServiceIT.java @@ -6,6 +6,10 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + import com.corbado.base.AbstractSdkTest; import com.corbado.exceptions.CorbadoServerException; import com.corbado.exceptions.StandardException; @@ -17,8 +21,7 @@ import com.corbado.generated.model.IdentifierType; import com.corbado.services.IdentifierService; import com.corbado.util.TestUtils; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; + import lombok.extern.slf4j.Slf4j; /** The Class UserServiceIT. */ @@ -40,6 +43,22 @@ class IdentifierServiceIT extends AbstractSdkTest { /** The test user email id. */ private static Identifier TEST_USER_EMAIL_IDENTIFIER = null; + /** + * Assert validation error equals. + * + * @param e the CorbadoServerException + * @param validatedFieldName the validated field name + * @param expectedMessage the expected message + */ + private void assertValidationErrorEquals( + final CorbadoServerException e, + final String validatedFieldName, + final String expectedMessage) { + assertEquals(1, e.getValidationMessages().size()); + assertEquals(validatedFieldName, e.getValidationMessages().get(0).getField()); + assertEquals(expectedMessage, e.getValidationMessages().get(0).getMessage()); + } + /** * Sets the up class. * @@ -48,8 +67,8 @@ class IdentifierServiceIT extends AbstractSdkTest { */ @BeforeAll public void setUpClass() throws StandardException, CorbadoServerException { - fixture = sdk.getIdentifiers(); - TEST_USER_ID = TestUtils.createUser(); + fixture = this.sdk.getIdentifiers(); + TEST_USER_ID = TestUtils.createUser().getUserID(); TEST_USER_EMAIL = TestUtils.createRandomTestEmail(); TEST_USER_PHONE = TestUtils.createRandomTestPhoneNumber(); @@ -74,22 +93,23 @@ public void setUpClass() throws StandardException, CorbadoServerException { TEST_USER_PHONE); } - /** Test for successfully creating an identifier. * */ + /** + * Test get email and get email with false identifier. + * + * @throws CorbadoServerException the corbado server exception + * @throws StandardException the standard exception + * @throws ApiException the api exception + */ @Test - void test_CreateIdentifier_ExpectSuccess() throws CorbadoServerException, StandardException { - final String userId = TestUtils.createUser(); - final String email = TestUtils.createRandomTestEmail(); - final Identifier rsp = - fixture.create( - userId, - new IdentifierCreateReq() - .identifierType(IdentifierType.EMAIL) - .identifierValue(email) - .status(IdentifierStatus.PRIMARY)); + void test_checkExistingEmailIsPresent_ExpectSuccess() + throws CorbadoServerException, StandardException, ApiException { - assertEquals(userId, rsp.getUserID()); - assertEquals(email, rsp.getValue()); - assertEquals(IdentifierType.EMAIL, rsp.getType()); + IdentifierList ret = fixture.listByValueAndType(TEST_USER_EMAIL, IdentifierType.EMAIL); + assertNotEquals(0, ret.getIdentifiers().size()); + ret = fixture.listByValueAndType(TEST_USER_EMAIL, IdentifierType.PHONE); + assertTrue(fixture.existsByValueAndType(TEST_USER_EMAIL, IdentifierType.EMAIL)); + assertFalse((fixture.existsByValueAndType(TEST_USER_EMAIL, IdentifierType.PHONE))); + assertEquals(0, ret.getIdentifiers().size()); } /** @@ -101,7 +121,7 @@ void test_CreateIdentifier_ExpectSuccess() throws CorbadoServerException, Standa @Test void test_CreateEmptyIdentifier_ExpectException() throws CorbadoServerException, StandardException { - final String userId = TestUtils.createUser(); + final String userId = TestUtils.createUser().getUserID(); final String email = ""; final CorbadoServerException e = assertThrows( @@ -118,60 +138,61 @@ void test_CreateEmptyIdentifier_ExpectException() assertValidationErrorEquals(e, "identifierValue", TestUtils.CANNOT_BE_BLANK_MESSAGE); } - /** - * Test list expect success. - * - * @throws CorbadoServerException the corbado server exception - * @throws StandardException the standard exception - */ + /** Test for successfully creating an identifier. * */ @Test - void test_ListIdentifiersAll_ExpectSuccess() throws CorbadoServerException, StandardException { - final IdentifierList ret = fixture.list(null, null, null, 100); - - for (final Identifier x : ret.getIdentifiers()) { - log.error("Userid: {}, Value: {}", x.getUserID(), x.getValue()); - } + void test_CreateIdentifier_ExpectSuccess() throws CorbadoServerException, StandardException { + final String userId = TestUtils.createUser().getUserID(); + final String email = TestUtils.createRandomTestEmail(); + final Identifier rsp = + fixture.create( + userId, + new IdentifierCreateReq() + .identifierType(IdentifierType.EMAIL) + .identifierValue(email) + .status(IdentifierStatus.PRIMARY)); - assertNotNull(ret); + assertEquals(userId, rsp.getUserID()); + assertEquals(email, rsp.getValue()); + assertEquals(IdentifierType.EMAIL, rsp.getType()); } /** - * Test get email and get email with false identifier. + * Test case for search for Identifiers by userId. * * @throws CorbadoServerException the corbado server exception * @throws StandardException the standard exception * @throws ApiException the api exception */ @Test - void test_checkExistingEmailIsPresent_ExpectSuccess() + void test_getIdentifiersForUserId_ExpectListOfIdentifiers() throws CorbadoServerException, StandardException, ApiException { - IdentifierList ret = fixture.listByValueAndType(TEST_USER_EMAIL, IdentifierType.EMAIL); - assertNotEquals(0, ret.getIdentifiers().size()); - ret = fixture.listByValueAndType(TEST_USER_EMAIL, IdentifierType.PHONE); - assertTrue(fixture.existsByValueAndType(TEST_USER_EMAIL, IdentifierType.EMAIL)); - assertFalse((fixture.existsByValueAndType(TEST_USER_EMAIL, IdentifierType.PHONE))); - assertEquals(0, ret.getIdentifiers().size()); + final IdentifierList ret = fixture.listAllByUserIdWithPaging(TEST_USER_ID, null, null); + ret.getIdentifiers().stream() + .map(Identifier::getIdentifierID) + .anyMatch(x -> x.equals(TEST_USER_EMAIL_IDENTIFIER.getIdentifierID())); + assertEquals(2, ret.getIdentifiers().size()); } /** - * Test case for search for Identifiers by userId. + * Test list expect success. * * @throws CorbadoServerException the corbado server exception * @throws StandardException the standard exception - * @throws ApiException the api exception */ @Test - void test_getIdentifiersForUserId_ExpectListOfIdentifiers() - throws CorbadoServerException, StandardException, ApiException { + void test_ListIdentifiersAll_ExpectSuccess() throws CorbadoServerException, StandardException { + final IdentifierList ret = fixture.list(null, null, null, 100); - final IdentifierList ret = fixture.listAllByUserIdWithPaging(TEST_USER_ID, null, null); - ret.getIdentifiers().stream() - .map(Identifier::getIdentifierID) - .anyMatch(x -> x.equals(TEST_USER_EMAIL_IDENTIFIER.getIdentifierID())); - assertEquals(2, ret.getIdentifiers().size()); + for (final Identifier x : ret.getIdentifiers()) { + log.error("Userid: {}, Value: {}", x.getUserID(), x.getValue()); + } + + assertNotNull(ret); } + // ----------- Helper functions ------------// + /** * Test get email and get email with false identifier. * @@ -201,22 +222,4 @@ void test_updateIdentifier_ExpectSuccess() TEST_USER_EMAIL_IDENTIFIER.getValue(), TEST_USER_EMAIL_IDENTIFIER.getType()); assertEquals(IdentifierStatus.PRIMARY, ret.getIdentifiers().get(0).getStatus()); } - - // ----------- Helper functions ------------// - - /** - * Assert validation error equals. - * - * @param e the e - * @param validatedFieldName the validated field name - * @param expectedMessage the expected message - */ - private void assertValidationErrorEquals( - final CorbadoServerException e, - final String validatedFieldName, - final String expectedMessage) { - assertEquals(1, e.getValidationMessages().size()); - assertEquals(validatedFieldName, e.getValidationMessages().get(0).getField()); - assertEquals(expectedMessage, e.getValidationMessages().get(0).getMessage()); - } } diff --git a/src/test/java/com/corbado/integration/UserServiceIT.java b/src/test/java/com/corbado/integration/UserServiceIT.java index c454986..379e44b 100644 --- a/src/test/java/com/corbado/integration/UserServiceIT.java +++ b/src/test/java/com/corbado/integration/UserServiceIT.java @@ -1,20 +1,19 @@ package com.corbado.integration; -import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + import com.corbado.base.AbstractSdkTest; import com.corbado.entities.UserEntity; import com.corbado.exceptions.CorbadoServerException; -import com.corbado.exceptions.CorbadoServerException.ValidationMessage; import com.corbado.exceptions.StandardException; -import com.corbado.generated.model.GenericRsp; import com.corbado.generated.model.UserCreateReq; import com.corbado.services.UserService; import com.corbado.util.TestUtils; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; /** The Class UserServiceIT. */ class UserServiceIT extends AbstractSdkTest { @@ -29,34 +28,31 @@ class UserServiceIT extends AbstractSdkTest { */ @BeforeAll public void setUpClass() throws StandardException { - fixture = sdk.getUsers(); + this.fixture = this.sdk.getUsers(); } /** Test instantiate sdk expect not null. */ @Test void test_InstantiateSdk_ExpectNotNull() { - assertNotNull(sdk); + assertNotNull(this.sdk); } - /** Test case for user creation with validation error. * */ + /** + * Test case for user creation with validation error. * + * + * @throws CorbadoServerException + */ @Test - void test_UserCreateBlankName_ExpectSuccess() { + void test_UserCreateBlankName_ExpectSuccess() throws CorbadoServerException { - final CorbadoServerException e = - assertThrows(CorbadoServerException.class, () -> fixture.createActiveByName("")); - assertNotNull(e); - assertEquals(400, e.getHttpStatusCode()); - - assertArrayEquals( - new ValidationMessage[] {new ValidationMessage("name", "cannot be blank")}, - e.getValidationMessages().toArray()); + this.fixture.createActiveByName(""); } /** Test case for successful user creation. * */ @Test void test_UserCreateExpectSuccess() throws CorbadoServerException { final String name = TestUtils.createRandomTestName(); - final UserEntity rsp = fixture.createActiveByName(name); + final UserEntity rsp = this.fixture.createActiveByName(name); assertEquals(name, rsp.getFullName()); } @@ -65,38 +61,52 @@ void test_UserCreateExpectSuccess() throws CorbadoServerException { void test_UserCreateWithoutStatus_ExpectNullPoinerException() throws CorbadoServerException { final UserCreateReq req = new UserCreateReq().fullName(TestUtils.createRandomTestName()); - assertThrows(NullPointerException.class, () -> fixture.create(req)); + assertThrows(NullPointerException.class, () -> this.fixture.create(req)); } - /** Test for retrieving a user that does not exist. * */ + /** Test for successfully deleting a user. * */ @Test - void test_UserGet_ExpectNotFound() { + void test_UserDelete_ExpectSuccess() throws CorbadoServerException, StandardException { + final UserEntity user = TestUtils.createUser(); + this.fixture.delete(user.getUserID()); final CorbadoServerException e = assertThrows( CorbadoServerException.class, () -> { - final UserEntity ret = fixture.get("usr-1234567890"); + final UserEntity ret = this.fixture.get(user.getUserID()); System.out.println(ret.toString()); }); assertNotNull(e); - assertEquals(404, e.getHttpStatusCode()); + assertEquals(400, e.getHttpStatusCode()); + assertEquals("does not exist", e.getValidationMessages().get(0).getMessage()); + assertEquals("userID", e.getValidationMessages().get(0).getField()); } - /** Test for successfully retrieving a user. * */ - // TODO fix + /** + * Test for retrieving a user that does not exist. Should return a 'Bad request' with validation + * message "does not exist" on field "userID" + */ @Test - void test_UserGet_ExpectSuccess() throws CorbadoServerException, StandardException { - final String userId = TestUtils.createUser(); - final GenericRsp rsp = fixture.delete(userId); - assertEquals(200, rsp.getHttpStatusCode()); + void test_UserGet_ExpectNotFound() { + final CorbadoServerException e = + assertThrows( + CorbadoServerException.class, + () -> { + final UserEntity ret = this.fixture.get("usr-1234567890"); + System.out.println(ret.toString()); + }); + assertNotNull(e); + assertEquals(400, e.getHttpStatusCode()); + assertEquals("does not exist", e.getValidationMessages().get(0).getMessage()); + assertEquals("userID", e.getValidationMessages().get(0).getField()); } - /** Test for successfully deleting a user. * */ + /** Test for successfully retrieving a user. * */ @Test - void test_UserDelete_ExpectSuccess() throws CorbadoServerException, StandardException { - final String userId = TestUtils.createUser(); - final GenericRsp rsp = fixture.delete(userId); - - assertEquals(200, rsp.getHttpStatusCode()); + void test_UserGet_ExpectSuccess() throws CorbadoServerException, StandardException { + final UserEntity user = TestUtils.createUser(); + final UserEntity ret = this.fixture.get(user.getUserID()); + assertEquals(user, ret); + this.fixture.delete(user.getUserID()); } } diff --git a/src/test/java/com/corbado/util/TestUtils.java b/src/test/java/com/corbado/util/TestUtils.java index 6328c48..00a5f8a 100644 --- a/src/test/java/com/corbado/util/TestUtils.java +++ b/src/test/java/com/corbado/util/TestUtils.java @@ -1,5 +1,7 @@ package com.corbado.util; +import java.util.Random; + import com.corbado.entities.UserEntity; import com.corbado.exceptions.CorbadoServerException; import com.corbado.exceptions.StandardException; @@ -7,8 +9,8 @@ import com.corbado.generated.model.UserStatus; import com.corbado.sdk.Config; import com.corbado.sdk.CorbadoSdk; + import io.github.cdimascio.dotenv.Dotenv; -import java.util.Random; /** The Class TestUtils. */ public class TestUtils { @@ -63,11 +65,10 @@ public static String createRandomTestPhoneNumber() { * @throws CorbadoServerException the corbado server exception * @throws StandardException the standard exception */ - public static String createUser() throws CorbadoServerException, StandardException { + public static UserEntity createUser() throws CorbadoServerException, StandardException { final UserCreateReq req = new UserCreateReq().fullName(createRandomTestName()).status(UserStatus.ACTIVE); - final UserEntity rsp = instantiateSDK().getUsers().create(req); - return rsp.getUserID(); + return instantiateSDK().getUsers().create(req); } /** @@ -89,8 +90,8 @@ public static String generateString(final int length, final String characters) { /** * Instantiate SDK with parameters from environment variables. * - * @return CorbadoSdk instance - * @throws StandardException + * @return the corbado sdk + * @throws StandardException the standard exception */ public static CorbadoSdk instantiateSDK() throws StandardException { final Dotenv dotenv = Dotenv.load(); @@ -99,10 +100,9 @@ public static CorbadoSdk instantiateSDK() throws StandardException { final String projectId = dotenv.get(CORBADO_PROJECT_ID, "missing CORBADO_PROJECT_ID"); final String backendApi = dotenv.get(CORBADO_BACKEND_API); - if (backendApi != null) { + if (backendApi == null || backendApi == "") { return new CorbadoSdk(new Config(projectId, apiSecret, backendApi)); - } else { - return new CorbadoSdk(new Config(projectId, apiSecret)); } + return new CorbadoSdk(new Config(projectId, apiSecret)); } } From d24b0b3410966ba97484c9441945abb782ab7110 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Tue, 13 Aug 2024 15:02:25 +0200 Subject: [PATCH 29/59] fix access modifiers --- .../com/corbado/services/SessionService.java | 27 ++++++++----------- .../com/corbado/services/UserService.java | 4 +-- .../corbado/integration/UserServiceIT.java | 2 -- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/corbado/services/SessionService.java b/src/main/java/com/corbado/services/SessionService.java index 301479d..f22e355 100644 --- a/src/main/java/com/corbado/services/SessionService.java +++ b/src/main/java/com/corbado/services/SessionService.java @@ -1,5 +1,10 @@ package com.corbado.services; +import java.security.interfaces.RSAPublicKey; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.lang3.StringUtils; + import com.auth0.jwk.Jwk; import com.auth0.jwk.JwkException; import com.auth0.jwk.JwkProvider; @@ -12,9 +17,7 @@ import com.auth0.jwt.interfaces.DecodedJWT; import com.corbado.entities.SessionValidationResult; import com.corbado.utils.ValidationUtils; -import java.security.interfaces.RSAPublicKey; -import java.util.concurrent.TimeUnit; -import org.apache.commons.lang3.StringUtils; + import lombok.Getter; import lombok.NonNull; import lombok.Setter; @@ -31,25 +34,19 @@ public class SessionService { private static final int JWK_CACHE_SIZE = 100; /** The short session cookie name. */ - private final String shortSessionCookieName; + private String shortSessionCookieName; /** The issuer. */ - private final String issuer; + private String issuer; /** The jwks uri. */ - private final String jwksUri; + private String jwksUri; /** The last short session validation result. */ private String lastShortSessionValidationResult; - /** The short session length. */ - private int shortSessionLength = 300; // Default short session length in seconds - - /** The cache keys. */ - private boolean cacheKeys = false; - /** The jwk provider. */ - private final JwkProvider jwkProvider; + private JwkProvider jwkProvider; /** * Instantiates a new session service. @@ -72,8 +69,6 @@ public SessionService( this.shortSessionCookieName = shortSessionCookieName; this.issuer = issuer; this.jwksUri = jwksUri; - this.shortSessionLength = shortSessionLength; - this.cacheKeys = cacheKeys; final JwkProviderBuilder jwkProviderBuilder = new JwkProviderBuilder(this.jwksUri); if (cacheKeys) { @@ -107,7 +102,7 @@ private SessionValidationResult getAndValidateUserFromShortSessionValue( try { // Get the signing key DecodedJWT decodedJwt = JWT.decode(shortSession); - final Jwk jwk = jwkProvider.get(decodedJwt.getKeyId()); + final Jwk jwk = this.jwkProvider.get(decodedJwt.getKeyId()); if (jwk == null) { throw new SigningKeyNotFoundException(shortSession, null); } diff --git a/src/main/java/com/corbado/services/UserService.java b/src/main/java/com/corbado/services/UserService.java index 8683afd..ae6ea30 100644 --- a/src/main/java/com/corbado/services/UserService.java +++ b/src/main/java/com/corbado/services/UserService.java @@ -95,7 +95,7 @@ public UserEntity createActiveByName(@NonNull final String fullName) * @param userId the user id * @throws CorbadoServerException exception thrown on error or if user is not found */ - public void delete(final String userId) throws CorbadoServerException { + public void delete(@NonNull final String userId) throws CorbadoServerException { try { this.client.userDelete(userId); @@ -111,7 +111,7 @@ public void delete(final String userId) throws CorbadoServerException { * @return UserGetRsp Response * @throws CorbadoServerException If any server-side error occurs. */ - public UserEntity get(final String userId) throws CorbadoServerException { + public UserEntity get(@NonNull final String userId) throws CorbadoServerException { try { return new UserEntity(this.client.userGet(userId)); } catch (final ApiException e) { diff --git a/src/test/java/com/corbado/integration/UserServiceIT.java b/src/test/java/com/corbado/integration/UserServiceIT.java index 379e44b..ef31eaf 100644 --- a/src/test/java/com/corbado/integration/UserServiceIT.java +++ b/src/test/java/com/corbado/integration/UserServiceIT.java @@ -74,7 +74,6 @@ void test_UserDelete_ExpectSuccess() throws CorbadoServerException, StandardExce CorbadoServerException.class, () -> { final UserEntity ret = this.fixture.get(user.getUserID()); - System.out.println(ret.toString()); }); assertNotNull(e); assertEquals(400, e.getHttpStatusCode()); @@ -93,7 +92,6 @@ void test_UserGet_ExpectNotFound() { CorbadoServerException.class, () -> { final UserEntity ret = this.fixture.get("usr-1234567890"); - System.out.println(ret.toString()); }); assertNotNull(e); assertEquals(400, e.getHttpStatusCode()); From a23fb4043fa2fc7e0aed829e3f9bee32d0df82c1 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Wed, 14 Aug 2024 15:59:08 +0200 Subject: [PATCH 30/59] Fixed session service in SDK, refactoring, added SDK version --- VERSION | 1 + .../exceptions/CorbadoServerException.java | 17 ++++++------ src/main/java/com/corbado/sdk/Config.java | 7 +++++ src/main/java/com/corbado/sdk/CorbadoSdk.java | 26 +++++++++++++------ .../com/corbado/services/SessionService.java | 21 ++++++++++++++- 5 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..8a9ecc2 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.0.1 \ No newline at end of file diff --git a/src/main/java/com/corbado/exceptions/CorbadoServerException.java b/src/main/java/com/corbado/exceptions/CorbadoServerException.java index 84422ac..734e352 100644 --- a/src/main/java/com/corbado/exceptions/CorbadoServerException.java +++ b/src/main/java/com/corbado/exceptions/CorbadoServerException.java @@ -1,10 +1,12 @@ package com.corbado.exceptions; -import com.corbado.generated.invoker.ApiException; -import com.google.gson.Gson; import java.util.Collections; import java.util.List; import java.util.Optional; + +import com.corbado.generated.invoker.ApiException; +import com.google.gson.Gson; + import lombok.AllArgsConstructor; import lombok.Data; import lombok.Getter; @@ -12,7 +14,6 @@ import lombok.NonNull; import lombok.ToString; -// TODO: Complete /** Custom exception class for server-related errors. */ @ToString public class CorbadoServerException extends Exception { @@ -44,7 +45,7 @@ public CorbadoServerException(@NonNull final ApiException e) { */ public CorbadoServerException(final int statusCode, final String body) { final Gson gson = new Gson(); - httpStatusCode = statusCode; + this.httpStatusCode = statusCode; this.errorResponse = gson.fromJson(body, ErrorResponse.class); } @@ -61,10 +62,9 @@ public String getRequestId() { if (requestId.isPresent()) { return requestId.get(); - } else { - // requestId should always be present - return null; } + // requestId should always be present + return null; } /** @@ -80,9 +80,8 @@ public List getValidationMessages() { if (validationMessages.isPresent()) { return validationMessages.get(); - } else { - return Collections.emptyList(); } + return Collections.emptyList(); } /** The Class ErrorResponse. */ diff --git a/src/main/java/com/corbado/sdk/Config.java b/src/main/java/com/corbado/sdk/Config.java index 39217f6..5326e47 100644 --- a/src/main/java/com/corbado/sdk/Config.java +++ b/src/main/java/com/corbado/sdk/Config.java @@ -2,6 +2,7 @@ import java.net.MalformedURLException; import java.net.URL; + import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -42,6 +43,12 @@ public class Config { /** The frontend api with custom setter. */ @Getter private String frontendApi; + /** The short session length for session service. Default = 300. */ + @Getter @Setter private Integer shortSessionLength = 300; + + /** Flag to cache keys in session service. Default = true. */ + @Getter @Setter boolean cacheKeys = true; + // Constructors /** * Instantiates a new config. diff --git a/src/main/java/com/corbado/sdk/CorbadoSdk.java b/src/main/java/com/corbado/sdk/CorbadoSdk.java index a49019c..86f9dcb 100644 --- a/src/main/java/com/corbado/sdk/CorbadoSdk.java +++ b/src/main/java/com/corbado/sdk/CorbadoSdk.java @@ -1,20 +1,28 @@ package com.corbado.sdk; +import java.util.HashMap; +import java.util.Map; + import com.corbado.exceptions.StandardException; import com.corbado.generated.api.IdentifiersApi; import com.corbado.generated.api.UsersApi; import com.corbado.generated.invoker.ApiClient; import com.corbado.services.IdentifierService; +import com.corbado.services.SessionService; import com.corbado.services.UserService; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; -import java.util.Map; + import lombok.Getter; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; -/** The Class CorbadoSdk. */ +/** + * Entry point for the Corbado SDK. + * + *

This class provides interfaces to interact with the Corbado API, including user, session and + * identifier services. + */ @Slf4j public class CorbadoSdk { @@ -33,6 +41,10 @@ public class CorbadoSdk { private final IdentifierService identifiers = new IdentifierService(new IdentifiersApi(this.client)); + /** The sessions API. */ + @Getter(lazy = true) + private final SessionService sessions = new SessionService(this.config); + /** The client. */ private ApiClient client; @@ -82,9 +94,8 @@ private void initializeClient() throws StandardException { * * @return the language version */ - // TODO: add language version - private String getLanguageVersion() { - return "1.8"; + private static String getLanguageVersion() { + return System.getProperty("java.version"); } /** @@ -92,8 +103,7 @@ private String getLanguageVersion() { * * @return the version */ - // TODO: sdk version public String getVersion() { - return "1.0.0"; + return "0.0.1"; } } diff --git a/src/main/java/com/corbado/services/SessionService.java b/src/main/java/com/corbado/services/SessionService.java index f22e355..eaddbd1 100644 --- a/src/main/java/com/corbado/services/SessionService.java +++ b/src/main/java/com/corbado/services/SessionService.java @@ -16,6 +16,7 @@ import com.auth0.jwt.exceptions.JWTVerificationException; import com.auth0.jwt.interfaces.DecodedJWT; import com.corbado.entities.SessionValidationResult; +import com.corbado.sdk.Config; import com.corbado.utils.ValidationUtils; import lombok.Getter; @@ -33,6 +34,9 @@ public class SessionService { /** Number of keys that can be cached. */ private static final int JWK_CACHE_SIZE = 100; + /** The Constant DEFAULT_SESSION_LENGTH. */ + private static final int DEFAULT_SESSION_LENGTH = 300; + /** The short session cookie name. */ private String shortSessionCookieName; @@ -61,10 +65,11 @@ public SessionService( final String shortSessionCookieName, final String issuer, final String jwksUri, - final int shortSessionLength, + Integer shortSessionLength, final boolean cacheKeys) { ValidationUtils.validateNotEmpty(shortSessionCookieName, issuer, jwksUri); + shortSessionLength = (shortSessionLength != null) ? shortSessionLength : DEFAULT_SESSION_LENGTH; this.shortSessionCookieName = shortSessionCookieName; this.issuer = issuer; @@ -77,6 +82,20 @@ public SessionService( this.jwkProvider = jwkProviderBuilder.build(); } + /** + * Instantiates a new session service from config. + * + * @param config the config + */ + public SessionService(@NonNull Config config) { + this( + config.getShortSessionCookieName(), + config.getIssuer(), + config.getFrontendApi() + "/.well-known/jwks", + config.getShortSessionLength(), + config.isCacheKeys()); + } + /** * Sets the issuer mismatch error. * From 8b826ef6a50adb9c7db517c80def6bb0b4b00ed8 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:27:15 +0200 Subject: [PATCH 31/59] Update README --- README | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 115 insertions(+), 1 deletion(-) diff --git a/README b/README index e845566..d104c26 100644 --- a/README +++ b/README @@ -1 +1,115 @@ -README +GitHub Repo Cover + +# Corbado Java SDK + +[![License](https://img.shields.io/badge/license-MIT-green)](./LICENSE) +[![documentation](https://img.shields.io/badge/documentation-Corbado_Backend_API_Reference-blue.svg)](https://apireference.cloud.corbado.io/backendapi/) +[![Slack](https://img.shields.io/badge/slack-join%20chat-brightgreen.svg)](https://join.slack.com/t/corbado/shared_invite/zt-1b7867yz8-V~Xr~ngmSGbt7IA~g16ZsQ) + +The [Corbado](https://www.corbado.com) Java SDK provides convenient access to the [Corbado Backend API](https://apireference.cloud.corbado.io/backendapi/) from applications written in the Java language. + +:warning: The Corbado Java SDK is commonly referred to as a private client, specifically designed for usage within closed backend applications. This particular SDK should exclusively be utilized in such environments, as it is crucial to ensure that the API secret remains strictly confidential and is never shared. + +:rocket: [Getting started](#rocket-getting-started) | :hammer_and_wrench: [Services](#hammer_and_wrench-services) | :books: [Advanced](#books-advanced) | :speech_balloon: [Support & Feedback](#speech_balloon-support--feedback) + +## :rocket: Getting started + +### Requirements + +- Java 8 or later + +### Installation + +#### Gradle users + +Add this dependency to your project's build file: + +```groovy +implementation "com.corbado:corbado-java:0.0.1" +``` + +#### Maven users + +Add this dependency to your project's POM: + +```xml + + com.corbado + corbado-java + 0.0.1 + +``` + +### Usage + +To create a Corbado Java SDK instance you need to provide your `Project ID` and `API secret` which can be found at the [Developer Panel](https://app.corbado.com). + +```Java + final Config config = new Config(projectId, apiSecret); + CorbadoSdk sdk = new CorbadoSDK(config); +``` + +### Examples + +A list of examples can be found in the integration tests [here](/corbado-java/src/test/java/com/corbado/integration/). + +## :hammer_and_wrench: Services + +The Corbado Java SDK provides the following services: + +- `sessions` for managing sessions #TODO example +- `users` for managing users ([examples](/corbado-java/src/test/java/com/corbado/integration/UserServiceIT.java) +- `identifiers` for managing identifiers ([examples](/corbado-java/src/test/java/com/corbado/integration/IdentifierServiceIT.java) + +To use a specific service, such as `users`, invoke it as shown below: + +```Java +UserService users = sdk.getUsers(); +``` + +## :books: Advanced + +### Error handling + +The Corbado Java SDK throws exceptions for all errors. The following exceptions are thrown: + +- `CorbadoServerException` for server errors (server side) +- `StandardException` for everything else (client side) + +If the Backend API returns a HTTP status code other than 200, the Corbado Java SDK throws a `CorbadoServerException`. The `CorbadoServerException`class parses the server response to access all important data. One of the test cases: +```Java + final UserEntity user = TestUtils.createUser(); + this.fixture.delete(user.getUserID()); + final CorbadoServerException e = + assertThrows( + CorbadoServerException.class, + () -> { + final UserEntity ret = this.fixture.get(user.getUserID()); + }); + assertNotNull(e); + assertEquals(400, e.getHttpStatusCode()); + assertEquals("does not exist", e.getValidationMessages().get(0).getMessage()); + assertEquals("userID", e.getValidationMessages().get(0).getField()); +``` +Take a look at the `CorbadoServerException` class, if you need get more information out of exception. + + +## :speech_balloon: Support & Feedback + +### Report an issue + +If you encounter any bugs or have suggestions, please [open an issue](https://github.com/corbado/corbado-java/issues/new). + +### Slack channel + +Join our Slack channel to discuss questions or ideas with the Corbado team and other developers. + +[![Slack](https://img.shields.io/badge/slack-join%20chat-brightgreen.svg)](https://join.slack.com/t/corbado/shared_invite/zt-1b7867yz8-V~Xr~ngmSGbt7IA~g16ZsQ) + +### Email + +You can also reach out to us via email at vincent.delitz@corbado.com. + +### Vulnerability reporting + +Please report suspected security vulnerabilities in private to security@corbado.com. Please do NOT create publicly viewable issues for suspected security vulnerabilities. From c6a3b35f0fb0421ca24e6b1d980c90304b070b43 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Wed, 14 Aug 2024 16:29:22 +0200 Subject: [PATCH 32/59] add README file extention --- README => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README => README.md (100%) diff --git a/README b/README.md similarity index 100% rename from README rename to README.md From 32b211e41f57742c52f2c6bba0aefad744146e59 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:32:58 +0200 Subject: [PATCH 33/59] fix links in README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d104c26..cce3134 100644 --- a/README.md +++ b/README.md @@ -51,15 +51,15 @@ To create a Corbado Java SDK instance you need to provide your `Project ID` and ### Examples -A list of examples can be found in the integration tests [here](/corbado-java/src/test/java/com/corbado/integration/). +A list of examples can be found in the integration tests [here](/src/test/java/com/corbado/integration/). ## :hammer_and_wrench: Services The Corbado Java SDK provides the following services: - `sessions` for managing sessions #TODO example -- `users` for managing users ([examples](/corbado-java/src/test/java/com/corbado/integration/UserServiceIT.java) -- `identifiers` for managing identifiers ([examples](/corbado-java/src/test/java/com/corbado/integration/IdentifierServiceIT.java) +- `users` for managing users ([examples](/src/test/java/com/corbado/integration/UserServiceIT.java) +- `identifiers` for managing identifiers ([examples](/src/test/java/com/corbado/integration/IdentifierServiceIT.java) To use a specific service, such as `users`, invoke it as shown below: From 6839c9fbe7bb00969a0c54ebf5160a9cbc38f994 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:35:02 +0200 Subject: [PATCH 34/59] Update README.md --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cce3134..050ee48 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,8 @@ A list of examples can be found in the integration tests [here](/src/test/java/c The Corbado Java SDK provides the following services: - `sessions` for managing sessions #TODO example -- `users` for managing users ([examples](/src/test/java/com/corbado/integration/UserServiceIT.java) -- `identifiers` for managing identifiers ([examples](/src/test/java/com/corbado/integration/IdentifierServiceIT.java) +- `users` for managing users ([examples](/src/test/java/com/corbado/integration/UserServiceIT.java)) +- `identifiers` for managing identifiers ([examples](/src/test/java/com/corbado/integration/IdentifierServiceIT.java)) To use a specific service, such as `users`, invoke it as shown below: @@ -78,13 +78,14 @@ The Corbado Java SDK throws exceptions for all errors. The following exceptions If the Backend API returns a HTTP status code other than 200, the Corbado Java SDK throws a `CorbadoServerException`. The `CorbadoServerException`class parses the server response to access all important data. One of the test cases: ```Java + UserService users = sdk.getUsers(); final UserEntity user = TestUtils.createUser(); - this.fixture.delete(user.getUserID()); + users.delete(user.getUserID()); final CorbadoServerException e = assertThrows( CorbadoServerException.class, () -> { - final UserEntity ret = this.fixture.get(user.getUserID()); + final UserEntity ret = users.get(user.getUserID()); }); assertNotNull(e); assertEquals(400, e.getHttpStatusCode()); From 5ccf5a92101b01781f79eb97a812cda89827d538 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Fri, 16 Aug 2024 15:40:11 +0200 Subject: [PATCH 35/59] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bf6b7e0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Corbado GmbH + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 895d02ef30682252fd1f462e4263e95fcaad8ab4 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 16 Aug 2024 16:17:50 +0200 Subject: [PATCH 36/59] Reduced logging during test, added new functions for identifier service, fixed jwkProwider url --- .../corbado/services/IdentifierService.java | 59 ++++++++++++++++++- .../com/corbado/services/SessionService.java | 27 +++++---- .../integration/IdentifierServiceIT.java | 34 ++++++++--- 3 files changed, 99 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/corbado/services/IdentifierService.java b/src/main/java/com/corbado/services/IdentifierService.java index a61a45a..2bed66e 100644 --- a/src/main/java/com/corbado/services/IdentifierService.java +++ b/src/main/java/com/corbado/services/IdentifierService.java @@ -9,7 +9,9 @@ import com.corbado.generated.model.IdentifierStatus; import com.corbado.generated.model.IdentifierType; import com.corbado.generated.model.IdentifierUpdateReq; +import com.corbado.generated.model.Paging; import com.corbado.services.base.ApiService; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -166,7 +168,7 @@ public boolean existsByValueAndType( } /** - * List by user id with paging. + * List all identifiers (active and inactive) by user id with paging. * * @param userID the user ID (with or without 'usr-' prefix) * @param page the page @@ -186,6 +188,61 @@ public IdentifierList listAllByUserIdWithPaging( return list(null, Arrays.asList("userID:eq:" + userID), page, pageSize); } + /** + * List all identifiers (active and inactive) by user id and type with paging. + * + * @param userID the user ID + * @param type the type of identifier (email, phone, username) + * @param page the page + * @param pageSize the page size + * @return the identifier list + * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize + * the response body + */ + public IdentifierList listAllByUserIdAndTypeWithPaging( + @NonNull String userID, + @NonNull final IdentifierType type, + @Nullable final Integer page, + @Nullable final Integer pageSize) + throws CorbadoServerException { + + // filter queries are using userID without prefix + if (userID.startsWith(USER_ID_PREFIX)) { + userID = userID.substring(USER_ID_PREFIX.length()); + } + return list( + null, Arrays.asList("userID:eq:" + userID, "identifierType:eq:" + type), page, pageSize); + } + + /** + * Gets list of all (active and inactive) email addresses by user id. + * + * @param userID the user ID + * @return the single email by user id + * @throws CorbadoServerException If fail to call the API, e.g. server error or cannot deserialize + * the response body + */ + public List listAllEmailsByUserId(@NonNull final String userID) + throws CorbadoServerException { + final ArrayList list = new ArrayList<>(); + final IdentifierList firstRes = + listAllByUserIdAndTypeWithPaging(userID, IdentifierType.EMAIL, null, null); + list.addAll(firstRes.getIdentifiers()); + final Paging paging = firstRes.getPaging(); + // if there are more results unread + while (paging.getPage() < paging.getTotalPages()) { + // fetch further entries + final Integer currentPage = paging.getPage(); + paging.setPage(currentPage + 1); + final IdentifierList temp = + listAllByUserIdAndTypeWithPaging(userID, IdentifierType.EMAIL, paging.getPage(), null); + // update paging + list.addAll(temp.getIdentifiers()); + } + + return list; + } + /** * Updates a login identifier (e.g. from pending to verified) * diff --git a/src/main/java/com/corbado/services/SessionService.java b/src/main/java/com/corbado/services/SessionService.java index eaddbd1..aa83791 100644 --- a/src/main/java/com/corbado/services/SessionService.java +++ b/src/main/java/com/corbado/services/SessionService.java @@ -1,10 +1,5 @@ package com.corbado.services; -import java.security.interfaces.RSAPublicKey; -import java.util.concurrent.TimeUnit; - -import org.apache.commons.lang3.StringUtils; - import com.auth0.jwk.Jwk; import com.auth0.jwk.JwkException; import com.auth0.jwk.JwkProvider; @@ -18,7 +13,11 @@ import com.corbado.entities.SessionValidationResult; import com.corbado.sdk.Config; import com.corbado.utils.ValidationUtils; - +import java.net.MalformedURLException; +import java.net.URL; +import java.security.interfaces.RSAPublicKey; +import java.util.concurrent.TimeUnit; +import org.apache.commons.lang3.StringUtils; import lombok.Getter; import lombok.NonNull; import lombok.Setter; @@ -75,11 +74,17 @@ public SessionService( this.issuer = issuer; this.jwksUri = jwksUri; - final JwkProviderBuilder jwkProviderBuilder = new JwkProviderBuilder(this.jwksUri); - if (cacheKeys) { - jwkProviderBuilder.cached(JWK_CACHE_SIZE, shortSessionLength, TimeUnit.SECONDS); + JwkProviderBuilder jwkProviderBuilder; + try { + jwkProviderBuilder = new JwkProviderBuilder(new URL(jwksUri)); + if (cacheKeys) { + jwkProviderBuilder.cached(JWK_CACHE_SIZE, shortSessionLength, TimeUnit.SECONDS); + } + this.jwkProvider = jwkProviderBuilder.build(); + } catch (final MalformedURLException e) { + // MalformedURL should not happen, since its validated in config before. We do not want to + // retrow this error to make code generation with lombok easier. } - this.jwkProvider = jwkProviderBuilder.build(); } /** @@ -87,7 +92,7 @@ public SessionService( * * @param config the config */ - public SessionService(@NonNull Config config) { + public SessionService(@NonNull final Config config) { this( config.getShortSessionCookieName(), config.getIssuer(), diff --git a/src/test/java/com/corbado/integration/IdentifierServiceIT.java b/src/test/java/com/corbado/integration/IdentifierServiceIT.java index d375e85..81aa66f 100644 --- a/src/test/java/com/corbado/integration/IdentifierServiceIT.java +++ b/src/test/java/com/corbado/integration/IdentifierServiceIT.java @@ -6,10 +6,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; - -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import com.corbado.base.AbstractSdkTest; import com.corbado.exceptions.CorbadoServerException; import com.corbado.exceptions.StandardException; @@ -21,7 +17,9 @@ import com.corbado.generated.model.IdentifierType; import com.corbado.services.IdentifierService; import com.corbado.util.TestUtils; - +import java.util.List; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import lombok.extern.slf4j.Slf4j; /** The Class UserServiceIT. */ @@ -184,10 +182,6 @@ void test_getIdentifiersForUserId_ExpectListOfIdentifiers() void test_ListIdentifiersAll_ExpectSuccess() throws CorbadoServerException, StandardException { final IdentifierList ret = fixture.list(null, null, null, 100); - for (final Identifier x : ret.getIdentifiers()) { - log.error("Userid: {}, Value: {}", x.getUserID(), x.getValue()); - } - assertNotNull(ret); } @@ -222,4 +216,26 @@ void test_updateIdentifier_ExpectSuccess() TEST_USER_EMAIL_IDENTIFIER.getValue(), TEST_USER_EMAIL_IDENTIFIER.getType()); assertEquals(IdentifierStatus.PRIMARY, ret.getIdentifiers().get(0).getStatus()); } + + /** + * Test list all emails by user id expect success. + * + * @throws CorbadoServerException + */ + @Test + void test_listAllEmailsByUserId_expectSuccess() throws CorbadoServerException { + final int testSize = 21; + for (int i = 0; i < testSize; i++) { + fixture.create( + TEST_USER_ID, + new IdentifierCreateReq() + .identifierType(IdentifierType.EMAIL) + .identifierValue(TestUtils.createRandomTestEmail()) + .status(IdentifierStatus.VERIFIED)); + } + + final List ret = fixture.listAllEmailsByUserId(TEST_USER_ID); + // one email was already created before + assertEquals(testSize + 1, ret.size()); + } } From 8c40633f71e4f4c10bcf7b8328198559dd431d24 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 16 Aug 2024 17:25:07 +0200 Subject: [PATCH 37/59] Made test prefer actual environment variables over dotenv variables --- src/test/java/com/corbado/util/TestUtils.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/corbado/util/TestUtils.java b/src/test/java/com/corbado/util/TestUtils.java index 00a5f8a..7a49f70 100644 --- a/src/test/java/com/corbado/util/TestUtils.java +++ b/src/test/java/com/corbado/util/TestUtils.java @@ -94,11 +94,25 @@ public static String generateString(final int length, final String characters) { * @throws StandardException the standard exception */ public static CorbadoSdk instantiateSDK() throws StandardException { + final Dotenv dotenv = Dotenv.load(); + String apiSecret = System.getenv(CORBADO_API_SECRET); + + // If the environment variable is not set, then fallback to dotenv + if (apiSecret == null || apiSecret.isEmpty()) { + apiSecret = dotenv.get(CORBADO_API_SECRET, "missing CORBADO_API_SECRET"); + } + // Check for CORBADO_PROJECT_ID + String projectId = System.getenv(CORBADO_PROJECT_ID); + if (projectId == null || projectId.isEmpty()) { + projectId = dotenv.get(CORBADO_PROJECT_ID, "missing CORBADO_PROJECT_ID"); + } - final String apiSecret = dotenv.get(CORBADO_API_SECRET, "missing CORBADO_API_SECRET"); - final String projectId = dotenv.get(CORBADO_PROJECT_ID, "missing CORBADO_PROJECT_ID"); - final String backendApi = dotenv.get(CORBADO_BACKEND_API); + // Check for CORBADO_BACKEND_API + String backendApi = System.getenv(CORBADO_BACKEND_API); + if (backendApi == null || backendApi.isEmpty()) { + backendApi = dotenv.get(CORBADO_BACKEND_API); + } if (backendApi == null || backendApi == "") { return new CorbadoSdk(new Config(projectId, apiSecret, backendApi)); From 66ff09c8bac920a71bfd11996ef214b38adc85bd Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 16 Aug 2024 17:25:33 +0200 Subject: [PATCH 38/59] added gpg sign and publishing plugins --- pom.xml | 56 +++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index e85baa1..f0981f3 100644 --- a/pom.xml +++ b/pom.xml @@ -43,6 +43,16 @@ + + + org.sonatype.central + central-publishing-maven-plugin + 0.5.0 + true + + central + + org.apache.maven.plugins @@ -216,19 +226,39 @@ 9.3 - - - validate - - true - true - - - check - - - - + + + validate + + true + true + + + check + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + --pinentry-mode + loopback + + + From a0e141a7929f217321f78edd758944cbf13be8cd Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 16 Aug 2024 17:38:29 +0200 Subject: [PATCH 39/59] added project information to pom.xml --- pom.xml | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index f0981f3..fc49042 100644 --- a/pom.xml +++ b/pom.xml @@ -1,18 +1,34 @@ - 4.0.0 - com.corbado - corbado-java - jar - 0.0.1 - Corbado Java - Corbado Java SDK + 4.0.0 + com.corbado + corbado-java + jar + 0.0.1 + Corbado Java + Corbado Java SDK + https://github.com/corbado/corbado-java + + + + + MIT + https://opensource.org/license/MIT + + + + + scm:git:git@github.com:corbado/corbado-java.git + scm:git:git@github.com:corbado/corbado-java.git + https://github.com/corbado/corbado-java + HEAD + - OpenAPI-Generator Contributors - team@openapitools.org - OpenAPITools.org - http://openapitools.org + Corbado Team + support@corbado.com + Corbado + https://github.com/corbado/corbado-java From 03281b685fa2be0afb6aac509175f947db944559 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Tue, 20 Aug 2024 09:53:00 +0200 Subject: [PATCH 40/59] Added spring boot example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 050ee48..b173f5c 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ A list of examples can be found in the integration tests [here](/src/test/java/c The Corbado Java SDK provides the following services: -- `sessions` for managing sessions #TODO example +- `sessions` for managing sessions ([example spring boot application](https://github.com/corbado/example-passkeys-java-spring-boot)) - `users` for managing users ([examples](/src/test/java/com/corbado/integration/UserServiceIT.java)) - `identifiers` for managing identifiers ([examples](/src/test/java/com/corbado/integration/IdentifierServiceIT.java)) From 542ddf413c7d08b6101f35df6f99ecfac498fb1b Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:16:19 +0200 Subject: [PATCH 41/59] Update github actions for better resource usage --- .github/workflows/ci.yml | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b61db22..0c51929 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,65 +29,61 @@ jobs: uses: actions/checkout@v4 - name: Setup Java - id: setup-jre uses: actions/setup-java@v4 with: java-version: "17" # always use 17 LTS for building distribution: zulu architecture: x64 - - name: Set Test Java Runtime Environment variable - run: echo "JAVA_TEST_HOME=${{ steps.setup-jre.outputs.path }}" >> $GITHUB_ENV - - name: Cache Maven dependencies uses: actions/cache@v2 with: path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ hashFiles('**/src/**') }} restore-keys: | ${{ runner.os }}-maven- - name: Install dependencies run: mvn clean install -DskipTests + - name: Save Maven build artifacts + if: success() + uses: actions/upload-artifact@v3 + with: + name: maven-artifacts + path: target/ + test: name: Test runs-on: ubuntu-latest + needs: build # Ensure build job runs before this one strategy: fail-fast: false matrix: - java-version: - - "8" - - "11" - - "17" - - "18" - - "19" - - "20" + java-version: ["8", "11", "17", "18", "19", "20"] steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v3 + with: + name: maven-artifacts + - name: Setup Test Java Runtime - id: setup-test-jre uses: actions/setup-java@v4 with: java-version: ${{ matrix.java-version }} distribution: zulu architecture: x64 - - name: Set Test Java Runtime Environment variable - run: echo "JAVA_TEST_HOME=${{ steps.setup-test-jre.outputs.path }}" >> $GITHUB_ENV - - - name: Display version - run: echo "JAVA_TEST_HOME=$JAVA_TEST_HOME" - - name: Cache Maven dependencies for tests uses: actions/cache@v2 with: path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ matrix.java-version }}-${{ hashFiles('**/pom.xml') }} + key: ${{ runner.os }}-maven-${{ matrix.java-version }}-${{ hashFiles('**/pom.xml') }}-${{ hashFiles('**/src/**') }} restore-keys: | ${{ runner.os }}-maven- From 54be88f46e319bb425d646e51d660d53d836656d Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:53:12 +0200 Subject: [PATCH 42/59] Add deployment stage on version tags for CI/CD --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c51929..23955b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,3 +90,42 @@ jobs: - name: Run test suite run: mvn --batch-mode --update-snapshots verify + deploy: + name: Deploy to Maven Central + runs-on: ubuntu-latest + needs: build + + if: startsWith(github.ref, 'refs/tags/v') # Only run on version tags + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + java-version: "17" + distribution: zulu + architecture: x64 + + - name: Cache Maven dependencies + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ hashFiles('**/src/**') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Setup GPG for Signing + run: | + echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import + echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf + echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf + gpg-connect-agent reloadagent /bye + + - name: Deploy to Maven Central + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: mvn clean deploy -P release + From 047b91c4caf27034de17a14620c774cc55802f81 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Fri, 23 Aug 2024 15:25:05 +0200 Subject: [PATCH 43/59] corrected backendApi setter, added delete() for users and identifiers, --- src/main/java/com/corbado/sdk/Config.java | 7 ++- .../corbado/services/IdentifierService.java | 16 ++++++ .../integration/IdentifierServiceIT.java | 15 ++++++ .../corbado/integration/UserServiceIT.java | 51 ++++++++++++------- src/test/java/com/corbado/util/TestUtils.java | 35 ++++++------- 5 files changed, 86 insertions(+), 38 deletions(-) diff --git a/src/main/java/com/corbado/sdk/Config.java b/src/main/java/com/corbado/sdk/Config.java index 5326e47..1ab6b12 100644 --- a/src/main/java/com/corbado/sdk/Config.java +++ b/src/main/java/com/corbado/sdk/Config.java @@ -2,7 +2,6 @@ import java.net.MalformedURLException; import java.net.URL; - import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -19,6 +18,9 @@ public class Config { // Fields + /** The Constant API_VERSION. */ + private static final String API_VERSION = "2"; + /** API secret must begin with this prefix. */ private static final String API_SERCRET_PREFIX = "corbado1_"; @@ -105,7 +107,8 @@ public void setBackendApi(final String backendApi) { } catch (final MalformedURLException e) { throw new IllegalArgumentException("Invalid backend API URL: " + e.getMessage()); } - this.backendApi = backendApi; + + this.backendApi = backendApi + "/v" + API_VERSION; // add v2 to the end of backendApi } /** diff --git a/src/main/java/com/corbado/services/IdentifierService.java b/src/main/java/com/corbado/services/IdentifierService.java index 2bed66e..fb163db 100644 --- a/src/main/java/com/corbado/services/IdentifierService.java +++ b/src/main/java/com/corbado/services/IdentifierService.java @@ -282,4 +282,20 @@ public Identifier updateStatus( throws CorbadoServerException { return updateStatus(userID, identifierID, new IdentifierUpdateReq().status(status)); } + + /** + * Delete. + * + * @param userID the user ID + * @param identifierID the identifier ID + * @throws CorbadoServerException If fail to call the API or to delete the object. + */ + public void delete(@NonNull final String userID, @NonNull final String identifierID) + throws CorbadoServerException { + try { + client.identifierDelete(userID, identifierID); + } catch (final ApiException e) { + throw new CorbadoServerException(e); + } + } } diff --git a/src/test/java/com/corbado/integration/IdentifierServiceIT.java b/src/test/java/com/corbado/integration/IdentifierServiceIT.java index 81aa66f..f4f5c27 100644 --- a/src/test/java/com/corbado/integration/IdentifierServiceIT.java +++ b/src/test/java/com/corbado/integration/IdentifierServiceIT.java @@ -238,4 +238,19 @@ void test_listAllEmailsByUserId_expectSuccess() throws CorbadoServerException { // one email was already created before assertEquals(testSize + 1, ret.size()); } + + /** Test for successfully deleting a user. * */ + @Test + void test_DeleteIdentifier_ExpectSuccess() throws CorbadoServerException, StandardException { + final Identifier identifier = + fixture.create( + TEST_USER_ID, + new IdentifierCreateReq() + .identifierType(IdentifierType.EMAIL) + .identifierValue(TestUtils.createRandomTestEmail()) + .status(IdentifierStatus.VERIFIED)); + + // Success if no exception is thrown + fixture.delete(identifier.getUserID(), identifier.getIdentifierID()); + } } diff --git a/src/test/java/com/corbado/integration/UserServiceIT.java b/src/test/java/com/corbado/integration/UserServiceIT.java index ef31eaf..989ef09 100644 --- a/src/test/java/com/corbado/integration/UserServiceIT.java +++ b/src/test/java/com/corbado/integration/UserServiceIT.java @@ -3,10 +3,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; - -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import com.corbado.base.AbstractSdkTest; import com.corbado.entities.UserEntity; import com.corbado.exceptions.CorbadoServerException; @@ -14,6 +10,8 @@ import com.corbado.generated.model.UserCreateReq; import com.corbado.services.UserService; import com.corbado.util.TestUtils; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; /** The Class UserServiceIT. */ class UserServiceIT extends AbstractSdkTest { @@ -64,16 +62,17 @@ void test_UserCreateWithoutStatus_ExpectNullPoinerException() throws CorbadoServ assertThrows(NullPointerException.class, () -> this.fixture.create(req)); } - /** Test for successfully deleting a user. * */ + /** + * Test for retrieving a user that does not exist. Should return a 'Bad request' with validation + * message "does not exist" on field "userID" + */ @Test - void test_UserDelete_ExpectSuccess() throws CorbadoServerException, StandardException { - final UserEntity user = TestUtils.createUser(); - this.fixture.delete(user.getUserID()); + void test_UserGet_ExpectNotFound() { final CorbadoServerException e = assertThrows( CorbadoServerException.class, () -> { - final UserEntity ret = this.fixture.get(user.getUserID()); + final UserEntity ret = this.fixture.get("usr-1234567890"); }); assertNotNull(e); assertEquals(400, e.getHttpStatusCode()); @@ -81,17 +80,23 @@ void test_UserDelete_ExpectSuccess() throws CorbadoServerException, StandardExce assertEquals("userID", e.getValidationMessages().get(0).getField()); } - /** - * Test for retrieving a user that does not exist. Should return a 'Bad request' with validation - * message "does not exist" on field "userID" - */ + /** Test for successfully retrieving a user. * */ @Test - void test_UserGet_ExpectNotFound() { + void test_UserGet_ExpectSuccess() throws CorbadoServerException, StandardException { + final UserEntity user = TestUtils.createUser(); + final UserEntity ret = this.fixture.get(user.getUserID()); + assertEquals(user, ret); + this.fixture.delete(user.getUserID()); + } + + /** Test for successfully deleting a user. * */ + @Test + void test_DeleteUnknownUser_ExpectFailed() throws CorbadoServerException, StandardException { final CorbadoServerException e = assertThrows( CorbadoServerException.class, () -> { - final UserEntity ret = this.fixture.get("usr-1234567890"); + this.fixture.delete("usr-1234"); }); assertNotNull(e); assertEquals(400, e.getHttpStatusCode()); @@ -99,12 +104,20 @@ void test_UserGet_ExpectNotFound() { assertEquals("userID", e.getValidationMessages().get(0).getField()); } - /** Test for successfully retrieving a user. * */ + /** Test for successfully deleting a user. * */ @Test - void test_UserGet_ExpectSuccess() throws CorbadoServerException, StandardException { + void test_Delete_ExpectUserWillNotBeFound() throws CorbadoServerException, StandardException { final UserEntity user = TestUtils.createUser(); - final UserEntity ret = this.fixture.get(user.getUserID()); - assertEquals(user, ret); this.fixture.delete(user.getUserID()); + final CorbadoServerException e = + assertThrows( + CorbadoServerException.class, + () -> { + final UserEntity ret = this.fixture.get(user.getUserID()); + }); + assertNotNull(e); + assertEquals(400, e.getHttpStatusCode()); + assertEquals("does not exist", e.getValidationMessages().get(0).getMessage()); + assertEquals("userID", e.getValidationMessages().get(0).getField()); } } diff --git a/src/test/java/com/corbado/util/TestUtils.java b/src/test/java/com/corbado/util/TestUtils.java index 7a49f70..e8448ac 100644 --- a/src/test/java/com/corbado/util/TestUtils.java +++ b/src/test/java/com/corbado/util/TestUtils.java @@ -1,7 +1,5 @@ package com.corbado.util; -import java.util.Random; - import com.corbado.entities.UserEntity; import com.corbado.exceptions.CorbadoServerException; import com.corbado.exceptions.StandardException; @@ -9,8 +7,8 @@ import com.corbado.generated.model.UserStatus; import com.corbado.sdk.Config; import com.corbado.sdk.CorbadoSdk; - import io.github.cdimascio.dotenv.Dotenv; +import java.util.Random; /** The Class TestUtils. */ public class TestUtils { @@ -100,23 +98,26 @@ public static CorbadoSdk instantiateSDK() throws StandardException { // If the environment variable is not set, then fallback to dotenv if (apiSecret == null || apiSecret.isEmpty()) { - apiSecret = dotenv.get(CORBADO_API_SECRET, "missing CORBADO_API_SECRET"); + apiSecret = dotenv.get(CORBADO_API_SECRET, "missing CORBADO_API_SECRET"); + } + // Check for CORBADO_PROJECT_ID + String projectId = System.getenv(CORBADO_PROJECT_ID); + if (projectId == null || projectId.isEmpty()) { + projectId = dotenv.get(CORBADO_PROJECT_ID, "missing CORBADO_PROJECT_ID"); } - // Check for CORBADO_PROJECT_ID - String projectId = System.getenv(CORBADO_PROJECT_ID); - if (projectId == null || projectId.isEmpty()) { - projectId = dotenv.get(CORBADO_PROJECT_ID, "missing CORBADO_PROJECT_ID"); - } - - // Check for CORBADO_BACKEND_API - String backendApi = System.getenv(CORBADO_BACKEND_API); - if (backendApi == null || backendApi.isEmpty()) { - backendApi = dotenv.get(CORBADO_BACKEND_API); - } + // Check for CORBADO_BACKEND_API + String backendApi = System.getenv(CORBADO_BACKEND_API); + if (backendApi == null || backendApi.isEmpty()) { + backendApi = dotenv.get(CORBADO_BACKEND_API); + } + Config config = null; if (backendApi == null || backendApi == "") { - return new CorbadoSdk(new Config(projectId, apiSecret, backendApi)); + config = new Config(projectId, apiSecret); + } else { + config = new Config(projectId, apiSecret, backendApi); } - return new CorbadoSdk(new Config(projectId, apiSecret)); + + return new CorbadoSdk(config); } } From 22087b2449384c3cb33eda3aa047f4c9cdf01d3a Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Tue, 27 Aug 2024 10:43:25 +0200 Subject: [PATCH 44/59] Prepare for release 1.0.0 --- README.md | 4 ++-- VERSION | 2 +- pom.xml | 2 +- src/main/java/com/corbado/sdk/CorbadoSdk.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b173f5c..1411a2d 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ The [Corbado](https://www.corbado.com) Java SDK provides convenient access to th Add this dependency to your project's build file: ```groovy -implementation "com.corbado:corbado-java:0.0.1" +implementation "com.corbado:corbado-java:1.0.0" ``` #### Maven users @@ -36,7 +36,7 @@ Add this dependency to your project's POM: com.corbado corbado-java - 0.0.1 + 1.0.0 ``` diff --git a/VERSION b/VERSION index 8a9ecc2..afaf360 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.1 \ No newline at end of file +1.0.0 \ No newline at end of file diff --git a/pom.xml b/pom.xml index fc49042..fec7c10 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.corbado corbado-java jar - 0.0.1 + 1.0.0 Corbado Java Corbado Java SDK https://github.com/corbado/corbado-java diff --git a/src/main/java/com/corbado/sdk/CorbadoSdk.java b/src/main/java/com/corbado/sdk/CorbadoSdk.java index 86f9dcb..748e3b9 100644 --- a/src/main/java/com/corbado/sdk/CorbadoSdk.java +++ b/src/main/java/com/corbado/sdk/CorbadoSdk.java @@ -104,6 +104,6 @@ private static String getLanguageVersion() { * @return the version */ public String getVersion() { - return "0.0.1"; + return "1.0.0"; } } From 17bc12917a956b1b63a46db5838690b65f0597f8 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Tue, 27 Aug 2024 08:53:40 +0200 Subject: [PATCH 45/59] Fix sdk instantiation in Tests --- src/test/java/com/corbado/util/TestUtils.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/corbado/util/TestUtils.java b/src/test/java/com/corbado/util/TestUtils.java index e8448ac..8d0694c 100644 --- a/src/test/java/com/corbado/util/TestUtils.java +++ b/src/test/java/com/corbado/util/TestUtils.java @@ -1,5 +1,9 @@ package com.corbado.util; +import java.util.Random; + +import org.apache.commons.lang3.StringUtils; + import com.corbado.entities.UserEntity; import com.corbado.exceptions.CorbadoServerException; import com.corbado.exceptions.StandardException; @@ -7,8 +11,8 @@ import com.corbado.generated.model.UserStatus; import com.corbado.sdk.Config; import com.corbado.sdk.CorbadoSdk; + import io.github.cdimascio.dotenv.Dotenv; -import java.util.Random; /** The Class TestUtils. */ public class TestUtils { @@ -108,11 +112,11 @@ public static CorbadoSdk instantiateSDK() throws StandardException { // Check for CORBADO_BACKEND_API String backendApi = System.getenv(CORBADO_BACKEND_API); - if (backendApi == null || backendApi.isEmpty()) { + if (StringUtils.isEmpty(backendApi)) { backendApi = dotenv.get(CORBADO_BACKEND_API); } Config config = null; - if (backendApi == null || backendApi == "") { + if (StringUtils.isEmpty(backendApi)) { config = new Config(projectId, apiSecret); } else { config = new Config(projectId, apiSecret, backendApi); From 1a32c34204d16cf39177bc14d976ea5a7d5f75c2 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Wed, 28 Aug 2024 12:45:16 +0200 Subject: [PATCH 46/59] Added secrets to ci.yml --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23955b0..49f91a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,6 +88,10 @@ jobs: ${{ runner.os }}-maven- - name: Run test suite + env: + CORBADO_API_SECRET: ${{ secrets.CORBADO_API_SECRET }} + CORBADO_PROJECT_ID: ${{ secrets.CORBADO_PROJECT_ID }} + CORBADO_BACKEND_API: ${{ secrets.CORBADO_BACKEND_API }} run: mvn --batch-mode --update-snapshots verify deploy: @@ -126,6 +130,5 @@ jobs: env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} run: mvn clean deploy -P release From 87e1fae541bbe9177b55a60073a3e1d5d09683ee Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Wed, 28 Aug 2024 12:58:17 +0200 Subject: [PATCH 47/59] Added gpg key configuration during build stage --- .github/workflows/ci.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49f91a3..9711698 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,14 @@ jobs: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ hashFiles('**/src/**') }} restore-keys: | - ${{ runner.os }}-maven- + ${{ runner.os }}-maven + + - name: Configure GPG Key + run: | + echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import + env: + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + - name: Install dependencies run: mvn clean install -DskipTests From 94230ade7e482195dd36528f5df7558b9517c8c1 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:31:19 +0200 Subject: [PATCH 48/59] change BACKEND_API to variable in gh actions --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9711698..27a6b52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,7 +98,7 @@ jobs: env: CORBADO_API_SECRET: ${{ secrets.CORBADO_API_SECRET }} CORBADO_PROJECT_ID: ${{ secrets.CORBADO_PROJECT_ID }} - CORBADO_BACKEND_API: ${{ secrets.CORBADO_BACKEND_API }} + CORBADO_BACKEND_API: ${{ vars.CORBADO_BACKEND_API }} run: mvn --batch-mode --update-snapshots verify deploy: From 61c275b8bf22c345228b842fc5b5fe6a660d3bb1 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:36:05 +0200 Subject: [PATCH 49/59] debug gpg key --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27a6b52..17c21bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,7 @@ jobs: - name: Configure GPG Key run: | + echo "${GPG_PRIVATE_KEY:0:100}" # Print the first 100 characters of the base64 key for debugging echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import env: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} From 18af23b90699180873beb15ed038d82a539f7e2f Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Wed, 28 Aug 2024 14:52:33 +0200 Subject: [PATCH 50/59] Update pom.xml to verify with gpg only on install phase --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fec7c10..efed559 100644 --- a/pom.xml +++ b/pom.xml @@ -262,7 +262,7 @@ sign-artifacts - verify + install sign From 9682eb75637c2fb5922770960755f51c64e30e52 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Wed, 28 Aug 2024 14:55:47 +0200 Subject: [PATCH 51/59] Update pom.xml to allow autopublish in publishing-plugin --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index efed559..3232d24 100644 --- a/pom.xml +++ b/pom.xml @@ -66,6 +66,7 @@ 0.5.0 true + true central From ed1db35f7312e0fd653b86965ebe4aa9e42f8ee9 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Wed, 28 Aug 2024 15:17:04 +0200 Subject: [PATCH 52/59] Prepare for release 1.0.1 --- README.md | 4 ++-- VERSION | 2 +- pom.xml | 2 +- src/main/java/com/corbado/sdk/CorbadoSdk.java | 8 +++----- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1411a2d..8665f78 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ The [Corbado](https://www.corbado.com) Java SDK provides convenient access to th Add this dependency to your project's build file: ```groovy -implementation "com.corbado:corbado-java:1.0.0" +implementation "com.corbado:corbado-java:1.0.1" ``` #### Maven users @@ -36,7 +36,7 @@ Add this dependency to your project's POM: com.corbado corbado-java - 1.0.0 + 1.0.1 ``` diff --git a/VERSION b/VERSION index afaf360..7f20734 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0 \ No newline at end of file +1.0.1 \ No newline at end of file diff --git a/pom.xml b/pom.xml index 3232d24..8c005f4 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.corbado corbado-java jar - 1.0.0 + 1.0.1 Corbado Java Corbado Java SDK https://github.com/corbado/corbado-java diff --git a/src/main/java/com/corbado/sdk/CorbadoSdk.java b/src/main/java/com/corbado/sdk/CorbadoSdk.java index 748e3b9..70cf667 100644 --- a/src/main/java/com/corbado/sdk/CorbadoSdk.java +++ b/src/main/java/com/corbado/sdk/CorbadoSdk.java @@ -1,8 +1,5 @@ package com.corbado.sdk; -import java.util.HashMap; -import java.util.Map; - import com.corbado.exceptions.StandardException; import com.corbado.generated.api.IdentifiersApi; import com.corbado.generated.api.UsersApi; @@ -12,7 +9,8 @@ import com.corbado.services.UserService; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; - +import java.util.HashMap; +import java.util.Map; import lombok.Getter; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; @@ -104,6 +102,6 @@ private static String getLanguageVersion() { * @return the version */ public String getVersion() { - return "1.0.0"; + return "1.0.1"; } } From bfa783887ac0dab8d29c85b2dd1ebb76b938dcb8 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Wed, 28 Aug 2024 15:36:35 +0200 Subject: [PATCH 53/59] fix deployment job --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17c21bc..9ba8613 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,6 @@ jobs: - name: Configure GPG Key run: | - echo "${GPG_PRIVATE_KEY:0:100}" # Print the first 100 characters of the base64 key for debugging echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import env: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} @@ -129,7 +128,7 @@ jobs: - name: Setup GPG for Signing run: | - echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import + echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode | gpg --batch --import echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf gpg-connect-agent reloadagent /bye @@ -138,5 +137,6 @@ jobs: env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} run: mvn clean deploy -P release From 188b0a6d692d07e6bde52df162a51107f83ec645 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Wed, 28 Aug 2024 15:43:08 +0200 Subject: [PATCH 54/59] fix deployment job dependency --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ba8613..96d7507 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,7 +104,7 @@ jobs: deploy: name: Deploy to Maven Central runs-on: ubuntu-latest - needs: build + needs: [build,test] if: startsWith(github.ref, 'refs/tags/v') # Only run on version tags steps: From e5c2958b4a7e932f70deec5cf8247d876895bf40 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:36:10 +0200 Subject: [PATCH 55/59] Update ci.yml --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96d7507..aad3b83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,7 +99,7 @@ jobs: CORBADO_API_SECRET: ${{ secrets.CORBADO_API_SECRET }} CORBADO_PROJECT_ID: ${{ secrets.CORBADO_PROJECT_ID }} CORBADO_BACKEND_API: ${{ vars.CORBADO_BACKEND_API }} - run: mvn --batch-mode --update-snapshots verify + run: mvn --batch-mode --update-snapshots verify -DskipInstall deploy: name: Deploy to Maven Central @@ -111,6 +111,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Download build artifacts + uses: actions/download-artifact@v3 + with: + name: maven-artifacts + - name: Setup Java uses: actions/setup-java@v4 with: @@ -138,5 +143,5 @@ jobs: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - run: mvn clean deploy -P release + run: mvn deploy -DskipTests -DskipInstall --settings .github/maven/settings.xml -P release From 114c0617a66e428bbe270b796fd892d21c7c444d Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:19:19 +0200 Subject: [PATCH 56/59] Update ci.yml --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aad3b83..4e751fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,6 +122,7 @@ jobs: java-version: "17" distribution: zulu architecture: x64 + server-id: central - name: Cache Maven dependencies uses: actions/cache@v2 @@ -143,5 +144,5 @@ jobs: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - run: mvn deploy -DskipTests -DskipInstall --settings .github/maven/settings.xml -P release + run: mvn deploy -DskipTests -DskipInstall --settings -P release From e42aeb3d815f94dcfcf0b261f6e213d37ab641a9 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev Date: Wed, 28 Aug 2024 17:31:00 +0200 Subject: [PATCH 57/59] update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e751fc..3042284 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,5 +144,5 @@ jobs: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - run: mvn deploy -DskipTests -DskipInstall --settings -P release + run: mvn deploy -DskipTests -DskipInstall -P release From b7d9c30e8907c67422da68de923d3ed1c6f299d4 Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:52:39 +0200 Subject: [PATCH 58/59] Added settings.xml to ci.yml --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3042284..903c721 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,7 +115,32 @@ jobs: uses: actions/download-artifact@v3 with: name: maven-artifacts - + + - name: Create Maven settings.xml + run: | + mkdir -p ~/.m2 + echo ' + + + central + ${{ secrets.OSSRH_USERNAME }} + ${{ secrets.OSSRH_PASSWORD }} + + + + + release + + 2.2.27 + + + + + release + + ' > ~/.m2/settings.xml - name: Setup Java uses: actions/setup-java@v4 with: @@ -144,5 +169,5 @@ jobs: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - run: mvn deploy -DskipTests -DskipInstall -P release + run: mvn deploy -DskipTests -DskipInstall -P release --settings ~/.m2/settings.xml From 87c81bb2e905641b6b4703dbc9fed93954c20d7f Mon Sep 17 00:00:00 2001 From: Aleksandr Balakirev <55588266+alexbalakirev@users.noreply.github.com> Date: Wed, 28 Aug 2024 21:03:24 +0200 Subject: [PATCH 59/59] Update ci.yml --- .github/workflows/ci.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 903c721..b23950b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,21 +125,10 @@ jobs: central - ${{ secrets.OSSRH_USERNAME }} + ${{ vars.OSSRH_USERNAME }} ${{ secrets.OSSRH_PASSWORD }} - - - release - - 2.2.27 - - - - - release - ' > ~/.m2/settings.xml - name: Setup Java uses: actions/setup-java@v4 @@ -166,8 +155,6 @@ jobs: - name: Deploy to Maven Central env: - OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} - OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - run: mvn deploy -DskipTests -DskipInstall -P release --settings ~/.m2/settings.xml + run: mvn deploy -DskipTests -P release --settings ~/.m2/settings.xml